设置正确的 ubuntu 版本

设置正确的 ubuntu 版本

总结

尽管我仍在使用 xenial,但系统认为应该下载 bionic 的软件包。我无法从 xenial 升级到 bionic,因为我应该先升级所有可用的软件包。当我尝试这样做时,它会下载 bionic 软件包然后中止,因为操作系统版本与新软件包版本不匹配。我怎样才能告诉我的系统它仍然是 xenial 而不是 bionic?


我开始运行 ubuntu 升级程序,如上所述本网站。 所以:

sudo apt update 
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo apt autoclean

然后开始运行升级程序(确认我已经安装了update-manager-core

sudo do-release-upgrade

一切都按预期进行。到目前为止还不错。它问我是否要按“y”或“N”继续,还是按“d”查看详细信息。为了好玩,我按了“d”和“enter”。我在终端中查看详细信息。好的,这一切都很有趣。无论如何。到达终点后,它向我显示

(END)

我应该在这里停下来,打开这个网站,而不是做一些愚蠢的事情。我按下“enter”,什么也没发生,“escape”什么也没发生,“backspace”什么也没发生。然后我选择按下“Ctrl+C”,升级程序中止,我回到之前的终端内容,但没有提示。我尝试“y”继续升级发行版,但失败了。好吧,关闭终端,重新打开它,再试sudo do-release-upgrade一次。出了点问题,但我不记得当时是什么问题了。无论如何,我重新启动了整个系统,打开了终端,现在我们在这里:

thymaro@ultra:~$ sudo do-release-upgrade
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

thymaro@ultra:~$ sudo apt-get update
Hit:1 http://it-mirrors.evowise.com/ubuntu bionic InRelease
Hit:2 http://it-mirrors.evowise.com/ubuntu bionic-updates InRelease     
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease              
Hit:4 http://it-mirrors.evowise.com/ubuntu bionic-backports InRelease   
Hit:5 http://it-mirrors.evowise.com/ubuntu bionic-security InRelease
Reading package lists... Done

thymaro@ultra:~$ sudo apt-get -y dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  account-plugin-facebook account-plugin-flickr account-plugin-google
  .... {list of hundreds more packages}
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  checkbox-converged checkbox-gui curl gir1.2-totem-plparser-1.0 
  .... {list of dozens more packages}
The following NEW packages will be installed:
  apache2-bin autopoint binutils-common binutils-x86-64-linux-gnu bolt 
  .... {list of hundreds more packages}
The following packages will be upgraded:
  a11y-profile-manager-indicator accountsservice acl acpid 
  .... {list of hundreds more packages}
2355 to upgrade, 615 to newly install, 77 to remove and 0 not to upgrade.
Need to get 1'505 MB/2'207 MB of archives.
After this operation, 2'269 MB of additional disk space will be used.
Get:1 http://it-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libglvnd0 amd64 1.0.0-2ubuntu2.3 [47.0 kB]
Get:2 http://it-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libwayland-egl1-mesa amd64 19.2.8-0ubuntu0~18.04.3 [6'892 B]
Get:3 http://it-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libwayland-egl1 amd64 1.16.0-1ubuntu1.1~18.04.3 [5'464 B]
Get:4 http://it-mirrors.evowise.com/ubuntu bionic-updates/main amd64 libqt5dbus5 amd64 5.9.5+dfsg-0ubuntu2.5 [195 kB]
... {about a thousand more lines downloading 'bionic' packages}

问题位于 tl;dr 下的帖子开头。

答案1

do-release-upgrade命令会改变您的来源。

要更改您的来源:

  • 编辑 /etc/apt/sources.list(需要 sudo)。

    sudoedit /etc/apt/sources.list          // CLI 
    //OR//
    sudo -H gedit /etc/apt/sources.list     // GUI
    
  • 仔细检查每一行:将写有“bionic”的每一行改回“xenial”。

  • 完成并保存后,运行 sudo apt update。

相关内容