“ apt-get clean”和“ apt-get clean all”有何区别?


90

该命令之间的区别是什么(如果有的话):

sudo apt-get clean

而这个命令:

sudo apt-get clean all

在我的Lubuntu 12.04系统上,模拟这些命令可以发现它们的行为完全相同:

ek@Apok:~$ apt-get -s clean
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin
ek@Apok:~$ apt-get -s clean all
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin
ek@Apok:~$

是否有过任何的区别apt-get与的行为cleanclean all?如果是这样,有什么区别,在什么情况下是相关的,我应该如何在两者之间进行选择?如果没有区别,那为什么clean all存在呢?

如果它们相同,那么通常可以将包名称作为参数clean all仍然有意义clean。但这不是事实-尝试将软件包名称传递给clean根本不会改变clean的行为,整个缓存仍然会被删除:

ek@Apok:~$ apt-get -s clean nano
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin

但是,这确实使我感到疑惑,也许clean all 它根本不存在(all就像nano上面的示例一样,正在发生的事情被忽略了)。

是否clean all只是一个都市传说?


6
“清洁都只是城市传说吗?” 是的先生。
Braiam 2014年

Answers:


186

sudo apt-get clean all

all只会被忽略,就像您在之后附加的其他任何内容一样clean

例如是一样的

sudo apt-get clean my room

5
是否(或曾经)建议使用任何文档clean all?跑步的习惯是如何sudo apt-get clean all产生的?行为曾经不同吗?还是clean all只是由于某种相似的make语法而引起混乱?
伊利亚·卡根

4
当我apt-get clean all在Google上进行搜索时,有48,900个结果(不过,诚然,前两个是针对此问题的)。另一方面,手册页未对此进行任何说明,并且我找不到建议使用它的任何官方资料。我想详细了解这是如何产生的...但是我怀疑这可能需要花费大量时间和精力。
伊利亚·卡根

3
一个杂乱的房间/桌子着你的潜意识,@ EliahKagan?:P
ish

9
添加“ all”的影响很可能是“ yum clean all”的宿醉

16
sudo apt-get clean my roomXD +1
Crimbo
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.