升降级Ubuntu的linux内核

升降级Ubuntu的linux内核


因工作需要,在电脑上装多个版本的linux内核。环境ubuntu 20.04。

  1. 访问:http://kernel.ubuntu.com/~kernel-ppa/mainline
    在这里插入图片描述

  2. 选择自己需要的指定版本
    这里会列出很多很多版本,建议直接搜索需要安装的版本号。
    在这里插入图片描述

  3. 点进去后,见以下界面。
    在这里插入图片描述

因uname -m显示系统cpu架构是x86_64,故而应下载amd64.deb后缀的文件。
需要下载:
amd64/linux-headers-5.10.1-051001-generic_5.10.1-051001.202012142031_amd64.deb
amd64/linux-headers-5.10.1-051001_5.10.1-051001.202012142031_all.deb
amd64/linux-image-unsigned-5.10.1-051001-generic_5.10.1-051001.202012142031_amd64.deb
amd64/linux-modules-5.10.1-051001-generic_5.10.1-051001.202012142031_amd64.deb

  1. 下载后,放到一个新文件夹里,保证里面除了这四个deb以外没有别的deb文件。
    在这里插入图片描述
  2. 在这个文件夹打开终端,dpkg安装
test@test-Vostro-3268:~/下载/5.10.1$ sudo dpkg -i ***.deb
[sudo] password for test: 
Selecting previously unselected package linux-headers-5.10.1-051001-generic.
dpkg: warning: files list file for package 'libctf0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cups-ipp-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fonts-noto-cjk-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgme0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnet-ssleay-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fonts-smc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libreoffice-style-elementary' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-pkg-resources' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjpeg8:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjpeg8:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gnome-calculator' missing; assuming package has no files currently installed
... ... ... ... 
dpkg: warning: files list file for package 'libwayland-client0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwayland-client0:i386' missing; assuming package has no files currently installed
(Reading database ... 61376 files and directories currently installed.)
Preparing to unpack linux-headers-5.10.1-051001-generic_5.10.1-051001.202012142031_amd64.deb ...
Unpacking linux-headers-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
Selecting previously unselected package linux-headers-5.10.1-051001.
Preparing to unpack linux-headers-5.10.1-051001_5.10.1-051001.202012142031_all.deb ...
Unpacking linux-headers-5.10.1-051001 (5.10.1-051001.202012142031) ...
Selecting previously unselected package linux-image-unsigned-5.10.1-051001-generic.
Preparing to unpack linux-image-unsigned-5.10.1-051001-generic_5.10.1-051001.202012142031_amd64.deb ...
Unpacking linux-image-unsigned-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
Selecting previously unselected package linux-modules-5.10.1-051001-generic.
Preparing to unpack linux-modules-5.10.1-051001-generic_5.10.1-051001.202012142031_amd64.deb ...
Unpacking linux-modules-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
Setting up linux-headers-5.10.1-051001 (5.10.1-051001.202012142031) ...
Setting up linux-modules-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
Setting up linux-headers-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
Setting up linux-image-unsigned-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
I: /boot/vmlinuz.old is now a symlink to vmlinuz-4.20.11-042011-generic
I: /boot/initrd.img.old is now a symlink to initrd.img-4.20.11-042011-generic
I: /boot/vmlinuz is now a symlink to vmlinuz-5.10.1-051001-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.10.1-051001-generic
Processing triggers for linux-image-unsigned-5.10.1-051001-generic (5.10.1-051001.202012142031) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.1-051001-generic
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.1-051001-generic
Found initrd image: /boot/initrd.img-5.10.1-051001-generic
Found linux image: /boot/vmlinuz-5.4.63-050463-generic
Found initrd image: /boot/initrd.img-5.4.63-050463-generic
Found linux image: /boot/vmlinuz-5.4.63
Found initrd image: /boot/initrd.img-5.4.63
Found linux image: /boot/vmlinuz-5.4.0-55-generic
Found initrd image: /boot/initrd.img-5.4.0-55-generic
Found linux image: /boot/vmlinuz-5.4.0-54-generic
Found initrd image: /boot/initrd.img-5.4.0-54-generic
Found linux image: /boot/vmlinuz-5.4.0-53-generic
Found initrd image: /boot/initrd.img-5.4.0-53-generic
Found linux image: /boot/vmlinuz-5.4.0-52-generic
Found initrd image: /boot/initrd.img-5.4.0-52-generic
Found linux image: /boot/vmlinuz-5.4.0-51-generic
Found initrd image: /boot/initrd.img-5.4.0-51-generic
Found linux image: /boot/vmlinuz-4.20.11-042011-generic
Found initrd image: /boot/initrd.img-4.20.11-042011-generic
Found linux image: /boot/vmlinuz-4.20.1-042001-generic
Found initrd image: /boot/initrd.img-4.20.1-042001-generic
Adding boot menu entry for UEFI Firmware Settings
done
  1. 查看是否处于已安装状态
dpkg -l | grep linux-

会显示出一堆相关的已安装软件名,其中能找到以下,则安装成功。
在这里插入图片描述
7. 重启后,在advanced options for ubuntu中可以选择想要的linux版本
重启开机后在终端中:
uname -r检查是否成功切换到对应版本。

test@test-Vostro-3268:~$ uname -r
5.10.1-051001-generic
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值