软件更新程序与 apt-get update

软件更新程序与 apt-get update

我一直以为运行apt-get update后跟apt-get upgrade运行软件更新程序的命令行版本;然而,运行软件更新程序会导致以下软件包需要更新:

Complete Generic Linux kernel  
Header files relates to Linux kernel version 3.2.0  
Linux kernel headers for version 3.2.0 on 64 bit x86 SMP  
Generic Linux kernel headers  
Linux kernel image for version 3.2.0 on 64 bit x86 SMP  
General Linux kernel image  
Linux Kernel Headers for development

ISC DHCP client  
common file used by all the isc-dhcp* packages  
LightDM GObject client library  
graphical boot animation and logger-shared libraries  
DisplayManager  
graphical  boot animation and logger-main package  
graphical boot animation and logger-label control  
graphical boot animation and logger-ubuntu-logo theme (-logo)  
graphical boot animation and logger-ubuntu-logo theme (-text)  
Jabber/XMPP connection manager

(53.9 MB)

而运行apt-get updateapt-get upgrade得到以下结果:

Reading package lists... Done  
Building dependency tree  
Reading state information... Done  
The following packages have been kept back:  
  linux-generic linux-headers-generic linux-image-generic  
The following packages will be upgraded:  
  isc-dhcp-client isc-dhcp-common liblightdm-gobject-1-0 libplymouth2 lightdm  
  linux-libc-dev plymouth plymouth-label plymouth-theme-ubuntu-logo  
  plymouth-theme-ubuntu-text telepathy-gabble  
11 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.  
Need to get 2,594 kB of archives.  
After this operation, 2,048 B of additional disk space will be used.  

谁能解释一下发生了什么事?

答案1

这里似乎有些混乱。

  • apt-get update:这只是刷新可用包的列表。

  • apt-get upgrade:这将把所有已安装的包升级到最新版本。

  • apt-get dist-upgrade:与升级相同,但使用“智能”冲突解决系统,如果有必要,它将尝试升级最重要的软件包,而牺牲不太重要的软件包。

因此,如果你想确保当前安装的软件包是最新版本,你可以运行

apt-get update && apt-get upgrade

如果这导致问题,那么您可能需要尝试:

apt-get update && apt-get dist-upgrade

现在,您发布的消息与 无关dist-upgrade,它们只是简单的升级。它们之间也没有任何区别,只是软件更新程序为您提供了描述列出软件包apt-get名称。例如

Complete Generic Linux kernel  == linux-generic
ISC DHCP client                == isc-dhcp-client
Jabber/XMPP connection manager == telepathy-gabble  

如果您仔细阅读这两个列表,您会发现它们是完全相同的包。

也就是说,您发布的消息所表达的是完全相同的内容。

答案2

据我所知,你错过了第三部分:

apt-get dist-upgrade

实际上,apt-get upgrade 在某些情况下不会升级软件包,例如当它们更改依赖项或需要删除其他软件包时。但是 apt-get dist-upgrade 会。因此,要获得类似于 software-updater 的行为,您需要:

apt-get update && apt-get dist-upgrade

或者,如果你想玩得更安全一点:

apt-get update && apt-get upgrade && apt-get dist-upgrade

看:http://www.ghacks.net/2010/03/11/what-is-it-with-the-dist-upgrade-option-of-apt-get/
并且:https://askubuntu.com/q/194651/125726

相关内容