1

When running the following command, yum hangs on Setting up repositories.

[vagrant@centos48 yum.repos.d]$ sudo yum install emacs
Setting up Install Process
Setting up repositories

yum.conf

[vagrant@centos48 ~]$ cat /etc/yum.conf 
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
installonlypkgs=kernel kernel-smp kernel-devel kernel-smp-devel kernel-largesmp kernel-largesmp-devel kernel-hugemem kernel-hugemem-devel
distroverpkg=centos-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1
plugins=1

proxy= [intentionally not listed]

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

CentOS-Base.repo

Note that I got the same error as before when commenting out [base]'s baseurl, but leaving mirrorlist uncommented.

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#released updates
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
5
  • 1
    Would you include your /etc/yum.conf and repo files? (/etc/yum.repos.d/*?) Is the host on an internal network without Internet access? Jan 15, 2013 at 16:19
  • 1
    What does yum -v install emacs say? Also run yum repolist Jan 15, 2013 at 16:19
  • 1
    Actually, I didn't have my proxy set up correctly. But I got this error next, not using ftp, http[s], or file for repos, skipping - 4 is not a valid release or hasnt been released yet. Jan 15, 2013 at 16:23
  • As Aaron asked, Pasting your yum.conf and all other repo files /etc/yum.repos.d/* will really help us to understand and answer your query.
    – Napster_X
    Jan 15, 2013 at 16:44
  • Folks, thank you very much. I'm going to install CentOS 5 (I'm using vagrant) and try again. I'll post my yum repo files if I still have problems Jan 15, 2013 at 16:51

1 Answer 1

2

This is because your server is running an old version of CentOS 4, which went End-of-Life in February 2012. The files have been moved to the CentOS Vault. Your repo files would need to be modified in order to continue to use this OS with the YUM framework.

You can update your /etc/yum.repos.d/CentOS-Base.repo file to point to the new location as so:

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://vault.centos.org/4.9/os/$basearch
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#released updates 
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/4.9/updates/$basearch
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
6
  • wwyd (what would you do?) to fix it Jan 15, 2013 at 17:02
  • @Kevin Can you run cat /etc/issue?
    – ewwhite
    Jan 15, 2013 at 17:05
  • [vagrant@centos48 yum.repos.d]$ sudo cat /etc/issue CentOS release 4.8 (Final) Kernel \r on an \m Jan 15, 2013 at 17:06
  • 1
    Substitute "4.8" for "4.9" in my example above, then.
    – ewwhite
    Jan 15, 2013 at 17:07
  • I followed what you said for the addons and extras sections too. Success thanks. [vagrant@centos48 yum.repos.d]$ which emacs /usr/bin/emacs Jan 15, 2013 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .