Centos yum "Couldn't resolve host 'mirrorlist.centos.org'"

2017-02-17 13:31:00
村里来的扫地僧
原创
864

1.编辑/etc/yum/pluginconf.d/fastestmirror.conf


[main]
enabled=1  修改 0
verbose=0
always_print_best_host = true
socket_timeout=3
#  Relative paths are relative to the cachedir (and so works for users as well
# as root).
hostfilepath=timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook
#include_only=.nl,.de,.uk,.ie
2.编辑 /etc/yum.conf



  1 [main]
  2 cachedir=/var/cache/yum/$basearch/$releasever
  3 keepcache=0
  4 debuglevel=2
  5 logfile=/var/log/yum.log
  6 exactarch=1
  7 obsoletes=1
  8 gpgcheck=1
  9 plugins=1 修改 0
 10 installonly_limit=5
 11 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
 12 distroverpkg=centos-release
 13 
 14 #  This is the default, if you make this bigger yum won't see if the metadata
 15 # is newer on the remote and so you'll "gain" the bandwidth of not having to
 16 # download the new metadata and "pay" for it by yum not having correct
 17 # information.
 18 #  It is esp. important, to have correct metadata, for distributions like
 19 # Fedora which don't keep old packages around. If you don't like this checking
 20 # interupting your command line usage, it's much better to have something
 21 # manually check the metadata once an hour (yum-updatesd will do this).
 22 # metadata_expire=90m
 23 
3.修改vim /etc/resolv.conf
nameserver 202.101.172.35
nameserver 202.101.172.47
nameserver 8.8.8.8 
4.清除clean



[root@node1 opt]# yum clean all
5.修改完成后,尝试安装



[root@node1 opt]# yum install -y lftp
base                                                                                                          | 3.7 kB     00:00     
base/primary_db                                                                                               | 4.7 MB     00:03     
extras                                                                                                        | 3.4 kB     00:00     
extras/primary_db                                                                                             |  37 kB     00:00     
updates                                                                                                       | 3.4 kB     00:00     
updates/primary_db                                                                                            | 4.3 MB     00:02     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lftp.x86_64 0:4.0.9-6.el6_8.4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
发表评论
零 减 壹 =
评论通过审核后显示。