Hot search terms: 360 Security Guard Office365 360 browser WPS Office iQiyi Huawei Cloud Market Tencent Cloud Store
operating system Storage size: 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 software in the DVD. The default yum is based on the network To install, when there is no network or the network speed is not good, it is very painful to install the 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 turn off 360 recommendations in 360 Safe Browser? -360 Safe Browser closes 360 recommended methods
How to speed up 360 Secure Browser? -360 secure browser acceleration method
How to enable the boss button in 360 Secure Browser? -How to enable the boss button in 360 Secure Browser
How to log in to 360 Secure Browser? -How to log in to 360 secure browser
How to set up safe decompression of files in 360 Secure Browser? -How to set up safe decompression of files in 360 Secure Browser
What to do if there is no sound after reinstalling the computer system - Driver Wizard Tutorial
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
How to change QQ music skin? -QQ music skin change method
Driver President Download-How to solve the problem when downloading driver software is very slow