我在 Debian Bullseye Xfce 上。请在下面找到我的系统的相关详细信息:
vrgovinda@krishna:~$ uname -a
Linux krishna 5.10.0-8-amd64 #1 SMP Debian 5.10.46-5 (2021-09-23) x86_64 GNU/Linux
的版本apt-get
如下:
vrgovinda@krishna:~$ apt-get -v
apt 2.2.4 (amd64)
Supported modules:
*Ver: Standard .deb
*Pkg: Debian dpkg interface (Priority 30)
Pkg: Debian APT solver interface (Priority -1000)
Pkg: Debian APT planner interface (Priority -1000)
S.L: 'deb' Debian binary tree
S.L: 'deb-src' Debian source tree
Idx: Debian Source Index
Idx: Debian Package Index
Idx: Debian Translation Index
Idx: Debian dpkg status file
Idx: Debian deb file
Idx: Debian dsc file
Idx: Debian control file
Idx: EDSP scenario file
Idx: EIPP scenario file
当我运行sudo apt autoclean
时,预计.deb
除了最新版本之外的所有文件都应该被删除,即那些无法再下载的文件,但这不会在我的系统中发生。我在下面发布了示例:
/var/cache/apt/archives$ ls
libuuid1_2.36.1-7_amd64.deb libuuid1_2.36.1-8_amd64.deb lock
libuuid1_2.36.1-7_i386.deb libuuid1_2.36.1-8_i386.deb partial
现在我运行autoclean
:
/var/cache/apt/archives$ sudo apt autoclean
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
文件夹的内容archives
保持原样:
/var/cache/apt/archives$ ls
libuuid1_2.36.1-7_amd64.deb libuuid1_2.36.1-8_amd64.deb lock
libuuid1_2.36.1-7_i386.deb libuuid1_2.36.1-8_i386.deb partial
令人惊讶的是,按预期sudo apt clean
清除了文件夹。archives
因此,只有该autoclean
功能不起作用,这很奇怪。
vrgovinda@krishna:~$ sudo apt clean
[sudo] password for vrgovinda:
vrgovinda@krishna:~$ cd /var/cache/apt/archives/
vrgovinda@krishna:/var/cache/apt/archives$ ls
lock partial
结果apt policy libuuid1
:
vrgovinda@krishna:/var/cache/apt/archives$ apt policy libuuid1
libuuid1:
Installed: 2.36.1-8
Candidate: 2.36.1-8
Version table:
*** 2.36.1-8 500
500 file:/home/vrgovinda/bullseye-deb-files ./ Packages
500 deb.debian.org/debian bullseye/main amd64 Packages
100 /var/lib/dpkg/status
2.36.1-7 500
500 file:/home/vrgovinda/bullseye-deb-files ./ Packages
您说“ ......预计除最新版本之外的所有 .deb 文件都应被删除”。不是
autoclean
这样。来自man apt-get
:和
(我添加的额外格式和粗体强调)
感谢@StephenKitt。我从他的评论中得到了线索。他让我检查其输出
apt policy libuuid1
如下:它表明我的本地存储库
/home/vrgovinda/bullseye-deb-files
具有与.deb
文件夹中相同的archives
文件。.deb
每次操作后我都移动了所有文件install
,只是为了备份下载的.deb
文件。我还包含/home/vrgovinda/bullseye-deb-files
了一个受信任的存储库,sources.list
如下所示:答:当我
/home/vrgovinda/bullseye-deb-files
从中删除时sources.list
,sudo apt autoclean
它的功能是否符合预期。正如@cas 和@terdon 指出的那样,
autoclean
不会删除.deb
其他存储库中其他地方存在的那些文件。谢谢大家的好意。