在rhel 6.1上安装gcc

时间:2021-07-03 07:03:52

GCC doesnt seem to be installed on my Rhel 6.1 machine. Also, when i did:

我的Rhel 6.1机器上似乎没有安装GCC。同样,当我做:

sudo yum install gcc 

It barfed:

它高超的:

Updating Red Hat repositories.
Setting up Install Process
No package gcc available.
Error: Nothing to do

The same command works fine on rhel 5.5. What could be the problem?

同样的命令在rhel 5.5上可以正常工作。有什么问题呢?

Update:

更新:

sudo yum search gcc

Returns:

返回:

libgcc.x86_64 : GCC version 4.4 shared support library
libgomp.x86_64 : GCC OpenMP v3.0 shared support library

sudo yum grouplist

Returns:

返回:

Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Setting up Group Process
Error: No group data available for configured repositories


sudo  yum install repolist

Returns:

返回:

Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
No package repolist available.
Error: Nothing to do

Update 2:

更新2:

sudo yum repolist

Returns:

返回:

Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
repolist: 0

1 个解决方案

#1


1  

I solved this by switch from rhn to (more commonly available sources) centos.

我通过从rhn切换到(更常见的资源)centos来解决这个问题。

  1. Remove "yum-rhn-plugin" package from RHEL, this is used to check the activation in RHEL.
  2. 从RHEL中删除“yum-rhn-plugin”包,这用于检查RHEL中的激活情况。

rpm -e yum-rhn-plugin

rpm - e yum-rhn-plugin

  1. Remove the "redhat-release" related packages, this is used to check the repositories compatibility. usually we can't remove these packages because they are used by other packages of the system for proper fuctioning. so we'll use the "--nodeps" parameter to forcely remove them from the system.
  2. 删除“redhat-release”相关的包,这用于检查存储库的兼容性。通常我们不能删除这些包,因为它们被系统的其他包用于正确的赋值。我们将使用-nodeps参数从系统中删除它们。

rpm -e redhat-release-notes-5Server redhat-release-5Server --nodeps

rpm -e redhat-release-notes-5Server redhat-release-5Server—nodeps

  1. Download & install the "centos-release" relates packages, to fill in the gap that we made by removing the "redhat-release" related packages.
  2. 下载并安装“centos-release”相关包,以填补我们通过删除“redhat-release”相关包所造成的空白。

http://mirror.centos.org/centos-5/5/os/i386/CentOS/centos-release-5-11.el5.centos.i386.rpm http://mirror.centos.org/centos-5/5/os/i386/CentOS/centos-release-notes-5.11-0.i386.rpm

http://mirror.centos.org/centos - 5/5/os/i386/centos/centos -释放- 5 - 11. - el5.centos.i386.rpm http://mirror.centos.org/centos - 5/5/os/i386/centos/centos -释放- - 5.11 - 5.11 - i386.rpm指出

  1. To automatically inform about the updates in GUI, in /etc/yum/yum-updatesd.conf add the following under the section "# how to send notifications"
  2. 要自动通知GUI中的更新,请使用/etc/yum/yum-updatesd。conf在“如何发送通知”一节中添加以下内容

dbus_listener = yes

dbus_listener = yes

  1. To change the OS name in the CLI login, edit /etc/issue. Since we have installed the "centos-release" relates packages, the OS name will come as "CentOS release 5 (Final)", so delete it and type:
  2. 要更改CLI登录中的OS名称,请编辑/etc/ issues .由于我们已经安装了“CentOS -release”相关的包,所以OS名称将以“CentOS release 5 (Final)”来命名。,因此删除它并输入:

Red Hat Enterprise Linux Server release 5 (Tikanga) (Or any name you like)

红帽企业Linux服务器第5版(或您喜欢的任何名称)

  1. And now run;
  2. 现在运行;

yum updates

yum更新

#1


1  

I solved this by switch from rhn to (more commonly available sources) centos.

我通过从rhn切换到(更常见的资源)centos来解决这个问题。

  1. Remove "yum-rhn-plugin" package from RHEL, this is used to check the activation in RHEL.
  2. 从RHEL中删除“yum-rhn-plugin”包,这用于检查RHEL中的激活情况。

rpm -e yum-rhn-plugin

rpm - e yum-rhn-plugin

  1. Remove the "redhat-release" related packages, this is used to check the repositories compatibility. usually we can't remove these packages because they are used by other packages of the system for proper fuctioning. so we'll use the "--nodeps" parameter to forcely remove them from the system.
  2. 删除“redhat-release”相关的包,这用于检查存储库的兼容性。通常我们不能删除这些包,因为它们被系统的其他包用于正确的赋值。我们将使用-nodeps参数从系统中删除它们。

rpm -e redhat-release-notes-5Server redhat-release-5Server --nodeps

rpm -e redhat-release-notes-5Server redhat-release-5Server—nodeps

  1. Download & install the "centos-release" relates packages, to fill in the gap that we made by removing the "redhat-release" related packages.
  2. 下载并安装“centos-release”相关包,以填补我们通过删除“redhat-release”相关包所造成的空白。

http://mirror.centos.org/centos-5/5/os/i386/CentOS/centos-release-5-11.el5.centos.i386.rpm http://mirror.centos.org/centos-5/5/os/i386/CentOS/centos-release-notes-5.11-0.i386.rpm

http://mirror.centos.org/centos - 5/5/os/i386/centos/centos -释放- 5 - 11. - el5.centos.i386.rpm http://mirror.centos.org/centos - 5/5/os/i386/centos/centos -释放- - 5.11 - 5.11 - i386.rpm指出

  1. To automatically inform about the updates in GUI, in /etc/yum/yum-updatesd.conf add the following under the section "# how to send notifications"
  2. 要自动通知GUI中的更新,请使用/etc/yum/yum-updatesd。conf在“如何发送通知”一节中添加以下内容

dbus_listener = yes

dbus_listener = yes

  1. To change the OS name in the CLI login, edit /etc/issue. Since we have installed the "centos-release" relates packages, the OS name will come as "CentOS release 5 (Final)", so delete it and type:
  2. 要更改CLI登录中的OS名称,请编辑/etc/ issues .由于我们已经安装了“CentOS -release”相关的包,所以OS名称将以“CentOS release 5 (Final)”来命名。,因此删除它并输入:

Red Hat Enterprise Linux Server release 5 (Tikanga) (Or any name you like)

红帽企业Linux服务器第5版(或您喜欢的任何名称)

  1. And now run;
  2. 现在运行;

yum updates

yum更新