\u547d\u4ee4<\/a><\/p>\n\u5e2e\u52a9\uff1a<\/p>\n
\n
Usage: \/usr\/local\/bin\/ubuntu-mainline-kernel.sh -c|<\/span>-l|<\/span>-r|<\/span>-u\nDownload &<\/span> install<\/span> the latest kernel available from kernel.ubuntu.com\nArguments:\n -c<\/span> Check if<\/span> a newer kernel version is available\n -i<\/span> [<\/span>VERSION]<\/span> Install kernel VERSION, see -l<\/span> for<\/span> list. You don't have to prefix\n with v. E.g. -i 4.9 is the same as -i v4.9. If version is\n omitted the latest available version will be installed\n -l [SEARCH] List locally installed kernel versions. If an argument to this\n option is supplied it will search for that\n -r [SEARCH] List available kernel versions. If an argument to this option\n is supplied it will search for that\n -u [VERSION] Uninstall the specified kernel version. If version is omitted,\n a list of max 10 installed kernel versions is displayed\n -h Show this message\nOptional:\n -s, --signed Only install signed kernel packages (not implemented)\n -p, --path DIR The working directory, .deb files will be downloaded into\n this folder. If omitted, the folder \/tmp\/ubuntu-mainline-kernel.sh\/\n is used. Path is relative from $PWD\n -ll, --low-latency Use the low-latency version of the kernel, only for amd64 & i386\n -lpae, --lpae Use the Large Physical Address Extension kernel, only for armhf\n --snapdragon Use the Snapdragon kernel, only for arm64\n -do, --download-only Only download the deb files, do not install them\n -ns, --no-signature Do not check the gpg signature of the checksums file\n -nc, --no-checksum Do not check the sha checksums of the .deb files\n -d, --debug Show debug information, all internal command'<\/span>s echo<\/span> their output\n --rc<\/span> Also include release candidates\n --yes<\/span> Assume yes<\/span> on all questions (<\/span>use with caution!<\/span>)<\/span>\n<\/code><\/pre>\n<\/p>\n2.1.3\u3001\u5b89\u88c5\u6307\u5b9a\u7248\u672c<\/p>\n
<\/p>\n
\n
sudo<\/span> ubuntu-mainline-kernel.sh -i<\/span> \u5185\u6838\u7248\u672c\u53f7\n<\/code><\/pre>\n<\/p>\n\u4f8b\u5982sudoubuntu-mainline-kernel.sh-iv5.15.0\uff1a<\/p>\n
\n
#sudo ubuntu-mainline-kernel.sh -i v5.15.0<\/span>\nDownloading index from kernel.ubuntu.com\nWill download 6<\/span> files from kernel.ubuntu.com:\nDownloading amd64\/linux-headers-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb: 100<\/span>% \nDownloading amd64\/linux-headers-5.15.0-051500_5.15.0-051500.202110312130_all.deb: 100<\/span>% \nDownloading amd64\/linux-image-unsigned-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb: 100<\/span>% \nDownloading amd64\/linux-modules-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb: 100<\/span>% \nDownloading amd64\/CHECKSUMS: 100<\/span>% \nDownloading amd64\/CHECKSUMS.gpg: 100<\/span>% \nSignature of checksum file<\/span> has been successfully verified\nChecksums of deb files have been successfully verified with sha256sum\nInstalling 4<\/span> packages\nCleaning up work folder\n<\/code><\/pre>\n<\/p>\n2.1.4\u3001\u5378\u8f7d\u5185\u6838\u7248\u672c<\/p>\n
\n
sudo<\/span> ubuntu-mainline-kernel.sh -u<\/span>\n<\/code><\/pre>\n<\/p>\n\u793a\u4f8b\uff1a<\/p>\n
\n
Which kernel version do<\/span> you wish to uninstall?\n[<\/span>0<\/span>]<\/span>: v5.11.0-051100\n[<\/span>1<\/span>]<\/span>: v5.15.0-051500\ntype<\/span> the number between [<\/span>]<\/span>: \n<\/code><\/pre>\n<\/p>\n2.1.5\u3001\u68c0\u67e5Linux\u6700\u65b0\u53ef\u7528\u7248\u672c<\/p>\n
\n
ubuntu-mainline-kernel.sh -c<\/span>\n<\/code><\/pre>\n<\/p>\n\u793a\u4f8b\uff1a<\/p>\n
\n
# ubuntu-mainline-kernel.sh -c<\/span>\nFinding latest version available on kernel.ubuntu.com: v5.19.7\nFinding latest installed version: v5.15.0\nA newer kernel version (<\/span>v5.19.7)<\/span> was found but the build was not successful\n<\/code><\/pre>\n<\/p>\n2.2\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5347\u7ea7\uff08APT\uff09<\/p>\n
\u4f7f\u7528\u5305\u7ba1\u7406\u5668APT\uff08AdvancedPackageTool\uff09\u8fdb\u884c\u5185\u6838\u5347\u7ea7\u3002\u8fdb\u884c\u4efb\u4f55\u7cfb\u7edf\u4fee\u6539\u4e4b\u524d\uff0c\u52a1\u5fc5\u5907\u4efd\u91cd\u8981\u6570\u636e\u548c\u914d\u7f6e\u6587\u4ef6linux\u5185\u6838\u7248\u672c<\/strong>\uff0c\u4ee5\u9632\u610f\u5916\u53d1\u751f\u3002\u6b65\u9aa4\uff1a<\/p>\n\uff081\uff09\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\uff0c\u786e\u4fdd\u8f6f\u4ef6\u5305\u5217\u8868\u662f\u6700\u65b0\u7684\uff1a<\/p>\n
\n
sudo<\/span> apt<\/span> update\n<\/code><\/pre>\n<\/p>\n<\/p>\n
\uff082\uff09\u5347\u7ea7\u73b0\u6709\u8f6f\u4ef6\u5305\uff1a<\/p>\n
\n
sudo<\/span> apt<\/span> upgrade\n<\/code><\/pre>\n<\/p>\n\uff083\uff09\u641c\u7d22\u53ef\u7528\u7684\u5185\u6838\u7248\u672c\uff1a<\/p>\n
\n
apt<\/span> search linux-image\n<\/code><\/pre>\n<\/p>\n\uff084\uff09\u5b89\u88c5\u65b0\u5185\u6838\uff1a<\/p>\n
\n
sudo<\/span> apt<\/span> install<\/span> linux-image-<<\/span>version><\/span>\n<\/code><\/pre>\n<\/p>\n\u786e\u4fdd\u5c06\u66ff\u6362\u4e3a\u9009\u62e9\u7684\u5b9e\u9645\u5185\u6838\u7248\u672c\u3002<\/p>\n
\uff085\uff09\u66f4\u65b0\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f\uff1a<\/p>\n
\n
sudo<\/span> update-grub<\/span>\n<\/code><\/pre>\n<\/p>\n\u5185\u6838\u5347\u7ea7\u540e\u987b\u8981\u66f4\u65b0\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f\uff0c\u4fbf\u4e8e\u5728\u542f\u52a8\u65f6\u53ef\u4ee5\u9009\u62e9\u65b0\u7684\u5185\u6838\u7248\u672c\u3002<\/p>\n
\uff086\uff09\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff1a\u5185\u6838\u5347\u7ea7\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff0c\u4ee5\u4f7f\u4fee\u6539\u751f\u6548\u3002<\/p>\n
\uff087\uff09\u9a8c\u8bc1\u65b0\u5185\u6838\uff1a<\/p>\n
\n
uname<\/span> -r<\/span>\n<\/code><\/pre>\n<\/p>\n2.3\u3001\u624b\u52a8\u4e0b\u8f7d\u548c\u5b89\u88c5\u5185\u6838<\/p>\n
\u81ea\u52a8\u4e0b\u8f7d\u548c\u5b89\u88c5\u5185\u6838\u662f\u4e00\u4e2a\u4e2d\u7ea7\u64cd\u4f5c\uff0c\u987b\u8981\u4ece\u5b98\u65b9\u6e90\u6216\u5176\u4ed6\u53ef\u4fe1\u6e90\u81ea\u52a8\u4e0b\u8f7d\u548c\u5b89\u88c5\u5185\u6838\u3002\u901a\u5e38\u6b65\u9aa4\uff1a<\/p>\n
<\/p>\n
\uff081\uff09\u9009\u62e9\u5408\u9002\u7684\u5185\u6838\u7248\u672c\uff0c\u53ef\u4ee5\u8bbf\u95ee\u5b98\u65b9\u64cd\u4f5c\u7cfb\u7edf\u7f51\u7ad9\u6216\u5185\u6838\u5f00\u53d1\u8005\u7f51\u7ad9\uff0c\u4ee5\u83b7\u53d6\u53ef\u7528\u7684\u5185\u6838\u7248\u672c\u4fe1\u606f\u3002<\/p>\n
\uff082\uff09\u4e0b\u8f7d\u5185\u6838\u6e90\u4ee3\u7801\uff1a\u4e00\u65e6\u786e\u5b9a\u4e86\u8981\u5b89\u88c5\u7684\u5185\u6838\u7248\u672c\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u4e4b\u4e00\u83b7\u53d6\u5185\u6838\u6e90\u4ee3\u7801\uff1a<\/p>\n
\u6bd4\u5982\uff1a<\/p>\n
\n
wget<\/span> https:\/\/www.kernel.org\/pub\/linux\/kernel\/v5.x\/linux-5.x.x.tar.gz\n<\/code><\/pre>\n<\/p>\n\uff083\uff09\u89e3\u538b\u6e90\u4ee3\u7801\uff1a\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u89e3\u538b\u6e90\u4ee3\u7801\u538b\u7f29\u5305\uff1a<\/p>\n
\n
tar<\/span> -xzvf<\/span> linux-5.x.x.tar.gz\n<\/code><\/pre>\n<\/p>\n\uff084\uff09\u914d\u7f6e\u5185\u6838\u9009\u9879\u3002\u6b65\u5165\u89e3\u538b\u540e\u7684\u5185\u6838\u6e90\u4ee3\u7801\u76ee\u5f55\uff0c\u5e76\u4f7f\u7528\u73b0\u6709\u7684\u5185\u6838\u914d\u7f6e\u6587\u4ef6\u4f5c\u4e3a\u57fa\u7840\u914d\u7f6e\u3002\u53ef\u4ee5\u590d\u5236\u7cfb\u7edf\u4e2d\/boot\/config-$(uname-r)\u6587\u4ef6\u5230\u5185\u6838\u6e90\u4ee3\u7801\u76ee\u5f55\uff0c\u5e76\u547d\u540d\u4e3a.config\uff1a<\/p>\n
\n
cp<\/span> \/boot\/config-$(<\/span>uname<\/span> -r<\/span>)<\/span><\/span> \/path\/to\/linux-5.x.x\/.config\n#\u7136\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u8fdb\u884c\u914d\u7f6e\uff1a\u5728\u914d\u7f6e\u754c\u9762\u4e2d\u53ef\u4ee5\u6839\u636e\u9700\u8981\u4fee\u6539\u5185\u6838\u9009\u9879;\u4fdd\u5b58\u914d\u7f6e\u540e\u9000\u51fa\u3002<\/span>\nmake<\/span> menuconfig\n<\/code><\/pre>\n<\/p>\n\uff085\uff09\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u7f16\u8bd1\u5185\u6838\uff1a<\/p>\n
\n
make<\/span>\n<\/code><\/pre>\n<\/p>\n\uff086\uff09\u5b89\u88c5\u5185\u6838\u6a21\u5757\uff1a\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5b89\u88c5\u5185\u6838\u53ca\u5176\u6a21\u5757\uff1a<\/p>\n
\n
sudo<\/span> make<\/span> modules_install\nsudo<\/span> make<\/span> install<\/span>\n<\/code><\/pre>\n<\/p>\n\uff087\uff09\u66f4\u65b0\u5f15\u5bfc\u7a0b\u5e8f\uff1a\u66f4\u65b0\u5f15\u5bfc\u7a0b\u5e8f\u4ee5\u5f15\u5bfc\u65b0\u5b89\u88c5\u7684\u5185\u6838\u3002\u5177\u4f53\u64cd\u4f5c\u53d6\u51b3\u4e8e\u4f7f\u7528\u7684\u5f15\u5bfc\u7a0b\u5e8f\uff0c\u6bd4\u5982GRUB\u3002\u66f4\u65b0GRUB\u914d\u7f6e\u540e\uff0c\u91cd\u542f\u7cfb\u7edf\uff1a<\/p>\n
\n
sudo<\/span> update-grub<\/span>\nsudo<\/span> reboot<\/span>\n<\/code><\/pre>\n<\/p>\n\uff088\uff09\u9a8c\u8bc1\u65b0\u5185\u6838\u3002\u7cfb\u7edf\u91cd\u542f\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u65b0\u5185\u6838\u662f\u5426\u751f\u6548\uff1a<\/p>\n
<\/p>\n
\n
uname<\/span> -r<\/span>\n<\/code><\/pre>\n<\/p>\n\u4e09\u3001\u56de\u6eda\u5230\u4ee5\u524d\u7248\u672c<\/p>\n
\uff081\uff09\u542f\u52a8\u65f6\u9009\u62e9\u65e7\u5185\u6838\uff1a\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\uff0c\u4e00\u822c\u4f1a\u663e\u793a\u4e00\u4e2a\u5f15\u5bfc\u83dc\u5355linux\u5e94\u7528\u7a0b\u5e8f\uff0c\u9009\u62e9\u8981\u542f\u52a8\u7684\u5185\u6838\u7248\u672c\u3002\u8fd9\u4e00\u822c\u662f\u5728GRUB\u5f15\u5bfc\u83dc\u5355\u4e2d\u5b8c\u6210\u7684\u3002\u5728\u8fd9\u4e2a\u83dc\u5355\u4e2d\uff0c\u9009\u62e9\u539f\u672c\u7684\u7a33\u5b9a\u5185\u6838\u7248\u672c\uff0c\u800c\u4e0d\u662f\u65b0\u5185\u6838\u3002<\/p>\n
\uff082\uff09\u6b65\u5165\u7cfb\u7edf\uff1a\u9009\u62e9\u65e7\u5185\u6838\u540e\uff0c\u8ba9\u7cfb\u7edf\u7ee7\u7eed\u542f\u52a8\u3002<\/p>\n
\uff083\uff09\u5378\u8f7d\u65b0\u5185\u6838\uff1a\u4e00\u65e6\u6b65\u5165\u7cfb\u7edf\u5e76\u786e\u4fdd\u65e7\u5185\u6838\u624d\u80fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u53ef\u4ee5\u5378\u8f7d\u65b0\u5185\u6838\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7d\u65b0\u5185\u6838\uff1a<\/p>\n
\n
sudo<\/span> apt-get<\/span> purge <<\/span>\u65b0\u5185\u6838\u5305\u540d><\/span>\n<\/code><\/pre>\n<\/p>\n\u5c06\u66ff\u6362\u4e3a\u5b9e\u9645\u5b89\u88c5\u7684\u65b0\u5185\u6838\u7684\u5305\u540d\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770b\u7cfb\u7edf\u4e0a\u5df2\u5b89\u88c5\u7684\u5185\u6838\u5305\u5217\u8868\uff1a<\/p>\n
\n
dpkg --list<\/span> |<\/span> grep<\/span> linux-image\n<\/code><\/pre>\n<\/p>\n\uff084\uff09\u66f4\u65b0\u5f15\u5bfc\u7a0b\u5e8f\uff1a\u5220\u6389\u65b0\u5185\u6838\u540e\uff0c\u66f4\u65b0\u5f15\u5bfc\u7a0b\u5e8f\u4ee5\u53cd\u6620\u8fd9\u79cd\u4fee\u6539\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u66f4\u65b0GRUB\u914d\u7f6e\uff1a<\/p>\n
\n
sudo<\/span> update-grub<\/span>\n<\/code><\/pre>\n<\/p>\n\uff085\uff09\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff1a\u5b8c\u6210\u4ee5\u4e0a\u6b65\u9aa4\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\u4ee5\u786e\u4fdd\u5f15\u5bfc\u7a0b\u5e8f\u5df2\u66f4\u65b0\u800c\u4e14\u7cfb\u7edf\u53ef\u4ee5\u6b63\u5e38\u5f15\u5bfc\u5230\u65e7\u5185\u6838\u3002<\/p>\n
\uff086\uff09\u9a8c\u8bc1\u5185\u6838\u7248\u672c\uff1a\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u7cfb\u7edf\u662f\u5426\u5df2\u56de\u6eda\u5230\u539f\u672c\u7684\u7a33\u5b9a\u5185\u6838\u7248\u672c\uff1a<\/p>\n
\n
uname<\/span> -r<\/span>\n<\/code><\/pre>\n<\/p>\n\u603b\u7ed3<\/p>\n
\u8fd9\u7bc7\u6587\u7ae0\u662f\u9488\u5bf9\u60f3\u8981\u5347\u7ea7\u5176UbuntuLinux\u5185\u6838\u7248\u672c\u7684\u7528\u6237\u7684\u5b9e\u7528\u624b\u518c\u3002\u6587\u7ae0\u7684\u4e3b\u8981\u76ee\u6807\u662f\u5e2e\u52a9\u7406\u89e3\u5347\u7ea7\u8fc7\u7a0b\u5e76\u786e\u4fdd\u5176\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u548c\u5b89\u5168\u6027\u3002<\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5347\u7ea7Linux\u5185\u6838\u7248\u672c\u5185\u6838\u5347\u7ea7\u540e\u9700\u8981\u66f4\u65b0\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u5728\u542f\u52a8\u65f6\u53ef\u4ee5\u9009\u62e9\u65b0\u7684\u5185\u6838\u7248\u672c\u3002\u624b\u52a8\u4e0b\u8f7d\u548c\u5b89\u88c5\u5185\u6838\u662f\u4e00\u4e2a\u9ad8\u7ea7\u64cd\u4f5c\uff0c\u9700\u8981\u4ece\u5b98\u65b9\u6e90\u6216\u5176\u4ed6\u53ef\u4fe1\u6e90\u624b\u52a8\u4e0b\u8f7d\u548c\u5b89\u88c5\u5185\u6838\u3002\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\uff0c\u901a\u5e38\u4f1a\u663e\u793a\u4e00\u4e2a\u5f15\u5bfc\u83dc\u5355\uff0c\u9009\u62e9\u8981\u542f\u52a8\u7684\u5185\u6838\u7248\u672c\u3002Linux\u5185\u6838\u7248\u672c\u7684\u7528\u6237\u7684\u5b9e\u7528\u6307\u5357\u3002<\/p>\n","protected":false},"author":1,"featured_media":293611,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[3568,3571,3570,3569],"class_list":["post-293610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-3568","tag-5792df298fc480a00","tag-c4de6cb359778b34474c7c850dd3fb74","tag-f9f033463bf9a903af46e3fffb104a99"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=293610"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293610\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/293611"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=293610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=293610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=293610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}