debian更换内核(最简单的一键脚本)

用这种不是最新的,但是可以更换比较新的内核,比如我刚刚换了4.19的,事实上现在官网最新的是4.20的。

1,设置源(stretch-backports)

guoyanzhang@bogon:~$ sudo cat /etc/apt/sources.list
[sudo] guoyanzhang 的密码:
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib

2,更新源文件

guoyanzhang@bogon:~$ sudo apt-get update

3,搜索内核

guoyanzhang@bogon:~$ apt-cache search linux-image

这个时候会出现很多,我选的是

linux-image-4.19.0-0.bpo.1-amd64 - Linux 4.19 for 64-bit PCs (signed)

4,安装

guoyanzhang@bogon:~$ sudo apt-get install linux-image-4.19.0-0.bpo.1-amd64

5,卸载原来的内核

guoyanzhang@bogon:~$ sudo apt-get remove linux-image-4.9.0-8-amd64

打linux-image然后tab会自动出来几个内核的,选原来的删除就是了,这个时候会跳出一个窗口,选N就行。

6,重启

guoyanzhang@bogon:~$ uname -r
4.19.0-0.bpo.1-amd64

linux-image-4.19.0-0.bpo.1-amd64 - Linux 4.19 for 64-bit PCs (signed)

参考:https://www.cmsky.com/debian-upgrade-kernel/

神目网:所有文章如无特别注明均为原创
编辑作者:神目
转载请以:超链接形式注明出处“神目”

广告投放联系:admin@sxlog.com

相关推荐

网友评论(0)