CentOS下yum找不到安裝軟件的解決方法。


  在centos下用yum安裝新軟件是,yum有時候會提示找不到相應的軟件(當然可以用源碼安裝來解決問題,不過這個需要手動解決依賴問題,比較麻煩。)。這時可以到https://fedoraproject.org/wiki/EPEL的子欄目:"How can I use these extra packages?", 到一個和系統相關的epel-release。然后用rpm安裝epel-release包,再重新yum install就可以了。附上記錄,方便以后解決同類問題。

#yum install git
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Setting up Install Process
No package git available.
Nothing to do

#su -c 'rpm -Uvh http://mirrors.sohu.com/fedora-epel/5/i386/epel-release-5-4.noarch.rpm'

或者

#sudo rpm -Uvh http://mirrors.sohu.com/fedora-epel/5/i386/epel-release-5-4.noarch.rpm

[root@glfs1 ~]# yum install git
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * epel: mirrors.sohu.com
epel                                                                                                                  | 3.7 kB     00:00     
epel/primary_db                                                                                                       | 3.8 MB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.4.1-1.el5 set to be updated
--> Processing Dependency: perl-Git = 1.7.4.1-1.el5 for package: git
--> Processing Dependency: perl(Error) for package: git
--> Processing Dependency: perl(Git) for package: git
--> Running transaction check
---> Package perl-Error.noarch 1:0.17010-1.el5 set to be updated
---> Package perl-Git.x86_64 0:1.7.4.1-1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved
..........

..........

順利完成安裝。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM