Hot search terms: 360 Security Guard Office365 360 browser WPS Office iQiyi Huawei Cloud Market Tencent Cloud Store
operating system Storage: 921MB Time: 2022-05-25
Software introduction: CentOS is currently the most popular and widely used Linux operating system. Compared with other Linux distributions, its stability is trustworthy...
We all know that yum is the software package manager in the CentOS system, used for downloading and installing software. Sometimes for some reasons, DVD needs to be used as the default yum source to download and install the software in the DVD. The default yum is installed over the network. When there is no network or the network speed is not good, it is very painful to install software through yum. The editor below will introduce to you how to create a DVD as the default yum source in CentOS.

1. Create a mounting directory for the DVD
[root@localhost ~]# mkdir /media/CentOS
2. Mount CentOS DVD under Linux (not to mention mounting DVD on virtual machine, it should be possible)
[root@localhost ~]# mount -t auto /dev/cdrom /media/CentOS
3. View the relevant configuration files, 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 yum's network update method and simply rename 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 local yum source
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Media.repo
will
[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
The baseurl is changed to the mounting directory of the DVD, and enabled=1 turns on the local update mode.
:wq Save and exit
6. Clear the original yum information
[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
7. Check 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.3 MB 00:00 . . .
In this way, the DVD installation software will be used by default in the future. If you want to restore the network installation mode, just rename CentOS-Base.repo.bak and restore it.
PS. You need to manually mount the DVD to /media/CentOS/ every time you restart the system. If you find it troublesome, you can write your own script to mount it automatically.
The above is the editor's summary of how to set DVD as yum source in CentOS. Setting it can speed up the download speed of software in DVD, but if you want to download from the Internet, you need to set it back again.
How to mirror symmetry in coreldraw - How to mirror symmetry in coreldraw
How to set automatic line wrapping in coreldraw - How to set automatic line wrapping in coreldraw
How to draw symmetrical graphics in coreldraw - How to draw symmetrical graphics in coreldraw
How to copy a rectangle in coreldraw - How to draw a copied rectangle in coreldraw
How to separate text from the background in coreldraw - How to separate text from the background in coreldraw
Eggman Party
WPS Office 2023
WPS Office
Minecraft PCL2 Launcher
WeGame
Tencent Video
Steam
CS1.6 pure version
Office 365
What to do if there is no sound after reinstalling the computer system - Driver Wizard Tutorial
How to switch accounts in WPS Office 2019-How to switch accounts in WPS Office 2019
How to clear the cache of Google Chrome - How to clear the cache of Google Chrome
How to practice typing with Kingsoft Typing Guide - How to practice typing with Kingsoft Typing Guide
How to upgrade the bootcamp driver? How to upgrade the bootcamp driver