我在安装Red Hat Linux 时没有装到gcc,怎么才能在之后把gcc装上?

licaiyuren 2011-04-25 10:18:29
在虚拟机上安装的,三个镜像文件。
编译一个简单的程序时,提示gcc命令没有发现。
之前安装的时候,都是默认安装了gcc啊

谢谢各位
...全文
474 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
zaghost 2011-04-25
  • 打赏
  • 举报
回复
挂载光盘
rpm -ivh gccXX.rpm
yong_f 2011-04-25
  • 打赏
  • 举报
回复
把光盘插上,点系统设置里的添加删除应用程序就可以了
unixlinuxsys 2011-04-25
  • 打赏
  • 举报
回复

http://dag.wieers.com/rpm/FAQ.php#B4

B4. How do I use Yum ?
Yum is an update-tool written in python. The advantage of Yum is that it is written in Python. The disadvantage is that there are many versions of Yum, and only recent versions work with recent distributions. If you like to use a single tool across all distributions, it's better to use Apt.

Yum is usually already installed if you're running Fedora Core. In case you are using Red Hat Enterprise Linux or an older Red Hat Linux distribution. You can find Yum at: http://dag.wieers.com/packages/yum/

The configuration of Yum is inside the rpmforge-release package. You need to install it yourself.

If you've done that, the rest is simple. Upgrade your system by doing:

yum update
You can add new software by typing:

yum install <name of package>
Or update installed software:

yum update <name of package>
Or search for software in the local repository meta-data:

yum search <keyword>
Or simply list all available software:

yum list available
From time to time you may want to save some diskspace:

yum clean



B5. How do I use up2date ?
up2date is a tool written and shipped by Red Hat to update your system with the latest available updates. Starting with Red Hat Enterprise Linux 3 and Fedora Core 1 it can also be used with Apt and Yum repositories. Install up2date from your Red Hat installation and then add one of the following statements to /etc/sysconfig/rhn/sources:

### Dag RPM Repository for Fedora Core yum dag http://apt.sw.be/fedora/3/en/$ARCH/dag yum dag http://apt.sw.be/fedora/2/en/$ARCH/dag yum dag http://apt.sw.be/fedora/1/en/$ARCH/dag ### Dag RPM Repository for Red Hat Enterprise Linux yum dag http://apt.sw.be/redhat/el4/en/$ARCH/dag yum dag http://apt.sw.be/redhat/el3/en/$ARCH/dag
Now start up2date to update your system, by doing:

up2date -u



B2. How to configure to use RPMforge ?
It's very easy. Just install the latest rpmforge-release package for your distribution and architecture.

This will automatically install the configuration and GPG keys that are for safely installing RPMforge packages.

Please select the correct command from the following list:

Supported
Red Hat Enterprise Linux 5 / i386:

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Red Hat Enterprise Linux 5 / x86_64:

rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Red Hat Enterprise Linux 4 / i386:

rpm -Uhv http://apt.sw.be/redhat/el4/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
Red Hat Enterprise Linux 4 / x86_64:

rpm -Uhv http://apt.sw.be/redhat/el4/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm
Red Hat Enterprise Linux 3 / i386:

rpm -Uhv http://apt.sw.be/redhat/el3/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el3.rf.i386.rpm
Red Hat Enterprise Linux 3 / x86_64:

rpm -Uhv http://apt.sw.be/redhat/el3/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el3.rf.x86_64.rpm
Red Hat Enterprise Linux 2 / i386:

rpm -Uhv http://apt.sw.be/redhat/el2.1/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el2.rf.i386.rpm
Red Hat Linux 9 / i386:

rpm -Uhv http://apt.sw.be/redhat/9/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.rh9.rf.i386.rpm
Red Hat Linux 7.3 / i386:

rpm -Uhv http://apt.sw.be/redhat/8.0/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.rh7.rf.i386.rpm
steptodream 2011-04-25
  • 打赏
  • 举报
回复
直接下载rpm的话 依赖的问题比较多 估计你搞不定 2种方法最简单
1.挂载安装光盘,找到安装,依赖到哪个包,在光盘里继续找这个包
2.注册rhel免费使用30天,然后一条命令搞定yum -y install gcc gcc-c++
注册方法http://litvip.com/2011/04/17/223
翔云123456 2011-04-25
  • 打赏
  • 举报
回复
下个gcc安装包,安装一下就好了
licaiyuren 2011-04-25
  • 打赏
  • 举报
回复
都是好人,小弟刚刚年后才转入Linux,之前是做嵌入式wince的

以后还请各位大牛多多指导
李迟 2011-04-25
  • 打赏
  • 举报
回复
用光盘里的安装包最快。rh的都是rpm的,直接安装即可:rmp -ivh xxx.rpm。
注意要将光盘挂到虚拟机(虚拟机右下角有个图标的)。
freetstar 2011-04-25
  • 打赏
  • 举报
回复
把镜像重新挂在上去,把gcc g++装了
licaiyuren 2011-04-25
  • 打赏
  • 举报
回复
谢谢,我重新试一下
昵称很不好取 2011-04-25
  • 打赏
  • 举报
回复
能联网吗?可以下载rpm包之类的然后安装
也可以看看下面的链接,不联网安装
http://blog.csdn.net/huang_xw/archive/2009/04/06/4052810.aspx

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧