我有一个运行内核 3.13.0-35-generic 的 14.04.5 Web 服务器。sudo apt-get upgrade
运行正常,没有错误。sudo apt-get upgrade
并且sudo apt-get dist-upgrade
都显示 0 个需要升级的包。
如果我运行,sudo apt-get install linux-image-generic
它会提供安装 linux-image-3.13.0-100-generic 和 linux-image-extra-3.13.0-100-generic。
这会影响自动升级。为什么除非我特别要求,否则它不会显示此升级?
sudo apt-mark showhold
没有显示结果。
我已开启自动安全升级:
$ cat apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
$ cat apt.conf.d/50unattended-upgrades |grep -v \/\/
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
};
Unattended-Upgrade::Package-Blacklist { };
所有安全存储库似乎都可以正常访问
$ sudo apt-get update|grep security
Hit http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/restricted Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/multiverse Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/multiverse amd64 Packages
Hit http://security.ubuntu.com trusty-security/main i386 Packages
Hit http://security.ubuntu.com trusty-security/restricted i386 Packages
Hit http://security.ubuntu.com trusty-security/universe i386 Packages
Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
Hit http://security.ubuntu.com trusty-security/restricted Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
安装的内核已有好几年了:
$ ls -l /boot/vmlinuz-*
-rw------- 1 root root 5776416 May 2 2014 /boot/vmlinuz-3.13.0-24-generic
-rw------- 1 root root 5806368 Aug 14 2014 /boot/vmlinuz-3.13.0-35-generic
$ sudo apt-mark showmanual|grep linux
libselinux1
linux-firmware
linux-headers-server
linuxinfo
util-linux
$ sudo apt-mark showauto|grep linux
libselinux1:i386
linux-headers-3.13.0-100
linux-headers-3.13.0-100-generic
linux-headers-3.13.0-24
linux-headers-3.13.0-24-generic
linux-headers-3.13.0-35
linux-headers-3.13.0-35-generic
linux-headers-generic
linux-image-3.13.0-24-generic
linux-image-3.13.0-35-generic
linux-image-extra-3.13.0-24-generic
linux-image-extra-3.13.0-35-generic
linux-libc-dev
为什么运行时我没有看到任何可用的内核更新apt-get updates
?
答案1
问题是,在某个时候,该linux-image-generic
软件包被删除了。该软件包是新 Linux 内核映像的虚拟软件包。删除它不会破坏您的系统,但会停止新内核的安装。如果它没有“安装”,则无法检测到内核的新版本,因为此软件包没有新版本,并且没有对特定内核软件包的新依赖。
如果您卸载特定内核,则可能会发生这种情况,因为它也会随之卸载linux-image-generic
。
要修复此问题,请运行sudo apt-get install linux-image-generic
。这将安装最新的内核版本作为依赖项。然后您还应该看到 linux-image-generic 被标记为 manual,而之前它缺失了:
$ sudo apt-mark showmanual linux-image-generic
linux-image-generic
此外,sudo apt-get autoremove
现在应该开始提供删除旧内核的功能,就像以前一样。