修复centos7无法下载docker问题
- 1、安装docker时报错
- 2、docker无法下载镜像
1、安装docker时报错
linux的centos系统,安装docker时会报错
–> Finished Dependency Resolution
Error: Package: glibc-2.17-307.el7.1.i686 (base)
Requires: glibc-common = 2.17-307.el7.1
Installed: glibc-common-2.17-317.el7.x86_64 (@anaconda)
glibc-common = 2.17-317.el7
Available: glibc-common-2.17-307.el7.1.x86_64 (base)
glibc-common = 2.17-307.el7.1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
####因为我们的centos7已经停止维护。官方支持和更新于2024年6月30日结束
Centos-7.repo需要重新维护
进入/etc/yum.repos.d目录。然后对
CentOS-Base.repo文件进行备份(如果错了好还原)
然后执行以下命令:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo
yum repolist
再次执行
sudo yum install -y yum-utils
就不会报安装错误了
2、docker无法下载镜像
出现这个错:
Error response from daemon: Get “https://registry-1.docker.io/v2/”: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
进入这个目录
/etc/docker/daemon.json
如果docker下没有daemon.json文件。需要自己新建一个这个文件
内容填写
{
"registry-mirrors": ["https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://mirror.aliyuncs.com",
"https://dockerproxy.com",
"https://mirror.baidubce.com",
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.rainbond.cc"]
}
systemctl daemon-reload
systemctl restart docker
执行下面操作:
解决办法:pull 带上临时源地址
docker pull docker.unsee.tech/mysql:5.7