Get the App
SLTechnology News&Howtos  ›  Servers  › 

Usage of local yum for Linux server

Shulou Source: shulou.com Published: 2022-06-01 12:51:05 09月17日 Update

This article mainly explains "the usage of local yum on Linux server". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "Linux server local yum usage" bar!

Local yum

Local yum enables quick installation of various packages to avoid a long download process

1. Find an installation package of centos and mount it in the system

[root@localhost] # mount-t iso9660-loop centos-i386.iso / mnt

2. Copy all the contents to a specified folder, such as "/ wj/centos-img/"

[root@localhost ~] # mkdir / wj/centos-img

[root@localhost ~] # cp / mnt / wj/centos-img

3. The configuration directory "/ etc/yum.repos.d" of the redirected yum

[root@localhost ~] # cd / etc/yum.repos.d/

[root@localhost yum.repos.d] # ls

CentOS-Base.repo CentOS-Media.repo

CentOS-Debuginfo.repo CentOS-Vault.repo

4. Back up all the configuration files in the configuration directory

[root@localhost yum.repos.d] # cp CentOS-Base.repo CentOS-Base.repo.bak

[root@localhost yum.repos.d] # mv CentOS-Media.repo CentOS-Media.repo.bak

[root@localhost yum.repos.d] # mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak

[root@localhost yum.repos.d] # mv CentOS-Vault.repo CentOS-Vault.repo.bak

5. Edit one of the configuration files, which is CentOS-Base.repo.

[root@localhost yum.repos.d] # vi CentOS-Base.repo

[base]

Name=CentOS-Base

The sentence # mirrorlist= http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os is preceded by #, which is equivalent to commenting out

Baseurl= file:///wj/centos-img/ here is the path to the centos package, which has been copied to / wj/centos-img

Gpgcheck=1

Gpgkey= file:///wj/centos-img/RPM-GPG-KEY-CentOS-6, notice that the path here has changed, too.

Enable=1 here is 1, which represents the current configuration of the enable

6. Clear the cache of yum

[root@localhost ~] # yum clean metadata

[root@localhost ~] # yum clean all

7. Test to see whether the current yum configuration is successful

[root@localhost ~] # yum list

. . .

Seahorse-plugins.i686 2.28.1-2.el6 base

Seekwatcher.noarch 0.12-5.el6 base

Selinux-policy-doc.noarch 3.7.19-231.el6 base

Selinux-policy-minimum.noarch 3.7.19-231.el6 base

. . .

At this point, I believe you have a deeper understanding of "the use of local yum on Linux servers". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Configuration server service content file copy directory path learning practical deeper long successful representative interest backup practicality practical simple operation folder Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Information Xiaomi Redmi Shulou Tech Info