使用下方代码,编辑源更新列表文件。

vim /etc/apt/sources.list

保持该文件里有如下文字即可,注意标红文字处,根据系统版本不同需要修改为对应的版本字。

18.04 bionic、16.04 xenial、14.04 trusty、20.04 Focal

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

如果不是以上版本

请将文件内的文字改为如下,标红的版本字需要查询对应的版本文字。

deb http://old-releases.ubuntu.com/releases/ bionic main restricted universe multiverse
deb http://old-releases.ubuntu.com/releases/ bionic-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/releases/ bionic-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/releases/ bionic-backports main restricted universe multiverse