赞
踩
- # 安装 docker
- yum install -y yum-utils
- yum-config-manager \
- --add-repo \
- https://download.docker.com/linux/centos/docker-ce.repo
- yum install -y docker-ce docker-ce-cli containerd.io
-
- # 启动 docker。
- systemctl start docker
[root@localhost ~]# yum install -y yum-utils
CentOS-8 - AppStream 25 B/s | 38 B 00:01
CentOS-8 - Base 69 B/s | 38 B 00:00
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Last metadata expiration check: 0:11:10 ago on Mon 20 May 2024 06:26:45 AM PDT.
No match for argument: yum-utils
Error: Unable to find a match
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 44
-rw-r--r--. 1 root root 731 Aug 13 2019 CentOS-AppStream.repo
-rw-r--r--. 1 root root 712 Aug 13 2019 CentOS-Base.repo
-rw-r--r--. 1 root root 798 Aug 13 2019 CentOS-centosplus.repo
-rw-r--r--. 1 root root 1320 Aug 13 2019 CentOS-CR.repo
-rw-r--r--. 1 root root 668 Aug 13 2019 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 756 Aug 13 2019 CentOS-Extras.repo
-rw-r--r--. 1 root root 338 Aug 13 2019 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 928 Aug 13 2019 CentOS-Media.repo
-rw-r--r--. 1 root root 736 Aug 13 2019 CentOS-PowerTools.repo
-rw-r--r--. 1 root root 1382 Aug 13 2019 CentOS-Sources.repo
-rw-r--r--. 1 root root 74 Aug 13 2019 CentOS-Vault.repo
[root@localhost yum.repos.d]# rm *.repo #
rm: remove regular file 'CentOS-AppStream.repo'? y
rm: remove regular file 'CentOS-Base.repo'? y
rm: remove regular file 'CentOS-centosplus.repo'? y
rm: remove regular file 'CentOS-CR.repo'? y
rm: remove regular file 'CentOS-Debuginfo.repo'? y
rm: remove regular file 'CentOS-Extras.repo'? y
rm: remove regular file 'CentOS-fasttrack.repo'? y
rm: remove regular file 'CentOS-Media.repo'? y
rm: remove regular file 'CentOS-PowerTools.repo'? y
rm: remove regular file 'CentOS-Sources.repo'? y
rm: remove regular file 'CentOS-Vault.repo'? y
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2024-05-20 06:54:40-- https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 113.207.38.79, 58.19.152.234, 121.31.228.216, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|113.207.38.79|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
/etc/yum.repos.d/Ce 100%[===================>] 2.44K --.-KB/s in 0s
2024-05-20 06:54:40 (39.5 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]
[root@localhost yum.repos.d]# yum makecache
CentOS-8.5.2111 - AppStream - mirrors.aliyun.co 3.5 MB/s | 8.4 MB 00:02
CentOS-8.5.2111 - Base - mirrors.aliyun.com 13 kB/s | 3.9 kB 00:00
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 2.9 kB/s | 1.5 kB 00:00
Metadata cache created.
[root@localhost yum.repos.d]# yum install -y yum-utils
完成!!
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 44
-rw-r--r--. 1 root root 731 Aug 13 2019 CentOS-AppStream.repo
-rw-r--r--. 1 root root 712 Aug 13 2019 CentOS-Base.repo
-rw-r--r--. 1 root root 798 Aug 13 2019 CentOS-centosplus.repo
-rw-r--r--. 1 root root 1320 Aug 13 2019 CentOS-CR.repo
-rw-r--r--. 1 root root 668 Aug 13 2019 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 756 Aug 13 2019 CentOS-Extras.repo
-rw-r--r--. 1 root root 338 Aug 13 2019 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 928 Aug 13 2019 CentOS-Media.repo
-rw-r--r--. 1 root root 736 Aug 13 2019 CentOS-PowerTools.repo
-rw-r--r--. 1 root root 1382 Aug 13 2019 CentOS-Sources.repo
-rw-r--r--. 1 root root 74 Aug 13 2019 CentOS-Vault.repo
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2024-05-20 06:39:37-- https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 113.207.38.116, 113.207.38.79, 113.207.38.80, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|113.207.38.116|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
/etc/yum.repos.d/Ce 100%[===================>] 2.44K --.-KB/s in 0s
2024-05-20 06:39:38 (66.7 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]
[root@localhost yum.repos.d]# yum makecache
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
CentOS-8 - AppStream 25 B/s | 38 B 00:01
CentOS-8.5.2111 - Base - mirrors.aliyun.com 1.7 MB/s | 4.6 MB 00:02
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 4.3 kB/s | 10 kB 00:02
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Metadata cache created.
[root@localhost yum.repos.d]# yum install -y yum-utils
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
CentOS-8 - AppStream 24 B/s | 38 B 00:01
CentOS-8.5.2111 - Base - mirrors.aliyun.com 3.2 kB/s | 3.9 kB 00:01
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 1.3 kB/s | 1.5 kB 00:01
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Error:
Problem: package python3-libdnf-0.63.0-3.el8.x86_64 requires libsolv.so.1()(64bit), but none of the providers can be installed
- package python3-libdnf-0.63.0-3.el8.x86_64 requires libsolvext.so.1()(64bit), but none of the providers can be installed
- package python3-dnf-4.7.0-4.el8.noarch requires python3-libdnf >= 0.61.1, but none of the providers can be installed
- cannot install both libsolv-0.7.19-1.el8.x86_64 and libsolv-0.6.35-6.el8.x86_64
- package yum-utils-4.0.21-3.el8.noarch requires python3-dnf >= 4.2.22, but none of the providers can be installed
- package rpm-ostree-libs-2018.8-2.el8.0.1.x86_64 requires libsolv.so.0()(64bit), but none of the providers can be installed
- package rpm-ostree-libs-2018.8-2.el8.0.1.x86_64 requires libsolv.so.0(SOLV_1.0)(64bit), but none of the providers can be installed
- conflicting requests
- problem with installed package rpm-ostree-libs-2018.8-2.el8.0.1.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
#运行yum install -y yum-utils又报错--->原因:没有删除所有的.repo源文件
[root@localhost ~]# systemctl start docker
查看版本:
[root@localhost ~]# docker version
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。