我有一个运行 Ubuntu Server 16.04 的 Digital Ocean droplet。我尝试运行 a do-release-upgrade
(在强制apt update
and之后apt upgrade
),但它很快就停止了:
Reading cache
Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease
Hit http://mirrors.digitalocean.com/ubuntu xenial InRelease
Get:1 https://esm.ubuntu.com/infra/ubuntu xenial-infra-security InRelease [7476 B]
Get:2 https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates InRelease [7475 B]
Get:3 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://mirrors.digitalocean.com/ubuntu xenial-security InRelease [109 kB]
Get:6 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages [2048 kB]
Get:7 http://mirrors.digitalocean.com/ubuntu xenial-updates/main i386 Packages [1524 kB]
Get:8 http://mirrors.digitalocean.com/ubuntu xenial-updates/universe amd64 Packages [1220 kB]
Get:9 http://mirrors.digitalocean.com/ubuntu xenial-updates/universe i386 Packages [1086 kB]
Fetched 6218 kB in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
No snaps are installed yet. Try 'snap install hello-world'.
Checking for installed snaps
Calculating snap size requirements
Updating repository information
Third party sources disabled
Some third party entries in your sources.list were disabled. You can
re-enable them after the upgrade with the 'software-properties' tool
or your package manager.
To continue please press [ENTER]
Get:1 https://esm.ubuntu.com/infra/ubuntu bionic-infra-security InRelease [7458 B]
Get:2 https://esm.ubuntu.com/infra/ubuntu bionic-infra-updates InRelease [7457 B]
Fetched 14.9 kB in 0s (0 B/s)
Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Invalid package information
After updating your package information, the essential package
'ubuntu-minimal' could not be located. This may be because you have
no official mirrors listed in your software sources, or because of
excessive load on the mirror you are using. See /etc/apt/sources.list
for the current list of configured software sources.
In the case of an overloaded mirror, you may want to try the upgrade
again later.
这是因为软件源不再正确吗 (如果是这样,那么正确的软件源是什么)?官方 DO 的口号是在另一个 droplet 上安装新版本,然后切换 droplet,但我想避免这种情况。
编辑:DO 上的标准/etc/apt/source.lst
仅指向 DO 的镜像。查看它(在do-release-upgrade
因故障而恢复它之前),似乎所有条目都被注释掉了(被视为第三方来源?)。那么我在哪里可以找到指向 Canonical 存储库的 sources.lst?
无需 18.04 步骤即可移动到 20.04 的方法可获得加分...
附言:do-release-upgrade
在我的另一个 droplet 上运行 18.04 版本,运行完美。
答案1
看起来你正在使用 Digital Ocean。制作快照,然后你可以尝试用存档版本替换 source.list,如下所示
sudo sed -i 's/mirrors.digitalocean.com/us.archive.ubuntu.com/' /etc/apt/sources.list
然后尝试do-release-upgrade
再次运行。
如果遇到问题,我还必须先运行这个do-release-upgrade
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade
完成后,恢复文件。
sudo sed -i 's/us.archive.ubuntu.com/mirrors.digitalocean.com/' /etc/apt/sources.list
答案2
添加这些来源对我有用: https://wiki.ubuntuusers.de/sources.list/#Eoan
按照这个答案: https://askubuntu.com/a/1242258
它很容易就起作用了。