Tuesday, June 28, 2016

404 when executing `yum list`

When you're executing `yum list`, you may encounter the following error:

$ sudo yum list
Gathering header information file(s) from server(s)
Server: Red Hat Linux 4AS - x86_64 - Base
retrygrab() failed for:
  http://centos.ustc.edu.cn/centos/4/os/i386/headers/header.info
  Executing failover method
failover: out of servers to try
Error getting file http://centos.ustc.edu.cn/centos/4/os/i386/headers/header.info
[Errno 4] IOError: HTTP Error 404: Not Found
$

Opening the URL in a web browser will get 404, too: http://centos.ustc.edu.cn/centos/4/os/i386/headers/header.info

You can see `readme` in http://centos.ustc.edu.cn/centos/4/

and it includes the following:

```
This directory (and version of CentOS) is depreciated.

CentOS-4 is now past EOL

You can get the last released version of centos 4.9 here:

http://vault.centos.org/4.9/
```

Modify `/etc/yum.conf` as follows:

[base]
name=Red Hat Linux $releasever - $basearch - Base
#baseurl=http://centos.ustc.edu.cn/centos/4/os/i386/
baseurl=http://vault.centos.org/4.0/os/i386/

[updates]
name=Red Hat Linux $releasever - Updates
#baseurl=http://centos.ustc.edu.cn/centos/4/updates/i386/
baseurl=http://vault.centos.org/4.0/updates/i386/

and try `yum list` again.

No comments:

Post a Comment