Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Usage of local yum for Linux server

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report