《LINUX学习:关于RedHat Linux无法使用yum命令安装gcc-c++问题》要点:
本文介绍了LINUX学习:关于RedHat Linux无法使用yum命令安装gcc-c++问题,希望对您有用。如果有疑问,可以联系我们。
初入职场,在给RedHat Linux安装情况的时候遇到这么个问题.
参考:
[root@localhost ~]# 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
对于习惯使用CentOS的人来说,不克不及使用这个命令,简直是种折磨
办理过程:
1.给linux redhat安装Centos镜像
[root@localhost~]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
–2015-10-09 14:33:10– http://mirrors.163.com/.help/CentOS6-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: `CentOS6-Base-163.repo’
100%2,341 –.-K/s in 0s
2015-10-09 14:33:22 (108 MB/s) -`CentOS6-Base-163.repo’ saved [2341/2341]
2.改动repo文件
[root@localhost~]# mv CentOS6-Base-163.repo /etc/yum.repos.d/
淫乱 把$releasever替换成6
[root@localhost yum.repos.d]# sed -i ‘s#$releasever#6#g’ ./CentOS6-Base-163.repo
3.肃清所有缓存
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: katello,subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Cleaning up Everything
4.获取yum列表
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: katello,subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
addons | 1.9 kB 00:00
addons/filelists_db | 570 B 00:00
……..
……..
base 3667/3667
base 3667/3667
base 3667/3667
Metadata Cache Created
5.搜刮安装
[root@localhost ~]# yum search gcc |grep –color ‘^gcc’
gcc.x86_64 : Various compilers (C,C++,Objective-C,Java,…)
gcc-c++.x86_64 : C++ support for GCC
gcc-gfortran.x86_64 : Fortran 95 support
gcc-gnat.x86_64 : Ada 95 support for GCC
gcc-java.x86_64 : Java support for GCC
gcc-objc++.x86_64 : Objective-C++ support for GCC
gcc-objc.x86_64 : Objective-C support for GCC
gcc44.x86_64 : GNU Compiler Collection version 4.4
gcc44-c++.x86_64 : C++ support for GCC version 4.4
gcc44-gfortran.x86_64 : Fortran support for GCC 4.4
6.安装gcc
[root@localhost yum.repos.d]# yum -y install gcc
至此,gcc安装完成,而且对于其他的编译环境也可以使用yum安装了.
Linux升级GCC 4.8.1清楚简明教程(Ubuntu 12.04 64位版为例)
Ubuntu 14.04 LST安装GCC 4.1.2
Ubuntu下Vim+GCC+GDB安装及使用
Ubuntu下两个GCC版本切换
CentOS6.5进级手动安装GCC4.8.2
Ubuntu进级GCC版本
CentOS7情况下在/离线安装GCC与GCC-C++
Ubuntu 16.04 LTS 降级安装GCC 4.8
本文永远更新链接地址:
脚本之家PHP培训学院每天发布《LINUX学习:关于RedHat Linux无法使用yum命令安装gcc-c++问题》等实战技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培养人才。