ROOT用户
进入rpm包所在目录执行命令
rpm -Uvh *.rpm --nodeps --force
验证:
gcc -v;
gcc-c++ -v 或者 g++ -v;
[rpauser@localhost gcc]$ cd /home/rpauser/install/gcc
[rpauser@localhost gcc]$
[rpauser@localhost gcc]$ su root
Password: root
[root@localhost gcc]#
[root@localhost gcc]# ls
cpp-4.8.5-44.el7.x86_64.rpm gcc-c++-4.8.5-44.el7.x86_64.rpm libgomp-4.8.5-44.el7.x86_64.rpm libstdc++-devel-4.8.5-44.el7.x86_64.rpm
gcc-4.8.5-44.el7.x86_64.rpm libgcc-4.8.5-44.el7.x86_64.rpm libstdc++-4.8.5-44.el7.x86_64.rpm remind.txt
[root@localhost gcc]#
[root@localhost gcc]#
[root@localhost gcc]# rpm -Uvh *.rpm --nodeps --force
warning: cpp-4.8.5-44.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:libgcc-4.8.5-44.el7 ################################# [ 8%]
2:libstdc++-4.8.5-44.el7 ################################# [ 15%]
3:libstdc++-devel-4.8.5-44.el7 ################################# [ 23%]
4:libgomp-4.8.5-44.el7 ################################# [ 31%]
5:cpp-4.8.5-44.el7 ################################# [ 38%]
6:gcc-4.8.5-44.el7 ################################# [ 46%]
7:gcc-c++-4.8.5-44.el7 ################################# [ 54%]
Cleaning up / removing...
8:gcc-c++-10.3.0-1pclos2021 ################################# [ 62%]
9:gcc-4.8.5-39.el7 ################################# [ 69%]
10:libstdc++-4.8.5-39.el7 ################################# [ 77%]
11:libgcc-4.8.5-39.el7 ################################# [ 85%]
12:cpp-4.8.5-39.el7 ################################# [ 92%]
13:libgomp-4.8.5-39.el7 ################################# [100%]
[root@localhost gcc]# rpm -qa|grep gcc
libgcc-4.8.5-44.el7.x86_64
gcc-4.8.5-44.el7.x86_64
gcc-c++-4.8.5-44.el7.x86_64