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]:

能够正常使用了!!

`

相关文章
相关标签/搜索