问题描述
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/x/x264/libx264-155_0.155.2917+git0a84d98-2_amd64.deb Connection failed [IP: 91.189.91.39 80] E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/x/x265/libx265-179_3.2.1-1build1_amd64.deb Connection failed [IP: 91.189.91.39 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? sudo apt-get update --fix-missing Err:1 http://cn.archive.ubuntu.com/ubuntu focal InRelease Connection failed [IP: 91.189.91.39 80] Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease Connection failed [IP: 91.189.91.38 80] Hit:3 http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu focal InRelease Err:4 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease Connection failed [IP: 91.189.91.38 80] Err:5 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease Connection failed [IP: 91.189.91.39 80] Reading package lists... Done W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/focal/InRelease Connection failed [IP: 91.189.91.39 80] W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Connection failed [IP: 91.189.91.38 80] W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Connection failed [IP: 91.189.91.39 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Connection failed [IP: 91.189.91.38 80] W: Some index files failed to download. They have been ignored, or old ones used instead.
问题解决
1,修改 DNS 地址
# 修改DNS地址 sudo echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null # 可换的DNS有: # 114公共DNS: 114.114.114.114和114.114.115.115 # 阿里的DNS: 223.5.5.5和223.6.6.6、 # 腾讯的DNS: 119.29.29.29和182.254.116.116 # 百度的DNS: 180.76.76.76 # Google的DNS: 8.8.8.8和8.8.4.4 # 测试是否修改成功: cat /etc/resolv.conf # 重新更新 sudo apt-get update --fix-missing
2,添加镜像
# 保险起见可以备份一下这个需要更改的文件 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak sudo vim /etc/apt/sources.list deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable