centos yum不能用了There are no enabled repos.

訪問網址,按步驟執行
http://mirrors.163.com/.help/centos.htmlhtml

直接:
cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS7-Base-163.repo 下載cenos7 對應的CentOS7-Base-163.repo文件到本地python

繼續運行 yum clean all yum makecache ` yum install rsynccentos

yum install rsync

報錯:
Loaded plugins: aliases, fastestmirror, protectbase Loading mirror speeds from cached hostfile File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntaxthis

Exiting on user cancelurl

繼續運行 vi /usr/libexec/urlgrabber-ext-downcode

將第一行#! /usr/bin/python 改成 #! /usr/bin/python3 本地安裝的python版本爲3.6.2htm

繼續運行 yum install rsyncci

yum install rsync

Loaded plugins: aliases, fastestmirror, protectbase Loading mirror speeds from cached hostfile 0 packages excluded due to repository protections Resolving Dependencies --> Running transaction check ---> Package rsync.x86_64 0:3.1.2-6.el7_6.1 will be installed --> Finished Dependency Resolutionget

Dependencies Resolvedit

========================================================================================================================================================================== Package Arch Version Repository Size

Installing: rsync x86_64 3.1.2-6.el7_6.1 updates 404 k

Transaction Summary

Install 1 Package

Total download size: 404 k Installed size: 815 k Is this ok [y/d/N]:

能夠正常使用了!!

`

相關文章
相關標籤/搜索