![Apt-get 保留内核映像(通用、服务器和额外)](https://linux22.com/image/1123901/Apt-get%20%E4%BF%9D%E7%95%99%E5%86%85%E6%A0%B8%E6%98%A0%E5%83%8F%EF%BC%88%E9%80%9A%E7%94%A8%E3%80%81%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%92%8C%E9%A2%9D%E5%A4%96%EF%BC%89.png)
今天,apt-get 告诉我有几个软件包被扣留了。输入后apt-get dist-upgrade -su
我得到了以下信息:
apt-get dist-upgrade -su
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed
linux-image-3.13.0-44-generic linux-image-extra-3.13.0-44-generic
The following packages will be upgraded:
linux-image-generic linux-image-server
2 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade.
Inst linux-image-3.13.0-44-generic (3.13.0-44.73 Ubuntu:14.04/trusty-updates [amd64])
Inst linux-image-extra-3.13.0-44-generic (3.13.0-44.73 Ubuntu:14.04/trusty-updates [amd64])
Inst linux-image-server [3.13.0.43.50] (3.13.0.44.51 Ubuntu:14.04/trusty-updates [amd64]) []
Inst linux-image-generic [3.13.0.43.50] (3.13.0.44.51 Ubuntu:14.04/trusty-updates [amd64])
Conf linux-image-3.13.0-44-generic (3.13.0-44.73 Ubuntu:14.04/trusty-updates [amd64])
Conf linux-image-extra-3.13.0-44-generic (3.13.0-44.73 Ubuntu:14.04/trusty-updates [amd64])
Conf linux-image-generic (3.13.0.44.51 Ubuntu:14.04/trusty-updates [amd64])
Conf linux-image-server (3.13.0.44.51 Ubuntu:14.04/trusty-updates [amd64])
我不确定该怎么做。如果服务器没有重新启动,或者 grub 没有自动启动正确的内核,我就会被锁在 800 公里外的服务器之外,注定要花很多钱进行人工干预。我无法物理访问服务器。
14.04 服务器是否需要安装所有这些?哪个内核将自动启动?服务器?额外的?通用的?
我现在的内核是3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
。
另外,我必须承认,在根据 sourceforge 的完美服务器指南(14.04,apache)安装服务器时,我可能搞砸了 apt-get 源列表文件。在“重置”我的专用网络服务器时,托管公司会自动安装我选择的 Linux 发行版。我选择了 14.04 generic(这意味着,理论上,他们没有对其进行太多修改)。但它附带了一个 sources.list 文件,其中包含公司托管的存储库。我不知道该怎么做,所以我只是添加了指南中推荐的那些sourceforge
,以确保万无一失。Aptitude 确实有点抱怨(告诉我它停用了一些东西),但随后它继续顺利运行,我的服务器设置也是如此。
这个问题会再次困扰我吗?
以下是我当前的 sources.list 文件。
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty universe
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty universe
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty multiverse
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner
答案1
内核通常会被自动阻止。这是因为有些管理员不想更新内核,因为这样可能会出现问题甚至爆炸(比喻)。
你的行动方针应该是这样的:
- 更新(
sudo apt-get dist-upgrade
或类似)到最新内核如果你希望其中包含修复并且愿意在最新内核失败时将其移除。首先记下您现在拥有的内核版本 (uname -a
),以及正在安装的最高版本号。您稍后可能需要此信息。 - 启动到新安装的内核。如果一切启动正常,则转到 3(a)。否则,转到 3(b)。
- 要采取的步骤:
(a) 如果一切正常,您可以尝试使用自动删除来删除旧内核。您可以删除旧内核以节省空间,或将内核保留为备份。sudo apt-get autoremove
是一个很好的起点。如果没有删除任何内容,那么您需要寻找删除旧内核的方法。
(b) 如果一切都没有不是运行正常,然后在 grub 启动时,选择“其他选项”或类似选项,并选择您保留并引用的旧内核编号。从该列表中选择内核。然后删除新安装的内核版本(这就是我说要记下软件包版本和名称的原因)