
我正在嘗試使用 CentOs 6.3 預先建立的範本在 OpenVZ 容器上安裝 git。當我嘗試命令列時
yum install git
我收到訊息:
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
據我了解,git包應該位於centos6基礎儲存庫中: http://pkgs.org/centos-6-rhel-6/centos-rhel-x86_64/git-1.7.1-2.el6_0.1.x86_64.rpm.html
但它沒有找到它,我什至啟用了 EPEL 和 RPMForge repo,但仍然找不到 git 套件。
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
最奇怪的是我的 OpenVZ 伺服器在 CentOs 6.3 上運行,我能夠毫無問題地安裝 git。
您能幫我理解為什麼找不到該包嗎?
先感謝您。
答案1
您的 VPS 提供者已停用預設的 CentOS 儲存庫,並將其替換為實際上不提供對基本系統軟體包的存取的儲存庫。這似乎是一個常見的 OpenVZ 配置問題。
我透過以下方式解決了這個問題:
/etc/yum.repos.d
刪除引用 VZ 儲存庫的任何檔案。取得最新 RPM 的乾淨副本
centos-release
並將其安裝在現有 RPM 上:rpm -Uvh --replacefiles --replacepkgs centos-release-6*.rpm
長期解決方案可能是停止使用 OpenVZ。我還沒有找到一個能夠運作良好配置的公共 OpenVZ 提供者。