Install yum on Linux, the steps are super detailed, a guide for Linux beginners

I have been searching for a long time to find out how to install yum. I couldn’t find the detailed operation method
. I will ask you to install this, and then I will ask you to install that. After installing it, I found that you still need yum to install.
Some of them require you to install python.
Today, I will let you solve your problem in one step. .

yum installation:

1. Install the build-essential package

Provides a list of packages required for compilation. The build-essential package contains many necessary software packages for development. If you install a build-essential package, many packages corresponding to C/C++ dependencies will be installed.

apt-cache depends build-essential

After the installation is complete, you can try to install yum

2. Preliminary attempt to install yum

sudo apt-get install yum

The following prompt may appear:

Insert image description here

This means that the software package cannot be located, and the solution is to modify the software source image. Methods as below:

Solve the problem:

cd /etc/apt/    #切换到apt目录下
sudo cp sources.list sources.list.old    #把原来的sources.list文件备份一下
sudo vim sources.list    #编辑sources.list

Let me tell you a simple way to use vim. If you know it, you can go directly to the next step:
After entering vim, press "i" to enter the editing mode, press "Esc" to exit the editing mode, and press ":wq" to save and exit.
Open the sources.list file for editing and add the following content at the end of the file (you can copy it in at once):

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

Then update the software source:

sudo apt-get update

After the update is completed, enter the yum installation command again:

sudo apt-get install yum

If the installation is successful, jump directly to installing the yum network source. If there is no such error, let's solve it together:

Insert image description here

The underlined part in the red box is a reminder of the missing content in the current installation of yum. The missing content may be different for everyone. Don’t worry at this time, we will install the missing content directly: (The installation content is vaguely installed according to your own Linux prompts)

#输入需要安装的文件名#
sudo apt-get install #文件名#
#例如:
sudo apt-get install python-libxmls

After the installation is complete, try installing yum again:

sudo apt-get install yum

If there are still missing content files, you can continue to install the missing content files, and then try to install yum again. It will definitely succeed.
So when is success? That is when there is no prompt after entering the yum installation command.

The last step of the title is to configure the yum network source:

cd /etc/yum/repos.d/
sudo wget http://mirrors.163.com/.help/fedora-163.repo
sudo wget http://mirrors.163.com/.help/fedora-updates-163.repo

Then edit the two network source addresses you just downloaded under /etc/yum/repos.d/: (replace all the "$releasever" characters that can be seen in the file with "17") and save them.

vim fedora-163.repo
vim fedora-updates-163.repo

Then cache it with the following command:

sudo yum makecache

Tip: If the content that is not in the network source is not completely replaced, an error will be reported.
If the following screen appears, your yum is complete. Congratulations:

Insert image description here

Guess you like

Origin blog.csdn.net/chenchao0932/article/details/131360597