阿里云配置docker報(bào)錯(cuò)No more mirrors to try.
Error downloading packages: docker-compose-plugin-2.21.0-1.el7.x86_64: [Errno 256] No more mirrors to try. docker-ce-rootless-extras-24.0.6-1.el7.x86_64: [Errno 256] No more mirrors to try. 1:docker-ce-cli-24.0.6-1.el7.x86_64: [Errno 256] No more mirrors to try.
1.已配設(shè)置(個(gè)人項(xiàng)目所需,切勿輕易關(guān)閉?。?!這些配置并不與問題沖突)
防火墻已經(jīng)關(guān)閉
#l臨時(shí)關(guān)閉
service firewalld stop
#永久關(guān)閉
systemctl disable firewalld
selinux已關(guān)閉
#臨時(shí)關(guān)閉
getenforce 0
#永久關(guān)閉
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
2.配置阿里云及相關(guān)插件
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y yum-utils device-mapper-persistent-data lvm2 wget net-tools nfs-utils lrzsz gcc gcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntp libaio-devel wget vim ncurses-devel autoconf automake zlib-devel python-devel epel-release openssh-server socat ipvsadm conntrack ntpdate telnet ipvsadm
3.錯(cuò)誤發(fā)現(xiàn)
不論是下載指定版本的docker還是最新版本的docker都報(bào)錯(cuò)
下載指定版本
yum install docker-ce-20.10.6 -y
下載最新版本
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
報(bào)錯(cuò)代碼(鏡像下找不到包)
Error downloading packages: docker-compose-plugin-2.21.0-1.el7.x86_64: [Errno 256] No more mirrors to try. docker-ce-rootless-extras-24.0.6-1.el7.x86_64: [Errno 256] No more mirrors to try. 1:docker-ce-cli-24.0.6-1.el7.x86_64: [Errno 256] No more mirrors to try.
4.嘗試方法(作者本人通過方法四解決問題)
1.阿里云官方步驟
#Step 1: 安裝必要的一些系統(tǒng)工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
#Step 2: 添加軟件源信息
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#Step 3
sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
#Step 4: 更新并安裝Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
注意:當(dāng)指定docker版本時(shí),需要修改配置文件
vim /etc/yum.repos.d/docker-ce.repo
#將[docker-ce-test]下方的enabled=0修改為enabled=1
2.手動(dòng)安裝(版本docker-ce-20.10.9-3.el7.x86_64,其他版本點(diǎn)擊查詢):linux直接下載官方的rpm包再安裝
wget http://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/test/Packages/docker-ce-20.10.9-3.el7.x86_64.rpm?spm=a2c6h.25603864.0.0.8cfc4ffciMrhv4
yum install docker-ce-20.10.9-3.el7.x86_64.rpm
3.手動(dòng)安裝(版本docker-ce-20.10.9-3.el7.x86_64):windows下載再通過xftp傳輸給linux機(jī)器
直接點(diǎn)擊鏈接下載http://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/test/Packages/docker-ce-20.10.9-3.el7.x86_64.rpm?spm=a2c6h.25603864.0.0.8cfc4ffciMrhv4打開Xshell,點(diǎn)擊Xftp進(jìn)行傳輸,然后
yum install docker-ce-20.10.9-3.el7.x86_64.rpm
4.直接換源,換成docker的官方鏡像源再下載
#以防萬一,備份一下
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#更新一下yum
yum update
#配置docker官方鏡像源
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#再次執(zhí)行
yum install docker-ce-20.10.6 -y
5.其他注意事項(xiàng)
如若發(fā)現(xiàn)bash: yum-config-manager: 未找到命令
則是備份的時(shí)候出了問題,重新備份一下即可(確認(rèn)覆蓋)文章來源:http://www.zghlxwxcb.cn/news/detail-799210.html
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
yum install -y yum-utils
yum update
下載docker的時(shí)候切記要留意k8s的版本,k8s官方文檔中指出Kubernetes 在 v1.20 版本之后將不再使用 Docker 作為容器。
阿里云docker鏡像下載鏈接文章來源地址http://www.zghlxwxcb.cn/news/detail-799210.html
到了這里,關(guān)于阿里云配置docker報(bào)錯(cuò)[Errno 256]No more mirrors to try.以及bash: yum-config-manager: 未找到命令的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!