cenyos7安装 yum不可用_Centos系统处理yum源不可用的问题

出现这个问题的情况是:

在使用yum源的时候提示

提示网络无法访问,因此需要重新的配置yum源;

First:先在/etc/yum.repo.d下的所有文件进行备份操作,我这里的操作是新建tmp的文件夹然后把目录中的数据全部移动到到这个tmp目录下;

Second:卸载之前安装的rpm包的,并重新安装对应的rpm包:

卸载这个rpm的包,执行命令:

rpm -e yum-3.4.3-132.el7.centos.0.1.noarch --nodeps

rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps

rpm -e yum-plugin-fastestmirror-1.1.31-34.el7.noarch --nodeps

然后重现安装这些软件:这里面有个情况是因为yum此时已经不可以使用,如果这个时候wget功能还是可以使用的化,直接执行wget的命令是可以的:

但是如果此时wget不能使用的化,也不要慌,此时可以找一个可以连接上网的机器,在特定目录下wget下,获得rpm的文件,直接上传到你要的机器就行:

Third:执行rpm -ivh yum-*安装相应的rpm的包:

Forth:现在配置repo文件,因此在/etc/yum.repo.d/CentOS-Base.repo

中输入相关内容(没有这个文件的需要自己创建个文件)

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client. You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-$releasever - Base

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Fifth:执行yum的相关操作:

yum clean all

yum makecache

最后,执行yum install telnet试试安装的成功不!

参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值