CentOS source in the DVD as the default setting method yum

Yum is the default network installation, in the absence of network speed or poor circumstances, to install the software via yum opinion is a very painful thing, in fact, for CentOS DVD, software which provides sufficient to meet our needed, and the DVD version of the software is stable version, download speed faster, learning CentOS, the DVD will be used as the default CentOS yum source can greatly improve learning efficiency.

1, DVD to create a directory to mount

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

2, Mount CentOS DVD under Linux (virtual machine mount DVD did not say, should be able)

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

3, view the configuration file, directory

[root@localhost ~]# ls -l /etc/yum.repos.d/
-rw-r--r--. 1 root root 1926  7月  3 10:15 CentOS-Base.repo
-rw-r--r--. 1 root root  637  7月  3 10:15 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  626  7月  3 10:15 CentOS-Media.repo

4, disable the network yum update mode, simply default choice of CentOS-Base.repo renamed to CentOS-Base.repo.bak

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

5, configure the local source yum

[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

change into

[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
gpgcheck=1
enabled=1

Which baseurl modify the DVD mount directory, enabled = 1 to open a local update mode

: Wq save and exit

6, clear the existing yum information

[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything

7, check the list of DVD software

[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 ...

Use this DVD to install the software later on by default, if you want to restore the network installation mode, the CentOS-Base.repo.bak reduction can be renamed.

PS. After each reboot the system need to manually mount the DVD to / media / CentOS /, if you can be bothered to write their own scripts automatically mount.

RedHat 6.2 Linux free to modify the source CentOS yum source http://www.linuxidc.com/Linux/2013-07/87383.htm

Configuring EPEL YUM source http://www.linuxidc.com/Linux/2012-10/71850.htm

Redhat yum local source configuration http://www.linuxidc.com/Linux/2012-11/75127.htm

yum profile comments http://www.linuxidc.com/Linux/2013-04/83298.htm

Yum install under RedHat 6.1 (graphic) http://www.linuxidc.com/Linux/2013-06/86535.htm

YUM installation and cleaning http://www.linuxidc.com/Linux/2013-07/87163.htm

Building a local source yum 6.4 on the CentOS http://www.linuxidc.com/Linux/2014-07/104533.htm

For more information, see CentOS CentOS topic page http://www.linuxidc.com/topicnews.aspx?tid=14

Original articles published 0 · won praise 27 · views 80000 +

Guess you like

Origin blog.csdn.net/yimenglin/article/details/103006687