Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to install git on an OpenVZ container using the CentOs 6.3 precreated template. When I try the command line

yum install git

I get the message:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.cubiculestudio.com
 * epel: mirror.csclub.uwaterloo.ca
 * extras: www.cubiculestudio.com
 * rpmforge: mirror.us.leaseweb.net
 * updates: www.cubiculestudio.com
Setting up Install Process
No package git available.
Error: Nothing to do

As I understand, the git package should be in the centos6 base repository: http://pkgs.org/centos-6-rhel-6/centos-rhel-x86_64/git-1.7.1-2.el6_0.1.x86_64.rpm.html

But it doesn't find it, I even have the EPEL and RPMForge repo enabled, but still can't find the git package.

yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.cubiculestudio.com
 * epel: mirror.csclub.uwaterloo.ca
 * extras: www.cubiculestudio.com
 * rpmforge: mirror.us.leaseweb.net
 * updates: www.cubiculestudio.com
repo id                           repo name                                                           status
base                              CentOS-6 - Base                                                     4,776
epel                              Extra Packages for Enterprise Linux 6 - i386                        6,523
extras                            CentOS-6 - Extras                                                       4
rpmforge                          RHEL 6 - RPMforge.net - dag                                         4,501
updates                           CentOS-6 - Updates                                                    596
vz-base                           vz-base                                                                 3
vz-updates                        vz-updates                                                              0
repolist: 16,403

The weirdest thing is that my OpenVZ server is running on CentOs 6.3 and I was able to install git without any issue.

Can you help me understanding why it doesn't find the package?

Thank you in advance.

share|improve this question

1 Answer 1

Your VPS provider has disabled the default CentOS repositories and replaced them with repos which do not actually provide access to the base system packages. This seems to be a common OpenVZ configuration issue.

I worked around it by:

  1. Deleting any file in /etc/yum.repos.d which referenced VZ repositories.
  2. Getting a clean copy of the latest centos-release RPM and installing that over the existing one:

    rpm -Uvh --replacefiles --replacepkgs centos-release-6*.rpm
    

The long-term solution is probably to stop using OpenVZ. I have yet to find a single public OpenVZ provider which manages to run a decent configuration.

share|improve this answer
    
Here is what I did: rm -f /etc/yum.repos.d/openvz.repo rpm -Uvh --replacefiles --replacepkgs mirror.centos.org/centos/6/os/i386/Packages/… yum clean all yum update yum install git but it still give me the same error. Thank you. –  drivard Oct 15 '12 at 15:12
1  
Looks reasonable. At this point I would go shopping for a new (never OpenVZ) VPS. –  Michael Hampton Oct 15 '12 at 15:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.