当我登录到 Ubuntu 10.04.2 LTS 服务器时,我看到以下消息:
42 packages can be updated.
18 updates are security updates.
Run Code Online (Sandbox Code Playgroud)
但是当我尝试更新它时,没有任何东西像预期的那样升级:
$ sudo apt-get update
....snip....
Reading package lists... Done
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic-pae linux-headers-generic-pae linux-image-generic-pae
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Run Code Online (Sandbox Code Playgroud)
为什么没有任何更新,或者为什么 3(来自 apt-get)的计数与 42 不同?什么软件说42不合适?
(其他细节:这是服务器版,没有GUI;我没有接触过apt配置文件;我安装软件时拒绝允许自动更新)
hmo*_*liu 52
为了安装保留的软件包,您必须运行:
sudo apt-get update && sudo apt-get dist-upgrade
Run Code Online (Sandbox Code Playgroud)
尝试运行sudo apt-get update && sudo apt-get upgrade不会安装保留的软件包,因为apt-get upgrade默认情况下不会尝试安装新软件包(例如新内核版本);从手册页:在任何情况下都不会删除当前安装的软件包,或者检索和安装尚未安装的软件包。
但是apt-get dist-upgrade允许您在需要时安装新软件包(即新内核版本);从手册页:
dist-upgrade
dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new
versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important
packages at the expense of less important ones if necessary. So, dist-upgrade command may remove some packages. The
/etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also
apt_preferences(5) for a mechanism for overriding the general settings for individual packages.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
86173 次 |
| 最近记录: |