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:
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.
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:
- Deleting any file in
/etc/yum.repos.dwhich referenced VZ repositories.
Getting a clean copy of the latest
centos-releaseRPM 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.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.