尝试过更新很多源,比如aliyun的源,清华的源都不行,都会报404如:
- root@149e8cb9cd56:/usr/local/var/bin# apt-get update
- Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
- Ign:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease
- Ign:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease
- Err:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal Release
- Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
- Err:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates Release
- Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
- Err:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports Release
- Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
- Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
- Ign:8 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
- Ign:9 http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages
- Ign:10 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
- Ign:11 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
- Ign:8 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
- Ign:9 http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages
- Ign:10 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
- Ign:11 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
- Ign:8 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
- Ign:9 http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages
- Ign:10 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
- Ign:11 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
- Ign:8 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
- Ign:9 http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages
- Ign:10 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
- Ign:11 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
- Ign:8 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
- Ign:9 http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages
- Ign:10 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
- Ign:11 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
- Err:8 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
- 404 Not Found [IP: 91.189.91.83 80]
- Ign:9 http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages
解决方案
运行下面命令
mv /etc/apt/sources.list /etc/apt/sources.list.back
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy main restricted > /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy multiverse universe >> /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy-updates main restricted >> /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy-updates multiverse universe >> /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy-backports main restricted >> /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy-backports multiverse universe >> /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy-security main restricted >> /etc/apt/sources.list
echo deb http://old-releases.ubuntu.com/ubuntu/ groovy-security multiverse universe >> /etc/apt/sources.list
再执行
apt-get update
apt-get upgrade
就可以了