Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于Ubuntu内核(更新和卸载内核、取消自动更新) #1

Open
chiwent opened this issue Aug 30, 2018 · 0 comments
Open

关于Ubuntu内核(更新和卸载内核、取消自动更新) #1

chiwent opened this issue Aug 30, 2018 · 0 comments
Labels
Linux Linux Notes

Comments

@chiwent
Copy link
Owner

chiwent commented Aug 30, 2018

关于Ubuntu内核(更新和卸载内核、取消自动更新)

Ubuntu升级新内核和卸载旧内核

先查看当前的内核版本:

uname -r

升级内核

以下方法默认开启了内核自动更新

1.如果要升级最新的内核(假设你很久没有update了)

升级软件包:

sudo apt update

查看可用内核:

apt-cache search linux-image

选择合适的内核后,sudo apt-get install安装相应内核

2.如果不需要更新最新内核

假设以前已经执行过sudo apt update,内核已经下载好,并且就用已经下载好的内核

先检查有什么已经下载过的内核:

dpkg --list | grep linux-image

选择合适的内核安装

另外,用户也可以上 http://kernel.ubuntu.com/~kernel-ppa/mainline/ 来下载自己需要的内核,然后sudo dpkg -i *.deb安装

卸载内核

注意:不要先盲目地卸载内核,起码要安装一个新的才可以卸载

查看内核安装情况:

dpkg --list | grep linux-image
dpkg --list | grep linux-headers

卸载内核:

sudo ap purge linux-image-xx
sudo apt purge linux-headers-xx
sudo apt autoremove

在上述操作都完成之后,执行sudo update-grub更新grub

Ubuntu如何关闭内核的自动更新

执行:

sudo apt-mark hold linux-image-generic linux-headers-generic

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

sudo apt-mark unhold linux-image-generic linux-headers-generic


参考:

How can I avoid kernel updates?
ubuntu升级软件但是禁用内核升级

@chiwent chiwent added the Linux Linux Notes label Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Linux Notes
Projects
None yet
Development

No branches or pull requests

1 participant