1、錯誤信息:
[root@localhost atguigu]# yum install docker
已加載插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的錯誤"One of the configured repositories failed (未知),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: base/7/x86_64
2、處理辦法:
1. 解決 DNS 解析問題
無法解析?mirrorlist.centos.org
?可能是 DNS 配置有誤或者網絡連接存在問題。你可以按照下面的步驟來解決:
檢查網絡連接
使用?ping
?命令測試網絡連通性:
bash
ping www.baidu.com
如果無法?ping
?通,需要檢查網絡配置、防火墻設置或者聯系網絡管理員。
檢查 DNS 配置
查看?/etc/resolv.conf
?文件,確認其中的 DNS 服務器配置是否正確。你可以使用以下命令查看文件內容:
bash
cat /etc/resolv.conf
若 DNS 配置有誤,可以使用公共的 DNS 服務器,例如 Google 的?8.8.8.8
?和?8.8.4.4
,或者阿里云的?223.5.5.5
?和?223.6.6.6
。編輯?/etc/resolv.conf
?文件,添加或者修改 DNS 服務器配置:
bash
nameserver 8.8.8.8
nameserver 8.8.4.4
或者
bash
nameserver 223.5.5.5
nameserver 223.6.6.6
2. 解決?base
?倉庫?baseurl
?問題
可以通過替換為國內鏡像源來解決這個問題,下面以阿里云鏡像源為例:
備份原有的?CentOS-Base.repo
?文件
bash
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下載阿里云的?CentOS-Base.repo
?文件
bash
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清除 yum 緩存并重新生成
bash
yum clean all
yum makecache
3. 解決倉庫重復配置問題
錯誤信息中提到?Repository base is listed more than once in the configuration
,這表明?base
?倉庫在配置文件中被重復列出了。你可以檢查?/etc/yum.repos.d
?目錄下的所有?.repo
?文件,確保?base
?倉庫只被配置了一次。
4. 再次嘗試安裝 Docker
完成上述操作之后,再次嘗試安裝 Docker:
bash
yum install docker
3、安裝成功信息:
?
[root@localhost atguigu]# yum install docker
已加載插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
正在解決依賴關系
--> 正在檢查事務
---> 軟件包 docker.x86_64.2.1.13.1-210.git7d71120.el7.centos 將被 安裝
--> 正在處理依賴關系 docker-common = 2:1.13.1-210.git7d71120.el7.centos,它被軟件包 2:docker-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 docker-client = 2:1.13.1-210.git7d71120.el7.centos,它被軟件包 2:docker-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 subscription-manager-rhsm-certificates,它被軟件包 2:docker-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在檢查事務
---> 軟件包 docker-client.x86_64.2.1.13.1-210.git7d71120.el7.centos 將被 安裝
---> 軟件包 docker-common.x86_64.2.1.13.1-210.git7d71120.el7.centos 將被 安裝
--> 正在處理依賴關系 skopeo-containers >= 1:0.1.26-2,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 oci-umount >= 2:2.3.3-3,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 oci-systemd-hook >= 1:0.1.4-9,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 oci-register-machine >= 1:0-5.13,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 container-storage-setup >= 0.9.0-1,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 container-selinux >= 2:2.51-1,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
--> 正在處理依賴關系 atomic-registries,它被軟件包 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 需要
---> 軟件包 subscription-manager-rhsm-certificates.x86_64.0.1.24.54-1.el7.centos 將被 安裝
--> 正在檢查事務
---> 軟件包 atomic-registries.x86_64.1.1.22.1-33.gitb507039.el7_8 將被 安裝
--> 正在處理依賴關系 python-pytoml,它被軟件包 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 需要
---> 軟件包 container-selinux.noarch.2.2.119.2-1.911c772.el7_8 將被 安裝
---> 軟件包 container-storage-setup.noarch.0.0.11.0-2.git5eaf76c.el7 將被 安裝
---> 軟件包 containers-common.x86_64.1.0.1.40-11.el7_8 將被 安裝
--> 正在處理依賴關系 subscription-manager,它被軟件包 1:containers-common-0.1.40-11.el7_8.x86_64 需要
--> 正在處理依賴關系 slirp4netns,它被軟件包 1:containers-common-0.1.40-11.el7_8.x86_64 需要
--> 正在處理依賴關系 fuse-overlayfs,它被軟件包 1:containers-common-0.1.40-11.el7_8.x86_64 需要
---> 軟件包 oci-register-machine.x86_64.1.0-6.git2b44233.el7 將被 安裝
---> 軟件包 oci-systemd-hook.x86_64.1.0.2.0-1.git05e6923.el7_6 將被 安裝
---> 軟件包 oci-umount.x86_64.2.2.5-3.el7 將被 安裝
--> 正在檢查事務
---> 軟件包 fuse-overlayfs.x86_64.0.0.7.2-6.el7_8 將被 安裝
--> 正在處理依賴關系 libfuse3.so.3(FUSE_3.2)(64bit),它被軟件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在處理依賴關系 libfuse3.so.3(FUSE_3.0)(64bit),它被軟件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在處理依賴關系 libfuse3.so.3()(64bit),它被軟件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
---> 軟件包 python-pytoml.noarch.0.0.1.14-1.git7dea353.el7 將被 安裝
---> 軟件包 slirp4netns.x86_64.0.0.4.3-4.el7_8 將被 安裝
---> 軟件包 subscription-manager.x86_64.0.1.24.54-1.el7.centos 將被 安裝
--> 正在處理依賴關系 subscription-manager-rhsm = 1.24.54,它被軟件包 subscription-manager-1.24.54-1.el7.centos.x86_64 需要
--> 正在處理依賴關系 python-dmidecode >= 3.12.2-2,它被軟件包 subscription-manager-1.24.54-1.el7.centos.x86_64 需要
--> 正在處理依賴關系 python-syspurpose,它被軟件包 subscription-manager-1.24.54-1.el7.centos.x86_64 需要
--> 正在檢查事務
---> 軟件包 fuse3-libs.x86_64.0.3.6.1-4.el7 將被 安裝
---> 軟件包 python-dmidecode.x86_64.0.3.12.2-4.el7 將被 安裝
---> 軟件包 python-syspurpose.x86_64.0.1.24.54-1.el7.centos 將被 安裝
---> 軟件包 subscription-manager-rhsm.x86_64.0.1.24.54-1.el7.centos 將被 安裝
--> 解決依賴關系完成依賴關系解決=======================================================================================Package 架構 版本 源 大小
=======================================================================================
正在安裝:docker x86_64 2:1.13.1-210.git7d71120.el7.centos extras 17 M
為依賴而安裝:atomic-registries x86_64 1:1.22.1-33.gitb507039.el7_8 extras 36 kcontainer-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 kcontainer-storage-setup noarch 0.11.0-2.git5eaf76c.el7 extras 35 kcontainers-common x86_64 1:0.1.40-11.el7_8 extras 43 kdocker-client x86_64 2:1.13.1-210.git7d71120.el7.centos extras 3.9 Mdocker-common x86_64 2:1.13.1-210.git7d71120.el7.centos extras 101 kfuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 kfuse3-libs x86_64 3.6.1-4.el7 extras 82 koci-register-machine x86_64 1:0-6.git2b44233.el7 extras 1.1 Moci-systemd-hook x86_64 1:0.2.0-1.git05e6923.el7_6 extras 34 koci-umount x86_64 2:2.5-3.el7 extras 33 kpython-dmidecode x86_64 3.12.2-4.el7 base 83 kpython-pytoml noarch 0.1.14-1.git7dea353.el7 extras 18 kpython-syspurpose x86_64 1.24.54-1.el7.centos updates 277 kslirp4netns x86_64 0.4.3-4.el7_8 extras 81 ksubscription-manager x86_64 1.24.54-1.el7.centos updates 1.1 Msubscription-manager-rhsm x86_64 1.24.54-1.el7.centos updates 336 ksubscription-manager-rhsm-certificatesx86_64 1.24.54-1.el7.centos updates 240 k事務概要
=======================================================================================
安裝 1 軟件包 (+18 依賴軟件包)總下載量:25 M
安裝大小:86 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/extras/packages/atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64.rpm: 頭V3 RSA/SHA256 Signature, 密鑰 ID f4a80eb5: NOKEY
atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64.rpm 的公鑰尚未安裝
(1/19): atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64.rpm | 36 kB 00:00:00
(2/19): container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch. | 35 kB 00:00:00
(3/19): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00
(4/19): containers-common-0.1.40-11.el7_8.x86_64.rpm | 43 kB 00:00:00
(5/19): docker-1.13.1-210.git7d71120.el7.centos.x86_64.rpm | 17 MB 00:00:00
(6/19): docker-common-1.13.1-210.git7d71120.el7.centos.x86_64.r | 101 kB 00:00:00
(7/19): docker-client-1.13.1-210.git7d71120.el7.centos.x86_64.r | 3.9 MB 00:00:00
(8/19): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:00
(9/19): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:00
(10/19): oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64.rpm | 34 kB 00:00:00
(11/19): oci-umount-2.5-3.el7.x86_64.rpm | 33 kB 00:00:00
(12/19): python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm | 18 kB 00:00:00
python-dmidecode-3.12.2-4.el7.x86_64.rpm 的公鑰尚未安裝
(13/19): python-dmidecode-3.12.2-4.el7.x86_64.rpm | 83 kB 00:00:00
(14/19): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:00
python-syspurpose-1.24.54-1.el7.centos.x86_64.rpm 的公鑰尚未安裝
(15/19): python-syspurpose-1.24.54-1.el7.centos.x86_64.rpm | 277 kB 00:00:00
(16/19): subscription-manager-1.24.54-1.el7.centos.x86_64.rpm | 1.1 MB 00:00:00
(17/19): subscription-manager-rhsm-certificates-1.24.54-1.el7.c | 240 kB 00:00:00
(18/19): subscription-manager-rhsm-1.24.54-1.el7.centos.x86_64. | 336 kB 00:00:00
(19/19): oci-register-machine-0-6.git2b44233.el7.x86_64.rpm | 1.1 MB 00:00:01
---------------------------------------------------------------------------------------
總計 8.4 MB/s | 25 MB 00:02
從 http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 檢索密鑰
導入 GPG key 0xF4A80EB5:用戶ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"指紋 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5來自 : http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
是否繼續?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安裝 : subscription-manager-rhsm-certificates-1.24.54-1.el7.centos.x8 1/19 正在安裝 : subscription-manager-rhsm-1.24.54-1.el7.centos.x86_64 2/19 正在安裝 : python-dmidecode-3.12.2-4.el7.x86_64 3/19 正在安裝 : python-pytoml-0.1.14-1.git7dea353.el7.noarch 4/19 正在安裝 : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 5/19 正在安裝 : slirp4netns-0.4.3-4.el7_8.x86_64 6/19 正在安裝 : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 7/19 正在安裝 : 2:oci-umount-2.5-3.el7.x86_64 8/19 正在安裝 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 9/19 正在安裝 : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 10/19 正在安裝 : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 11/19 正在安裝 : python-syspurpose-1.24.54-1.el7.centos.x86_64 12/19 正在安裝 : subscription-manager-1.24.54-1.el7.centos.x86_64 13/19 正在安裝 : fuse3-libs-3.6.1-4.el7.x86_64 14/19 正在安裝 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 15/19 正在安裝 : 1:containers-common-0.1.40-11.el7_8.x86_64 16/19 正在安裝 : 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 17/19 正在安裝 : 2:docker-client-1.13.1-210.git7d71120.el7.centos.x86_64 18/19 正在安裝 : 2:docker-1.13.1-210.git7d71120.el7.centos.x86_64 19/19 驗證中 : 2:docker-client-1.13.1-210.git7d71120.el7.centos.x86_64 1/19 驗證中 : fuse3-libs-3.6.1-4.el7.x86_64 2/19 驗證中 : python-syspurpose-1.24.54-1.el7.centos.x86_64 3/19 驗證中 : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 4/19 驗證中 : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 5/19 驗證中 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 6/19 驗證中 : 2:docker-common-1.13.1-210.git7d71120.el7.centos.x86_64 7/19 驗證中 : 2:docker-1.13.1-210.git7d71120.el7.centos.x86_64 8/19 驗證中 : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 9/19 驗證中 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 10/19 驗證中 : 2:oci-umount-2.5-3.el7.x86_64 11/19 驗證中 : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 12/19 驗證中 : slirp4netns-0.4.3-4.el7_8.x86_64 13/19 驗證中 : subscription-manager-rhsm-1.24.54-1.el7.centos.x86_64 14/19 驗證中 : python-pytoml-0.1.14-1.git7dea353.el7.noarch 15/19 驗證中 : subscription-manager-rhsm-certificates-1.24.54-1.el7.centos.x8 16/19 驗證中 : 1:containers-common-0.1.40-11.el7_8.x86_64 17/19 驗證中 : python-dmidecode-3.12.2-4.el7.x86_64 18/19 驗證中 : subscription-manager-1.24.54-1.el7.centos.x86_64 19/19 已安裝:docker.x86_64 2:1.13.1-210.git7d71120.el7.centos 作為依賴被安裝:atomic-registries.x86_64 1:1.22.1-33.gitb507039.el7_8 container-selinux.noarch 2:2.119.2-1.911c772.el7_8 container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 containers-common.x86_64 1:0.1.40-11.el7_8 docker-client.x86_64 2:1.13.1-210.git7d71120.el7.centos docker-common.x86_64 2:1.13.1-210.git7d71120.el7.centos fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7 oci-register-machine.x86_64 1:0-6.git2b44233.el7 oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6 oci-umount.x86_64 2:2.5-3.el7 python-dmidecode.x86_64 0:3.12.2-4.el7 python-pytoml.noarch 0:0.1.14-1.git7dea353.el7 python-syspurpose.x86_64 0:1.24.54-1.el7.centos slirp4netns.x86_64 0:0.4.3-4.el7_8 subscription-manager.x86_64 0:1.24.54-1.el7.centos subscription-manager-rhsm.x86_64 0:1.24.54-1.el7.centos subscription-manager-rhsm-certificates.x86_64 0:1.24.54-1.el7.centos 完畢!