I explained in the previous article that I only know the Yum package systematically because I want to be a source of my own. I'll go over the details and write it down.
I use the Linux distribution is CentOS (super like, recommend everyone to use), download the image is two DVDs, because I have limited time on the Internet, but the internet is very fast, so decided to download a huge volume of DVD two, of course, if only installed, as long as the DVD1 on the line, But for the convenience of installing the software later, I downloaded all two DVDs and made the two DVDs my own local source.
First, install the Createrepo
There are two kinds of situations, one is the installation can not be able to network (I am this, the Internet to go to other places), one is able to network.
(1) can use the external network, direct
$yum Install Createrepo
it's all right.
(2) Not able to use the external network, you can use the installation of the DVD, the first copy of the DVD1 to the file system, I copied to the/root (just installed, have not created another user),
$mkdir/media/cdrom "to create a mount directory, it is best not to change it, which will be mentioned later
$mount-tiso9660-oloop Centos-6.3-i386-bin-dvd1.iso/media/cdrom "Mount Image
$mkdir/etc/yum.repos.d/bak "To create a backup folder
$mv/etc/yum.repos.d/*.repo/etc/yum.repos.d/bak "Backup source
$CP/etc/yum.repos.d/bak/centos-media.repo/etc/yum.repos.d/"Take out the source we need to modify,
$vi/etc/yum.repos.d/centos-media.repo "Edit the source we want to modify
change the "enabled=0" inside to "enable=1 "
$yum makecache "Update yum cache
$yum Install Createrepo "installation package
here Createrepo installed and can be used, we modified the Centos-media.repo BASEUSL path is we can speak DVD1 mount the path, mount to other places to be modified.
Second, create your own source
next we want to create our source, I want to use the package is DVD1 and DVD2 in the package, the two packages contain common software packages, now from I set up a local source, I did not download any package from the network, that is, the two DVDs of a lot of packages, enough for us to use, Of course, except for updates. I remember as if more than 4,700 packages total. The first thing to do is to copy the package of two DVDs into a folder, that is, we want to wear the source of the folder, I created the source under/usr/local/repository.
$mkdir/usr/local/repository "Create a source folder
$CP-R/media/cdrom/packages//usr/local/repository "copy the DVD1 package file to the source folder
$umount/media/cdrom "Uninstall DVD1
$mount centos-6.3-i386-bin-dvd2.iso/media/cdrom "Mount DVD2
$cp-ur/media/cdrom/packages//usr/local/repository "Copy DVD2
$createrepo/usr/local/repository "Building a source
$MV/etc/yum.repos.d/centos-media.repo/etc/yum.repos.d/centos-local.repo "Modify the configuration file
$vi/etc/yum.repos.d/centos-local.repo
the modifications are as follows:
[centos-local]
name=localrepository
baseusr=file:///usr/local/repository
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6
$yum makecache "Update Cache
$yum Install vim-enhanced "Installation test package, where you can install the package you want
$umount/media/cdrom "Uninstall DVD2
here, our local source has been configured, and if we have a separate package required, you can download to/usr/local/repository/packages below, and then perform the Createrepo--update command update.
This article is from the "lake and Laughter" blog, reproduced please contact the author!
Createrepo Use (iii)