运行 sudo apt update 和 upgrade 时出现问题

运行 sudo apt update 和 upgrade 时出现问题

这是输出:

Ign:2 ://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:1 ://archive.ubuntu.com/ubuntu jammy InRelease
Err:2 ://security.ubuntu.com/ubuntu jammy-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Ign:3 ://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 ://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 ://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 ://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 ://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:1 ://archive.ubuntu.com/ubuntu jammy InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 ://archive.ubuntu.com/ubuntu jammy-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

答案1

您可以通过以下方式清理并刷新 apt 缓存:

apt-get 清理

rm -rf /var/lib/apt/lists/*

apt-get 更新

相关内容