linux 更新软件出现错误,Linux使用错误小结(CentOS)- yum更新软件失败

yum使用条件:yum的使用要保证internet网络连通,和“cat /etc/resolv.conf”文件下存在“nameserver 8.8.8.8”才可正常更新。

yum,是Yellow dog Updater, Modified 的简称,是杜克大学为了提高RPM 软件包安装性而开发的一种软件包管理器。

yum 的宗旨是自动化地升级,安装/移除rpm 包,收集rpm 包的相关信息,检查依赖性并自动提示用户解决。自动解决包的倚赖性问题,便于管理大量系统的更新问题。yum 的关键之处是要有可靠的repository。以下文件在重启系统(CentOS)

重启网路服务,修改“cat /etc/sysconfig/network-scripts/ifcfg-enp0s3”文件后:

[root@localhost install-files]# service network restart会导致,“cat /etc/resolv.conf”此文件更新,“nameserver 8.8.8.8”自动删除。

配置如下(

confA1):

[root@localhost install-files]# cat /etc/resolv.conf

# Generated by NetworkManager

search lan

nameserver fd7b:ac2f:6d73::1

nameserver 8.8.8.8

问题1:

如果在配置:

[root@localhost install-files]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

配置:DNS=192.168.10.1

则会导致“cat /etc/resolv.conf”文件异常更新,如下:

# Generated by NetworkManager

# No nameservers found; try putting DNS servers into your

# ifcfg files in /etc/sysconfig/network-scripts like so:

#

# DNS1=xxx.xxx.xxx.xxx

# DNS2=xxx.xxx.xxx.xxx

# DOMAIN=lab.foo.com bar.foo.com

解决1:

应该注释:“cat /etc/sysconfig/network-scripts/ifcfg-enp0s3”文件:

#DNS=192.168.10.1

然后重启网路服务生效“service network restart”,

然后,类似以上(

confA1)的配置,就可以ok使用。

问题2:

One of the configured repositories failed (未知),

and yum doesn't have enough cached data to continue. At this point the only

safe thing yum can do is fail. There are a few ways to work "fix" this:

....

Cannot find a valid baseurl for repo: base/7/x86_64

解决2:“cat /etc/resolv.conf”文件中增加“nameserver 8.8.8.8”解决。

问题3:

[root@localhost log]# yum install telnet

Loaded plugins: fastestmirror

http://mirrors.btte.net/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.btte.net; Unknown error"

Trying other mirror.

http://mirrors.neusoft.edu.cn/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; Unknown error"

Trying other mirror.

http://mirrors.hust.edu.cn/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.hust.edu.cn; Unknown error"

Trying other mirror.

http://mirrors.nwsuaf.edu.cn/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.nwsuaf.edu.cn; Unknown error"

Trying other mirror.

http://mirrors.pubyun.com/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.pubyun.com; Unknown error"

Trying other mirror.

http://mirrors.opencas.cn/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.opencas.cn; Unknown error"

Trying other mirror.

http://mirror.neu.edu.cn/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.neu.edu.cn; Unknown error"

Trying other mirror.

http://mirrors.sina.cn/centos/7.1.1503/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.sina.cn; Unknown error"

Trying other mirror.

…………………………

解决3:修改好ip能上网: CentOS配置ip[快速配置]

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值