这可能是一个可能的错误,但它已经困扰我几天了。
apt-get upgrade
和之间的区别apt-get dist-upgrade
现在是众所周知和公认的,即升级安装/升级而dist-upgrade
能够安装/删除/升级如果软件包删除恰好是安装或升级另一个软件包所必需的。可以通过以下方式轻松发现包中的差异
(以下是一种快速而肮脏的方法,需要在终端中输入 sudo 密码才能进行复制粘贴。另外,由于我有几个包和驱动程序,我自己修补了一些需要保留的功能,因此我将 OR 包含在仅提取要安装和要升级的awk
那些,而不是列出要保留的那些,但是即使apt upgrade
输出中不存在这些行,以下内容也应该起作用):
$echo -e 'n' | sudo apt-get dist-upgrade | awk '
/be installed|be upgraded/{f=1;next}; /not upgraded|kept back/{f=0}f' | awk '
BEGIN {RS=" ";} {print $0}
' | grep . > apt_get_dist_list
$echo -e 'n' | sudo apt-get upgrade | awk '
/be installed|be upgraded/{f=1;next}; /not upgraded|kept back/{f=0}f' | awk '
BEGIN {RS=" ";} {print $0}
' | grep . > apt_get_upgrade_list
当我将两个输出与:
$diff apt_get_dist_list apt_get_upgrade_list | grep -E '<|>'
就我而言,我得到以下信息:
< gir1.2-nm-1.0
< libcpupower2
< linux-kbuild-5.2
< blueman
< linux-cpupower
< linux-headers-amd64
< linux-image-amd64
< pdf-parser
这使得差异非常明显,特别是考虑到linux-header-*
和linux-image-*
apt-get dist-upgrade
现在,如果我重复相同的apt upgrade
过程apt full-upgrade
$echo -e 'n' | sudo apt upgrade | awk '
/be installed|be upgraded/{f=1;next}; /not upgraded|kept back/{f=0}f' | awk '
BEGIN {RS=" ";} {print $0}
' | grep . > apt_upgrade_list
$echo -e 'n' | sudo apt full-upgrade | awk '
/be installed|be upgraded/{f=1;next}; /not upgraded|kept back/{f=0}f' | awk '
BEGIN {RS=" ";} {print $0}
' | grep . > apt_fullupgrade_list
并比较:
$diff apt_get_dist_list apt_fullupgrade_list | grep -E '<|>'
正如预期的那样,我一无所获,因为apt full-upgrade
并且apt-get dist-upgrade
旨在以相同的方式表现,但是当我比较时:
$diff apt_get_upgrade_list apt_upgrade_list | grep -E '<|>'
我得到与比较时相同的输出apt-get upgrade with apt-get dist-upgrade
。
> gir1.2-nm-1.0
> libcpupower2
> linux-kbuild-5.2
> blueman
> linux-cpupower
> linux-headers-amd64
> linux-image-amd64
> pdf-parser
我能得出的唯一结论是 that apt upgrade
is exactly the same as apt full-upgrade
which also make it as 相同apt-get dist-upgrade
,这最终意味着不仅是apt upgrade
多余的,而且更令人担忧的是目前apt
不允许相同的行为作为apt-get upgrade
.