yum不能使用问题

问题:

[root@localhost yum.repos.d]# yum install wget
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>

[root@localhost yum.repos.d]# yum repolist all
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
源标识                             源名称                              状态
C7.0.1406-base/x86_64              CentOS-7.0.1406 - Base              禁用
C7.0.1406-centosplus/x86_64        CentOS-7.0.1406 - CentOSPlus        禁用
C7.0.1406-extras/x86_64            CentOS-7.0.1406 - Extras            禁用
C7.0.1406-fasttrack/x86_64         CentOS-7.0.1406 - CentOSPlus        禁用
C7.0.1406-updates/x86_64           CentOS-7.0.1406 - Updates           禁用
C7.1.1503-base/x86_64              CentOS-7.1.1503 - Base              禁用
C7.1.1503-centosplus/x86_64        CentOS-7.1.1503 - CentOSPlus        禁用
C7.1.1503-extras/x86_64            CentOS-7.1.1503 - Extras            禁用
C7.1.1503-fasttrack/x86_64         CentOS-7.1.1503 - CentOSPlus        禁用
C7.1.1503-updates/x86_64           CentOS-7.1.1503 - Updates           禁用
C7.2.1511-base/x86_64              CentOS-7.2.1511 - Base              禁用
C7.2.1511-centosplus/x86_64        CentOS-7.2.1511 - CentOSPlus        禁用
C7.2.1511-extras/x86_64            CentOS-7.2.1511 - Extras            禁用
C7.2.1511-fasttrack/x86_64         CentOS-7.2.1511 - CentOSPlus        禁用
C7.2.1511-updates/x86_64           CentOS-7.2.1511 - Updates           禁用
C7.3.1611-base/x86_64              CentOS-7.3.1611 - Base              禁用
C7.3.1611-centosplus/x86_64        CentOS-7.3.1611 - CentOSPlus        禁用
C7.3.1611-extras/x86_64            CentOS-7.3.1611 - Extras            禁用
C7.3.1611-fasttrack/x86_64         CentOS-7.3.1611 - CentOSPlus        禁用
C7.3.1611-updates/x86_64           CentOS-7.3.1611 - Updates           禁用
base-debuginfo/x86_64              CentOS-7 - Debuginfo                禁用
base-source/7                      CentOS-7 - Base Sources             禁用
c7-media                           CentOS-7 - Media                    禁用
centosplus-source/7                CentOS-7 - Plus Sources             禁用
cr/7/x86_64                        CentOS-7 - cr                       禁用
extras-source/7                    CentOS-7 - Extras Sources           禁用
fasttrack/7/x86_64                 CentOS-7 - fasttrack                禁用
updates-source/7                   CentOS-7 - Updates Sources          禁用
repolist: 0

解决方法:

因为我的系统为:centos7   :所以使用文件:CentOS7-Base-163.repo   下载该文件到

[root@localhost yum.repos.d]# yum clean all
已加载插件:fastestmirror
正在清理软件源: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror
base                                                | 3.6 kB     00:00     
extras                                              | 3.4 kB     00:00     
updates                                             | 3.4 kB     00:00     
(1/12): base/7/x86_64/group_gz                        | 166 kB   00:00     
(2/12): base/7/x86_64/primary_db                      | 5.9 MB   00:00     
(3/12): base/7/x86_64/filelists_db                    | 6.9 MB   00:00     
(4/12): base/7/x86_64/other_db                        | 2.5 MB   00:00     
(5/12): extras/7/x86_64/prestodelta                   | 100 kB   00:00     
(6/12): extras/7/x86_64/filelists_db                  | 603 kB   00:00     
(7/12): extras/7/x86_64/primary_db                    | 205 kB   00:00     
(8/12): extras/7/x86_64/other_db                      | 126 kB   00:00     
(9/12): updates/7/x86_64/prestodelta                  | 679 kB   00:00     
(10/12): updates/7/x86_64/filelists_db                | 3.4 MB   00:00     
(11/12): updates/7/x86_64/other_db                    | 578 kB   00:00     
(12/12): updates/7/x86_64/primary_db                  | 6.0 MB   00:00     
Determining fastest mirrors
元数据缓存已建立
[root@localhost yum.repos.d]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
源标识                       源名称                                   状态
base/7/x86_64                CentOS-7 - Base - 163.com                9,911
extras/7/x86_64              CentOS-7 - Extras - 163.com                434
updates/7/x86_64             CentOS-7 - Updates - 163.com             1,614
repolist: 11,959

上面repolist 显示安装成功

测试: yum install wget   则安装成功

参考:https://blog.csdn.net/qq_39720249/article/details/84104646

猜你喜欢

转载自blog.csdn.net/qq_33124081/article/details/84769449
今日推荐