给Ubuntu16.04升级内核到5.7

date
Feb 1, 2022
slug
ubuntu-1604-upgrade-kernel
status
Published
summary
也可以是任何合适的版本
tags
linux
type
Post
URL

Problem & Summary

    Soltion

    确认现有版本

    uname -a
    notion image

    https://kernel.ubuntu.com/~kernel-ppa/mainline/ 确定新的版本

    • 比如 v.5.7/
    notion image

    ubuntu 16.04会碰上依赖libssl1.1.0问题

    wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
    sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
    notion image

    下载并安装所有相关的deb (headers_all, headers, image, moduels共4个.deb)

    wget https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-headers-5.7.0-050700_5.7.0-050700.202006082127_all.deb \
         https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-headers-5.7.0-050700-generic_5.7.0-050700.202006082127_amd64.deb \
         https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-image-unsigned-5.7.0-050700-generic_5.7.0-050700.202006082127_amd64.deb \
         https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-modules-5.7.0-050700-generic_5.7.0-050700.202006082127_amd64.deb
    
    ll linux*.deb
    dpkg -i linux*.deb
    notion image
    notion image

    !重启后,uname -a 确认新版本

    notion image

    清理旧内核

    apt -y clean && apt -y autoclean && apt -y autoremove
    
    # 如果清理不掉,就手动
    # 先把系统里面的内核 != 当前正在使用内核的找出来 (grep -v的相关)
    dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
    
    notion image
     

    © Ying Bun 2021 - 2024