无法在 Ubuntu 21.10 上运行“apt update”

无法在 Ubuntu 21.10 上运行“apt update”

运行时出现以下错误apt update,导致我无法更新 Ubuntu 服务器。

~$ sudo apt update
Ign:1 http://security.ubuntu.com/ubuntu impish-security InRelease
Err:2 http://security.ubuntu.com/ubuntu impish-security Release
  404  Not Found [IP: 91.189.91.39 80]
Hit:3 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu impish InRelease
Ign:4 http://nova.clouds.archive.ubuntu.com/ubuntu impish InRelease
Ign:5 http://nova.clouds.archive.ubuntu.com/ubuntu impish-updates InRelease
Ign:6 http://nova.clouds.archive.ubuntu.com/ubuntu impish-backports InRelease
Err:7 http://nova.clouds.archive.ubuntu.com/ubuntu impish Release
  404  Not Found [IP: 185.125.190.41 80]
Err:8 http://nova.clouds.archive.ubuntu.com/ubuntu impish-updates Release
  404  Not Found [IP: 185.125.190.41 80]
Err:9 http://nova.clouds.archive.ubuntu.com/ubuntu impish-backports Release
  404  Not Found [IP: 185.125.190.41 80]
Get:12 https://download.docker.com/linux/ubuntu impish InRelease [48.9 kB]
Get:10 https://packagecloud.io/netdata/netdata-edge/ubuntu impish InRelease [24.8 kB]
Hit:11 https://packagecloud.io/netdata/netdata-repoconfig/ubuntu impish InRelease
Get:13 https://packagecloud.io/netdata/netdata-edge/ubuntu impish/main amd64 Packages [13.3 kB]
Reading package lists... Done
E: The repository 'http://security.ubuntu.com/ubuntu impish-security Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://nova.clouds.archive.ubuntu.com/ubuntu impish Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://nova.clouds.archive.ubuntu.com/ubuntu impish-updates Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://nova.clouds.archive.ubuntu.com/ubuntu impish-backports Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

正如您所看到的,ping 解析了主机名:

~$ ping security.ubuntu.com
PING security.ubuntu.com (185.125.190.39) 56(84) bytes of data.
64 bytes from aerodent.canonical.com (185.125.190.39): icmp_seq=1 ttl=51 time=75.4 ms
64 bytes from aerodent.canonical.com (185.125.190.39): icmp_seq=2 ttl=51 time=73.9 ms
64 bytes from aerodent.canonical.com (185.125.190.39): icmp_seq=3 ttl=51 time=73.9 ms
64 bytes from aerodent.canonical.com (185.125.190.39): icmp_seq=4 ttl=51 time=74.5 ms
64 bytes from aerodent.canonical.com (185.125.190.39): icmp_seq=5 ttl=51 time=74.4 ms

需要说明的是,我在 Ubuntu 服务器上启用了自动更新,最近(过去一两周)发生了这种情况。请帮忙!

答案1

Impish 于 7 月 14 日停止服务。因此,其存储库不再可在镜像中找到,因此如果您想继续使用此版本,则需要使用old-releases.ubuntu.com作为您的镜像。

但请注意,Impish 将不再提供升级,因此您可能需要切换到受支持的版本。最简单的升级方法是运行以下命令:do-release-upgrade

答案2

我尝试了这个(在 RPI3,Ubuntu 21.10 上),修改 /etc/apt/sources.list

deb http://ports.ubuntu.com/ubuntu-ports impish main restricted

deb http://old-releases.ubuntu.com/ubuntu impish-security main restricted

对所有条目执行相同操作(先复制一份)

然后

sudo apt update
sudo apt upgrade

就我而言,升级成功。

然后我尝试

sudo do-release-upgrade 

但失败了:

Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

You have not rebooted after updating a package which requires a reboot. Please reboot before upgrading.

因此稍后重新启动

sudo do-release-upgrade 

= 欢迎使用 Ubuntu 22.04‘Jammy Jellyfish’ =

Ubuntu 团队自豪地宣布推出 Ubuntu 22.04“Jammy Jellyfish”。

要查看此版本中的新增功能,请访问: https://wiki.ubuntu.com/JammyJellyfish/ReleaseNotes


And I continued with the dist upgrade

Hope this helps

Andrew



答案3

我想澄清一下 Andrew Holt 写的内容 -

ubuntu 21(称为 impish)已经结束其生命周期,因此其存储库已关闭。您可以通过替换所有

ports.ubuntu.com/ubuntu-ports

old-releases.ubuntu.com/ubuntu

在文件中

/etc/apt/sources.list

然后,无需重启或什么的,只需运行

sudo apt update
sudo apt upgrade

请注意,这些步骤不会升级版本...

答案4

运行以下命令允许我将 Ubuntu 版本升级到更新和支持的版本: do-release-upgrade

apt update命令现在按预期工作!

相关内容