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

How to use DVD as the default yum source in CentOS

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

Share

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

This article focuses on "how to use DVD as the default yum source in CentOS". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use DVD as the default yum source in CentOS.

In fact, for CentOS DVD, the software provided inside is enough to meet our needs, and the software version in DVD is stable, and the download speed is fast. For learning CentOS, using CentOS DVD as the default yum source can greatly improve learning efficiency.

1. Create a mount directory for DVD

[root@localhost ~] # mkdir / media/CentOS

2. Mount CentOS DVD under Linux (virtual machine mount DVD should be able to do so)

[root@localhost] # mount-t auto / dev/cdrom / media/CentOS

3. View the relevant configuration files, and the directory is

[root@localhost ~] # ls-l / etc/yum.repos.d/

-rw-r--r--. 1 root root 1926 July 3 10:15 CentOS-Base.repo

-rw-r--r--. 1 root root 637 July 3 10:15 CentOS-Debuginfo.repo

-rw-r--r--. 1 root root 626 July 3 10:15 CentOS-Media.repo

4. Disable the network update method of yum, and simply change the default preferred CentOS-Base.repo to CentOS-Base.repo.bak.

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

5. Configure the local yum source

[root@localhost ~] # vim / etc/yum.repos.d/CentOS-Media.repo

Set

[c6-media]

Name=CentOS-$releasever-Media

Baseurl= file:///media/CentOS/

File:///media/cdrom/

File:///media/cdrecorder/

Gpgcheck=1

Enabled=0

Modify to

[c6-media]

Name=CentOS-$releasever-Media

Baseurl= file:///media/CentOS/

Gpgcheck=1

Enabled=1

Baseurl is modified to the mount directory of DVD, and enabled=1 is enabled for local update mode.

Wq save exit

6. Clear the original yum information

[root@localhost ~] # yum clean all

Loaded plugins: fastestmirror

Cleaning up Everything

7. Check the DVD software list

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

Loaded plugins: fastestmirror

Determining fastest mirrors

C6-media | 3.7 kB 00:00...

C6-media/primary_db | 3.3MB 00:00...

In this way, you will use DVD to install the software by default. If you want to restore the network installation mode, you can restore CentOS-Base.repo.bak by renaming it.

At this point, I believe you have a deeper understanding of "how to use DVD as the default yum source in CentOS". 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