Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache Centos:无法检索镜像列表_Apache_Centos_Yum - Fatal编程技术网

Apache Centos:无法检索镜像列表

Apache Centos:无法检索镜像列表,apache,centos,yum,Apache,Centos,Yum,我无法使用yum命令安装任何服务。 当我试图通过键入 [root@kstest /]# yum install httpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYC

我无法使用yum命令安装任何服务。 当我试图通过键入

[root@kstest /]# yum install httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
 * base: centos.aol.in
 * extras: centos-hn.viettelidc.com.vn
 * updates: centos.aol.in
http://centos.aol.in/6.5/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.aol.in/6.5/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
yum update -y
之后,当我尝试使用yum命令时,它会说

Existing lock /var/run/yum.pid: another copy is running as pid 2063.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  22 M RSS (219 MB VSZ)
    Started: Mon Jul 21 05:09:53 2014 - 01:09 ago
    State  : Traced/Stopped, pid: 2063
打开我输入的密码

ps aux | grep yum
kill -9 <pid number>
我得到以下信息

[root@kstest etc]# yum update -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * extras: centos-hn.viettelidc.com.vn
 * updates: centos.aol.in
http://centos.aol.in/6.5/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.aol.in/6.5/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
我如何解决这个问题? 如何安装httpd

etc/中的My yum.repos.d文件为空。我的yum.conf文件是

[main]
proxy=http://proxy.com:8000
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

我已经添加了代理。从6.4开始,我就遇到了同样的问题。我仍然感到震惊的是,没有一个容易找到的解决方案。快速的解决方法是注释掉所有的mirrorlist行并取消注释所有的baseurl行,但是根据一些论坛中的一些人的说法,这不是一件好事。

这个问题可以通过修复您的网络设置来解决。IPv6镜像不能在所有设置中工作。我使用Ansible所做的是禁用IPv6,并使用Google的公共解析器。剧本假定SELinux已禁用

---
- hosts: all
  user: vagrant
  sudo: True
  tasks:


  - name: "disable ipv6"
    shell: echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6

  - name: "disable ipv6"
    shell: echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

  - name: "restart network"
    service: name=network state=restarted

  - name: "add public resolver"
    lineinfile: dest=/etc/resolv.conf regexp='^nameserver' 
              line='nameserver 8.8.8.8' state=present

  - name: "clean yum"
    shell: yum clean all

  - name: "warmup Yum"
    shell: yum search libselinux-python

  - name: "use Yum"
    yum: name={{ item }} state=installed
    with_items: 
      - libselinux-python

  - name: "Enable SELinux"
    selinux: policy=targeted state=permissive

如果在/etc/yum.conf中定义代理服务器,则所有用户在使用yum时都会使用这些详细信息连接到代理服务器。要使所有yum操作能够使用代理服务器,请在/etc/yum.conf中指定代理服务器详细信息

在/etc/yum.conf中添加如下条目,以使yum能够使用代理(此处代理服务器:abc.mydomain.com,连接到端口8080)


proxy=

我已经找到了问题的解决方案。因为没有启用internet。因此,当我尝试打开Yum时,它无法下载包。我的管理员已授予我权限,我可以下载。要查看,请尝试pingping www.google.com和ping6 www.google.com。你会发现的。