Home > Operation and Maintenance > Linux Operation and Maintenance > What should I do if the yum command cannot be used in Linux?

What should I do if the yum command cannot be used in Linux?

WBOY
Release: 2022-08-11 16:48:10
Original
11686 people have browsed it

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.

What should I do if the yum command cannot be used in Linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What to do if the yum command cannot be used in Linux

 [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
Copy after login

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

What should I do if the yum command cannot be used in Linux?

Modify the repo file

[root@localhost~]# mv CentOS6-Base-163.repo /etc/yum.repos.d/
Copy after login

*** Replace $releasever with 6

[root@localhost yum.repos.d]# sed -i 's#$releasever#6#g' ./CentOS6-Base-163.repo
Copy after login

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
Copy after login

Get the yum list

What should I do if the yum command cannot be used in Linux?

3. Search and install

What should I do if the yum command cannot be used in Linux?

Install gcc

[root@localhost yum.repos.d]# yum -y install gcc
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template