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使用条件: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[快速配置]

目录
相关文章
|
10天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
28 0
|
10天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
35 0
|
17天前
|
Linux
Linux中centos桌面消失网络图标
Linux中centos桌面消失网络图标
13 0
|
12天前
|
Ubuntu Linux 编译器
【Linux】4. 开发工具的使用(yum/vim)
【Linux】4. 开发工具的使用(yum/vim)
42 2
|
10天前
|
关系型数据库 MySQL Linux
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
17 0
|
10天前
|
缓存 Linux
linux centos7 挂载本地iso yum源
linux centos7 挂载本地iso yum源
51 0
|
10天前
|
关系型数据库 MySQL Linux
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
47 0
|
22天前
|
Linux
Linux: yum查看、安装、删除软件包
Linux: yum查看、安装、删除软件包
27 0
|
30天前
|
监控 网络协议 Linux
Linux 命令大全 & CentOS常用运维命令
Linux 命令大全 & CentOS常用运维命令
139 0
|
1月前
|
缓存 Linux Android开发
【Linux】软件包管理器 yum
【Linux】软件包管理器 yum

热门文章

最新文章