美文网首页
Ubuntu 16.04升级内核到20.04(无损)

Ubuntu 16.04升级内核到20.04(无损)

作者: Angeladaddy | 来源:发表于2022-05-04 11:25 被阅读0次

    google了很多文章以后,总结了一个有用的,测试成功:

    1. 首先需要从16.04 → 18.04
    sudo mv /etc/apt/sources.list ~/
    sudo mv /etc/apt/sources.list.d/*.list ~/
    # 改变源(粘贴下面这一段到终端并运行)
    cat <<EOF | sudo tee /etc/apt/sources.list
    deb http://archive.ubuntu.com/ubuntu/ xenial-backports main universe multiverse restricted
    deb http://archive.ubuntu.com/ubuntu/ xenial main universe multiverse restricted
    deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse restricted
    deb http://security.ubuntu.com/ubuntu/ xenial-security main universe multiverse restricted
    EOF
    # 依次执行以下语句
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ xenial-backports main universe multiverse restricted"
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ xenial main universe multiverse restricted"
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse restricted"
    sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu/ xenial-security main universe multiverse restricted"
    
    # 执行升级
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get purge ubuntu-advantage-tools --autoremove
    sudo rm /etc/apt/sources.list.d/ubuntu-esm-infra.list
    sudo do-release-upgrade
    
    • 升级过程比较漫长,大约半个小时,完毕后提示是否要重启,重启就行
    • 过程中弹出的窗口,统统回车就行(一般是问你保留旧设置还是覆盖,回车默认保留)
    1. 18.04 → 20.04
      基本一样的步骤,但是必须要先升级到18.04:
    sudo mv /etc/apt/sources.list ~/
    sudo mv /etc/apt/sources.list.d/*.list ~/
    # 改变源(粘贴下面这一段到终端并运行)
    cat <<EOF | sudo tee /etc/apt/sources.list
    deb http://archive.ubuntu.com/ubuntu/ bionic-backports main universe multiverse restricted
    deb http://archive.ubuntu.com/ubuntu/ bionic main universe multiverse restricted
    deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe multiverse restricted
    deb http://security.ubuntu.com/ubuntu/ bionic-security main universe multiverse restricted
    EOF
    # 依次执行以下语句
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic-backports main universe multiverse restricted"
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic main universe multiverse restricted"
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe multiverse restricted"
    sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu/ bionic-security main universe multiverse restricted"
    
    # 执行升级
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get purge ubuntu-advantage-tools --autoremove
    sudo rm /etc/apt/sources.list.d/ubuntu-esm-infra.list
    sudo do-release-upgrade
    

    相关文章

      网友评论

          本文标题:Ubuntu 16.04升级内核到20.04(无损)

          本文链接:https://www.haomeiwen.com/subject/khmwyrtx.html