Home > Article > Operation and Maintenance > What should I do if the yum command cannot be used in Linux?
Solution: 1. Install Centos image for linux redhat, and use "mv repo file" to replace "$releasever" in the repo file; 2. Clear all caches and use "yum makecache" to obtain yum List; 3. Use "yum -y install gcc" to install gcc.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
[root@localhost ~]# yum -y install gccLoaded 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
For people who are used to using CentOS, it is a torture to not be able to use this command
Solution process:
1. Install the Centos image for linux redhat
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#$releasever#6#g' ./CentOS6-Base-163.repo
2. Clear all caches
[root@localhost yum.repos.d]# yum clean all Loaded plugins: katello, product-id, security, subscription-manager Updating certificate-based repositories. Unable to read consumer identity Cleaning up Everything
Get the yum list
3. Search and install
Install gcc
[root@localhost yum.repos.d]# yum -y install gcc
At this point, the gcc installation is completed, and for other The compilation environment can also be installed using yum.
Recommended learning: Linux video tutorial
The above is the detailed content of What should I do if the yum command cannot be used in Linux?. For more information, please follow other related articles on the PHP Chinese website!