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

时间:2022-05-24 05:15:21
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[快速配置]

相关文章