解决RedHat5.8无法利用yum安装软件问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决RedHat5.8无法利用yum安装软件问题相关的知识,希望对你有一定的参考价值。

解决RedHat5.8无法利用yum安装软件问题

好久都没有用红帽系统了,今天在睿江云安装部署Sybase,在RedHat5.8的环境需要测试,用yum安装gcc结果如下:


[[email protected] ~]# yum -y install gcc
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
No package gcc available.
Nothing to do

报没有gcc软件包存在,她没有办法,只好叫我帮忙弄好了!
 
系统版本如下:

[[email protected] ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
Kernel \r on an \m

解决过程:

下载163安装源


[[email protected]~]# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
--2015-10-09 14:33:10-- http://mirrors.163.com/.help/CentOS5-Base-163.repo
Resolving mirrors.163.com... 123.58.173.186,123.58.173.185
Connecting to mirrors.163.com|123.58.173.186|:80...connected.
HTTP request sent, awaiting response... 200 OK
Length: 2341 (2.3K) [application/octet-stream]
Saving to: `CentOS5-Base-163.repo'
 
100%2,341       --.-K/s   in 0s     
 
2015-10-09 14:33:22 (108 MB/s) -`CentOS5-Base-163.repo' saved [2341/2341]
[[email protected]~]# mv CentOS5-Base-163.repo /etc/yum.repos.d/


修改repo文件


*** 把$releasever替换成5.8[[email protected] yum.repos.d]# sed -i 's#$releasever#5#g' ./CentOS5-Base-163.repo


清除原有缓存


[[email protected] yum.repos.d]# yum clean all
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Cleaning up Everything


获取yum列表


[[email protected] yum.repos.d]# yum makecache
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
addons                                                                                                 | 1.9 kB     00:00     
addons/filelists_db                                                                                    |  570 B     00:00     
addons/other_db                                                                                        |  554 B     00:00     
addons/primary_db                                                                                      | 1.1 kB     00:00     
base                                                                                                   | 1.1 kB     00:00     
base/filelists                                                                                         | 3.7 MB     00:11     
base/other                                                                                             |  14 MB     01:04     
base/group                                                                                             | 1.1 MB     00:03     
base/primary                                                                                           | 1.3 MB     00:06     
epel                                                                                                   | 3.6 kB     00:00     
epel/filelists_db                                                                                      | 4.1 MB     00:16     
epel/updateinfo                                                                                        | 510 kB     00:02     
epel/other_db                                                                                          | 1.6 MB     00:05     
epel/primary_db                                                                                        | 2.9 MB     00:14     
extras                                                                                                 | 2.1 kB     00:00     
extras/filelists_db                                                                                    | 224 kB     00:00     
extras/other_db                                                                                        | 442 kB     00:01     
extras/group                                                                                           | 9.7 kB     00:00     
extras/primary_db                                                                                      | 173 kB     00:00     
updates                                                                                                | 1.9 kB     00:00     
updates/filelists_db                                                                                   | 2.1 MB     00:09     
updates/other_db                                                                                       |  11 MB     00:29     
updates/primary_db                                                                                     | 531 kB     00:00     
base                                                                                                                3667/3667
base                                                                                                                3667/3667
base                                                                                                                3667/3667
Metadata Cache Created


搜索安装


技术分享图片

[[email protected] yum.repos.d]# yum -y install gcc


以上是关于解决RedHat5.8无法利用yum安装软件问题的主要内容,如果未能解决你的问题,请参考以下文章

Redhat5.8以光盘镜像文件配置yum

如何解决Linux下的软件包依赖问题

Apache编译后无法正常工作

怎么解决安装linux软件的依赖问题

yum 如何安装依赖

RedHat5--yun源无法使用问题解决