When installing and updating software online using the Yum tool in a Linux host, it is often not possible to upgrade or install the software due to network instability or a mid-line outage, and the local Yum source does not need to be bothered because its resources are stored locally and are not subject to Internet network restrictions. So as to improve the efficiency of software update in LAN
First, hang on the disc image
[[email protected]/]# mkdir/mnt/cdrom[[email protected]/]# mount-r/dev/cdrom/mnt/cdrom[[email protected]/]# mount/d Ev/mapper/vg0-root on/type ext4 (rw) proc On/proc type proc (rw) Sysfs On/sys type SYSFS (rw) devpts on/dev/pts type dev PTS (rw,gid=5,mode=620) Tmpfs on/dev/shm type TMPFS (rw)/dev/sda1 on/boot type EXT4 (rw)/dev/mapper/vg0-usr on/usr type EXT4 (rw)/dev/mapper/vg0-var On/var type EXT4 (rw) None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)/dev/sr0 on/mnt/ CDROM type iso9660 (RO) [[email protected]/]#
Second, create a local directory/yum, and then copy the files from the CD to this directory
[[email protected] /]# mkdir /yum[[email protected] /]# cp -r / Mnt/cdrom/* /yum[[email protected] yum]# ls /yumcentos_buildtag isolinux rpm-gpg-key-centos-debug-6efi Packages RPM-GPG-KEY-CentOS-Security-6EULA RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-Testing-6GPL repodata trans. tblimages rpm-gpg-key-centos-6
Iii. new Yum Repo configuration file
---------Repo File---------------------------
[Repositoryid]
# for the current system of Yum, this Repositoryid is used to uniquely identify this repository point, so it must be unique;
Name=
# current warehouse description information;
baseurl=url://path/to/repository/
# indicates the access path of the repository, usually a repository that is output on a file server;
Url:
FTP Service
Ftp://SERVER/PATH/TO/REPOSITORY
HTTP Service
Http://SERVER/PATH/TO/REPOSITORY
Local directory:
File:///PATH/TO/REPOSTIROY
Enabled={1|0}
Whether this warehouse can be used
Gpgcheck={1|0}
Whether to validate the package
Gpgkey=url://path/to/keyfile
Indicates the path to the Gpgkey file;
cost=#
Indicates the current repository access cost, which defaults to 1000;
-------------------------------------
[Email protected]/]# Vim/etc/yum.repos.d/cd-local.repo[cd-local]name=centos 6.6 x86_64 on dvd1baseurl=file:/// yumgpgcheck=0enabled=1~
Iv. clear and delete records and view the configuration of the Yum source
Clear Records
[email protected]/]# Yum clean allloaded plugins:fastestmirror, Refresh-packagekit, securitycleaning REPOS:CD-LOCALCL Eaning up everythingcleaning up list of fastest mirrors
Delete on record
[Email protected]/]# Rm-rf/var/cache/yum/*[[email protected]/]#
View Yum Configuration
[[email protected] yum]# yum repolistloaded plugins: fastestmirror, refresh-packagekit, securityloading mirror speeds from cached hostfilerepo id repo name statusCD-Local CentOS 6.6 X86_64 on dvd1 6,518repolist: 6,518
Now that our local Yum source has been built,
To verify that the Yum source we made with the release disc is available, we then use our locally built Yum source to install the ZSH software
1, first we check whether the machine has installed the ZSH software
[Email protected]/]# rpm-qa zsh[[email protected]/]#
Found and not installed
2. Install zsh using local Yum source
[[email protected] /]# yum install zshloaded plugins: fastestmirror, Refresh-packagekit, securitysetting up install processloading mirror speeds from cached hostfileResolving Dependencies--> Running transaction Check---> Package zsh.x86_64 0:4.3.10-7.el6 will be installed--> finished dependency resolutiondependencies resolved============================================ ======================================================================================== package Arch Version repository size============================================================================ ========================================================installing: zsh x86_64 4.3.10-7.el6 CD-Local 2.1 mtransaction summary========================================================================= ===========================================================install 1 package (s) total download size: 2.1 minstalled size: 4.8 mis this ok [y/n]: y //input y Confirm installation Downloading packages:running rpm_ Check_debugrunning transaction testtransaction test succeededrunning transaction Installing : zsh-4.3.10-7.el6.x86_64 1/1 verifying : zsh-4.3.10-7.el6.x86_64 1/ 1 installed: zsh.x86_64 0:4.3.10-7.el6 complete!
Shows that the installation is complete
Verify that the installation is complete:
[Email protected] yum]# Cat/etc/shells/bin/sh/bin/bash/sbin/nologin/bin/dash/bin/tcsh/bin/csh/bin/zsh[[email Protected]/]# Rpm-qa zshzsh-4.3.10-7.el6.x86_64[[email protected]/]#
OK so we've built the local Yum source created with the release disc.
This article is from the "impermanence" blog, please be sure to keep this source http://1inux.blog.51cto.com/10037358/1630801
Using the release CD to build a local Yum source