升级 Linux 内核而不安装 grub 依赖项?

升级 Linux 内核而不安装 grub 依赖项?

我在已经使用 rEFInd 进行启动的系统中安装了 Ubuntu 16.04。安装后,我删除了所有与 grub 相关的软件包。但是,每次发布新的内核版本时,它都会尝试安装一些我不需要的 grub 依赖项,因为我没有安装 grub。以下是我使用的命令:

$ sudo apt-get update && sudo apt-get upgrade
...
Fetched 306 kB in 0s (350 kB/s)    
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-headers-generic linux-signed-generic linux-signed-image-generic

因此之后我尝试使用dist-upgrade

$ sudo apt-get dist-upgradeReading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common
  linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic
  linux-image-4.4.0-72-generic linux-image-extra-4.4.0-72-generic
  linux-signed-image-4.4.0-72-generic os-prober
The following packages will be upgraded:
  linux-headers-generic linux-signed-generic linux-signed-image-generic
3 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 71.8 MB/71.8 MB of archives.
After this operation, 314 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

我尝试升级,然后删除 grub 包,但是,包管理器在配置和安装时失败grub-pc,就像此主题

有没有什么方法可以升级内核而不安装那些 grub 依赖项?

答案1

检查完依赖项后linux-headers-通用Linux 签名的通用Linux 签名映像通用。 我看到了没有任何其中的 依赖于grub。因此,只需使用apt-mark忽略所有与 grub 相关的包即可解决此问题:

$ sudo apt-mark hold grub* grub*:i386

dist-upgrade现在忽略 grub。

相关内容