当前位置:   article > 正文

Ubuntu 20.04 升级最新内核、安装指定内核版本_ubuntu升级内核

ubuntu升级内核

Ubuntu 20.04 升级最新内核

Canonical宣布“Livepatch Services”上线,在为Linux Kernel安装更新之后并不需要重新启动计算机。自Linux 4.0分支开始用户就能在不重新启动的情况下更新内核包,不过Ubuntu是首个提供这项功能的发行版本。

运行更新命令

下载ubuntu-mainline-kernel脚本

 wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
  • 1

将脚本放在可执行路径中

sudo install ubuntu-mainline-kernel.sh /usr/local/bin/
  • 1

检查最新的可用内核版本

ubuntu-mainline-kernel.sh -c
  • 1

获得最新版本并确认这就是您想要安装在系统上的版本之后,运行

 sudo ubuntu-mainline-kernel.sh -i
  • 1

重新启动系统并检查内核版本

uname -rs
  • 1

卸载最新的Linux Kernel

 sudo ubuntu-mainline-kernel.sh -u
  • 1

首先重启系统,然后运行以下命令:

uname -rs
  • 1

安装指定内核版本

还是上文的安装脚本:
例如安装

# ubuntu-mainline-kernel.sh --help
Usage: /usr/local/bin/ubuntu-mainline-kernel.sh -c|-l|-r|-u

Download & install the latest kernel available from kernel.ubuntu.com

Arguments:
  -c               Check if a newer kernel version is available
  -i [VERSION]     Install kernel VERSION, see -l for list. You don't have to prefix
                   with v. E.g. -i 4.9 is the same as -i v4.9. If version is
                   omitted the latest available version will be installed
  -l [SEARCH]      List locally installed kernel versions. If an argument to this
                   option is supplied it will search for that
  -r [SEARCH]      List available kernel versions. If an argument to this option
                   is supplied it will search for that
  -u [VERSION]     Uninstall the specified kernel version. If version is omitted,
                   a list of max 10 installed kernel versions is displayed
  -h               Show this message

Optional:
  -s, --signed         Only install signed kernel packages (not implemented)
  -p, --path DIR       The working directory, .deb files will be downloaded into
                       this folder. If omitted, the folder /tmp/ubuntu-mainline-kernel.sh/
                       is used. Path is relative from $PWD
  -ll, --low-latency   Use the low-latency version of the kernel, only for amd64 & i386
  -lpae, --lpae        Use the Large Physical Address Extension kernel, only for armhf
  --snapdragon         Use the Snapdragon kernel, only for arm64
  -do, --download-only Only download the deb files, do not install them
  -ns, --no-signature  Do not check the gpg signature of the checksums file
  -nc, --no-checksum   Do not check the sha checksums of the .deb files
  -d, --debug          Show debug information, all internal command's echo their output
  --rc                 Also include release candidates
  --yes                Assume yes on all questions (use with caution!)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
# ubuntu-mainline-kernel.sh -i v5.8.0
Downloading index from kernel.ubuntu.com
Will download 6 files from kernel.ubuntu.com:
Downloading amd64/linux-headers-5.8.0-050800-generic_5.8.0-050800.202008022230_amd64.deb: 100%
Downloading amd64/linux-headers-5.8.0-050800_5.8.0-050800.202008022230_all.deb: 100%
Downloading amd64/linux-image-unsigned-5.8.0-050800-generic_5.8.0-050800.202008022230_amd64.deb: 100%  
Downloading amd64/linux-modules-5.8.0-050800-generic_5.8.0-050800.202008022230_amd64.deb: 100%
Downloading amd64/CHECKSUMS: 100%
Downloading amd64/CHECKSUMS.gpg: 100%
Importing kernel-ppa gpg key ok
Signature of checksum file has been successfully verified
Checksums of deb files have been successfully verified with sha256sum
Installing 4 packages
Cleaning up work folder
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

重新启动系统并检查内核版本

# uname -rs
Linux 5.8.0-050800-generic
  • 1
  • 2

前面的是Linux内核官方发布的内核版本,连字符后面的是Ubuntu内核定制小组的对应发行版内核修订号。

参考

如何在Ubuntu 20.04 LTS上安装最新Linux Kernel 5.10
参考URL: https://www.sohu.com/a/439265795_495675

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/58997
推荐阅读
相关标签
  

闽ICP备14008679号