Get the App
SLTechnology News&Howtos  ›  Development  › 

After installing linux redhat, you can't use the yum command to install gcc-c++.

Shulou Source: shulou.com Published: 2022-05-31 22:48:00 09月21日 Update

This article mainly introduces the "installation of linux redhat can not use the yum command to install gcc-c++ after the installation of gcc-c++" related knowledge, editor through the actual case to show you the process of operation, the method of operation is simple and fast, practical, hope that this "installation of linux redhat can not use the yum command to install gcc-c++ how to solve" article can help you solve the problem.

Question:

[root@localhost] # yum-y install gccloaded plugins: katello, product-id, security, subscription-managerupdating certificate-based repositories.unable to read consumer identitysetting up install processno package gcc available.nothing to do

For people who are used to using centos, it is torture not to use this command.

Resolution process:

1. Install a centos image for linux redhat

[root@localhost~] # wget http://mirrors.163.com/.help/centos6-base-163.repo--2015-10-09 14root@localhost~ 3310muri-http://mirrors.163.com/.help/centos6-base-163.reporesolving mirrors.163.com... 123.58.173.186123.58.173.185connecting to mirrors.163.com | 123.58.173.186 |: 80...connected.http request sent, awaiting response... 200 oklength: 2341 (2.3k) [application/octet-stream] saving to: `centos6-base-163.repo'100%2341 -.-- k in 0s 2015-10-09 14:33:22 (108mb/s)-`centos6-base-163.repo' saved [2341Comp2341]

two。 Modify the repo file

[root@localhost~] # mv centos6-base-163.repo / etc/yum.repos.d/*** replace $releasever with 6 [root@localhost yum.repos.d] # sed-I's releasing releases. / centos6-base-163.repo

3. Clear all caches

[root@localhost yum.repos.d] # yum clean allloaded plugins: katello, product-id, security, subscription-managerupdating certificate-based repositories.unable to read consumer identitycleaning up everything

4. Get yum list

[root@localhost yum.repos.d] # yum makecacheloaded plugins: katello, product-id, security Subscription-managerupdating certificate-based repositories.unable to read consumer identityaddons | 1.9kb 00:00 addons/filelists_db | 570b 00:00 .base 3667/3667base 3667/3667base 3667/3667metadata cache created

5. Search for installation

[root@localhost ~] # yum search gcc | grep-- color'^ gcc'gcc.x86_64: various compilers (c, clockwise, objective-c, java) ) gcc-c++.x86_64: C++ support for gccgcc-gfortran.x86_64: fortran 95 supportgcc-gnat.x86_64: ada 95 support for gccgcc-java.x86_64: java support for gccgcc-objc++.x86_64: objective-c++ support for gccgcc-objc.x86_64: objective-c support for gccgcc44.x86_64: gnu compiler collection version 4.4gcc44-c++.x86_64: C++ support for gcc version 4.4gcc44-gfortran.x86_64: fortran support for gcc 4.4

6. Install gcc

[root@localhost yum.repos.d] # yum-y install gcc on "after installing linux redhat cannot use the yum command to install gcc-c++ how to solve", thank you for reading here. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Tags: Commands knowledge industries processes problems caches differences utility content practicality practice documents articles methods more cases knowledge points articles caches information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia OPPO Reno Docker MySQL Shulou Technology