这与 Ubuntu 18.04 LTS 有关。我试图通过删除不需要的 Linux 内核来节省空间,但看起来它仍然会安装其他“未签名”的内核映像。为什么是这样?
这是日志:
root@ubuntu18:~# apt-get remove linux-image-4.18.0-15-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
linux-image-unsigned-4.18.0-15-generic
Suggested packages:
fdutils linux-hwe-doc-4.18.0 | linux-hwe-source-4.18.0 linux-hwe-tools
The following packages will be REMOVED:
linux-image-4.18.0-15-generic linux-modules-extra-4.18.0-15-generic
The following NEW packages will be installed:
linux-image-unsigned-4.18.0-15-generic
0 upgraded, 1 newly installed, 2 to remove and 8 not upgraded.
Need to get 8,219 kB of archives.
After this operation, 168 MB disk space will be freed.
Do you want to continue? [Y/n]
Run Code Online (Sandbox Code Playgroud)
发行版附带的原始 Linux 内核版本似乎是 4.18 版。刚刚安装的新版本是5.0。所以我想知道是否有理由“保留”4.18。
威拉万
小智 11
依赖性导致了它;查找“linux-modules”(“linux-modules-”)包并清除它。
sudo apt purge -f linux-modules-4.18.0-15-generic
Run Code Online (Sandbox Code Playgroud)
这似乎并不明显,但却是一个非常简单的解决方案 - 只需在一个命令中将它们都删除即可:
sudo apt-get remove --purge linux-image-4.18.0-15-generic linux-image-unsigned-4.18.0-15-generic
Run Code Online (Sandbox Code Playgroud)
或使用 bash 表达式:
apt-get remove --purge linux-image{,-unsigned}-4.18.0-15-generic
Run Code Online (Sandbox Code Playgroud)
我通过退出 apt 并将未签名的图像添加到apt-get remove命令的末尾来解决了这个问题。
小智 4
我使用为此目的创建的linux-purge实用程序解决了(解决了?)这个问题。
我使用的命令行是linux-purge -bc -k 1:
-b检查 /boot 中是否有不在 APT 中的内核
-c以交互方式选择要删除的内核
-k 1以保留较早的版本
然后我在文本 UI 中选择了两个内核(这可能会覆盖 -k 选项)。我留下了当前/正在运行的内核,其他内核被删除,所以它工作得很好。
| 归档时间: |
|
| 查看次数: |
3028 次 |
| 最近记录: |