ubuntu禁止内核自动更新

ubuntu禁止内核自动更新

查看已安装内核
dpkg --get-selections |grep linux-image

查看正在使用的内核
uname -a

禁止内核更新
sudo apt-mark hold linux-image-5.3.0-42-generic
sudo apt-mark hold linux-image-extra-5.3.0-42-generic

重启内核更新
sudo apt-mark unhold linux-image-5.3.0-42-generic
sudo apt-mark unhold linux-image-extra-5.3.0-42-generic

删除不用的内核

1,先查看已安装内核
dpkg --get-selections |grep linux-image

2,删除不用的内核

sudo apt-get remove linux-image-4.15.0-101-generic

sudo apt-get remove linux-image-extra-4.15.0-101-generic

Ubuntu18.04关闭内核自动更新

ubuntu默认启动了自动更新内核,为了避免出现重启系统后遇到错误进入不到系统中去,我们可以进一步关闭内核更新,使用当前内核。

root@linux:~# sudo apt-mark hold linux-image-generic linux-headers-generic 
linux-image-generic set on hold
linux-headers-generic set on hold

如果要重启启动内核更新:

root@linux:~# sudo apt-mark unhold linux-image-generic linux-headers-generic
原文地址:https://www.cnblogs.com/111testing/p/13668275.html