Debian 9更新到最新的Linux内核

栏目: 服务器 · Linux · 发布时间: 7年前

内容简介:喜欢折腾的同学,会豪气如何升级 Debian Stretch 的内核到新版。遗憾的是现在能搜到的升级 Debian Linux 内核的文章多数是使用Ubuntu的deb安装包,其实这样装上去是有问题,常见的问题是,总会提示需要这里简单记录一下,如何使用Debian官方源更新到最新的内核;以及如何是用 Kernel.org 的deb源,更新内核到最新的 5.x 版本。到此,我们已成功通过官方安装源,升级内核至最新的 4.19.0 的版本了。另一种方式,是通过 kernel.org 官方提供的安装包,更新到最新

喜欢折腾的同学,会豪气如何升级 Debian Stretch 的内核到新版。遗憾的是现在能搜到的升级 Debian Linux 内核的文章多数是使用Ubuntu的deb安装包,其实这样装上去是有问题,常见的问题是,总会提示需要 apt --fix-broken install

Debian 9更新到最新的 <a href='https://www.codercto.com/topics/18170.html'>Linux</a> 内核

这里简单记录一下,如何使用Debian官方源更新到最新的内核;以及如何是用 Kernel.org 的deb源,更新内核到最新的 5.x 版本。

修改更新源

name@debian.cn:~$ echo -e "deb http://http.debian.net/debian stretch-backports main\ndeb-src http://http.debian.net/debian stretch-backports main" | sudo tee /etc/apt/sources.list.d/sources.list

deb http://http.debian.net/debian stretch-backports main
deb-src http://http.debian.net/debian stretch-backports main

更新package

name@debian.cn:~$ sudo apt-get update && sudo apt-get dist-upgrade

安装新版内核镜像

name@debian.cn:~$ sudo apt-cache search linux-image
 linux-headers-4.9.0-8-amd64 - Header files for Linux 4.9.0-8-amd64
 linux-headers-4.9.0-8-rt-amd64 - Header files for Linux 4.9.0-8-rt-amd64
 linux-image-4.9.0-8-amd64 - Linux 4.9 for 64-bit PCs
 linux-image-4.9.0-8-amd64-dbg - Debug symbols for linux-image-4.9.0-8-amd64
 linux-image-4.9.0-8-rt-amd64 - Linux 4.9 for 64-bit PCs, PREEMPT_RT
 linux-image-4.9.0-8-rt-amd64-dbg - Debug symbols for linux-image-4.9.0-8-rt-amd64
 linux-image-amd64 - Linux for 64-bit PCs (meta-package)
 linux-image-amd64-dbg - Debugging symbols for Linux amd64 configuration (meta-package)
 linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package), PREEMPT_RT
 linux-image-rt-amd64-dbg - Debugging symbols for Linux rt-amd64 configuration (meta-package)
 linux-headers-4.19.0-0.bpo.2-amd64 - Header files for Linux 4.19.0-0.bpo.2-amd64
 linux-headers-4.19.0-0.bpo.2-cloud-amd64 - Header files for Linux 4.19.0-0.bpo.2-cloud-amd64
 linux-headers-4.19.0-0.bpo.2-rt-amd64 - Header files for Linux 4.19.0-0.bpo.2-rt-amd64
 linux-image-4.19.0-0.bpo.2-amd64-dbg - Debug symbols for linux-image-4.19.0-0.bpo.2-amd64
 linux-image-4.19.0-0.bpo.2-amd64-unsigned - Linux 4.19 for 64-bit PCs
 linux-image-4.19.0-0.bpo.2-cloud-amd64-dbg - Debug symbols for linux-image-4.19.0-0.bpo.2-cloud-amd64
 linux-image-4.19.0-0.bpo.2-cloud-amd64-unsigned - Linux 4.19 for x86-64 cloud
 linux-image-4.19.0-0.bpo.2-rt-amd64-dbg - Debug symbols for linux-image-4.19.0-0.bpo.2-rt-amd64
 linux-image-4.19.0-0.bpo.2-rt-amd64-unsigned - Linux 4.19 for 64-bit PCs, PREEMPT_RT
...
...
...
name@debian.cn:~$ sudo apt-get install linux-headers-4.19.0-0.bpo.2-amd64 -y

重启使新内核生效

name@debian.cn:~$ sudo reboot
name@debian.cn:~$ sudo apt-get autoremove

到此,我们已成功通过官方安装源,升级内核至最新的 4.19.0 的版本了。另一种方式,是通过 kernel.org 官方提供的安装包,更新到最新的内核。

更新 Kernel.org 提供的内核

mirrors.kernel.org 上直接下载deb包,比如当前最新版本为 5.0.0 :

name@debian.cn:~$ wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-image-5.0.0-trunk-all_-amd64_5.0.6-trunk-all__amd64.deb
 name@debian.cn:~$ wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-kbuild-5.0.5.0.6-trunk-all__amd64.deb
 name@debian.cn:~$ wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-headers-5.0.0-trunk-all_-common_5.0.6-trunk-all__all.deb
 name@debian.cn:~$ wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-headers-5.0.0-trunk-all_-amd64_5.0.6-trunk-all__amd64.deb
 name@debian.cn:~$ wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-headers-5.0.0-trunk-all_-all-amd64_5.0.6-trunk-all__amd64.deb
 name@debian.cn:~$ wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-headers-5.0.0-trunk-all_-all_5.0.6-trunk-all__amd64.deb
name@debian.cn:~$ sudo dpkg -i linux-*.deb

注意文件名可能有差异,在下载时需要注意。最后一步安装后,重启一次,就可以用 dpkg -l | grep linux 看到新安装的 5.0.2 的内核了。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Code

Code

Charles Petzold / Microsoft Press / 2000-10-21 / USD 29.99

Paperback Edition What do flashlights, the British invasion, black cats, and seesaws have to do with computers? In CODE, they show us the ingenious ways we manipulate language and invent new means of ......一起来看看 《Code》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具