First, the preparatory work
1. Insert the Linux installation disk into the optical drive
2. Mount the optical drive
[Email protected] ~]# mount/dev/cdrom/mnt/
Mount:block Device/dev/sr0 is write-protected, mounting read-only
If the optical drive does not have a disc inserted, the ISO image can be copied to the server load: mount-t iso9660-o loop/soft/oraclelinux-r6-u1-server-x86_64-dvd.iso/mnt
[Email protected] ~]#
3. Install the CREATEREPO package---> This is a tool to resolve dependencies
[Email protected] ~]# cd/mnt/packages/
[Email protected] packages]# RPM-IVH createrepo-0.9.8-4.el6.noarch.rpm
Warning:createrepo-0.9.8-4.el6.noarch.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey
error:failed dependencies:
PYTHON-DELTARPM is needed by Createrepo-0.9.8-4.el6.noarch
[Email protected] packages]# RPM-IVH python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
Warning:python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey
error:failed dependencies:
deltarpm = 3.5-0.5.20090913git.el6 is needed by python-deltarpm-3.5-0.5.20090913git.el6.x86_64
[Email protected] packages]# RPM-IVH deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
Warning:deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey
Preparing ... ########################################### [100%]
1:deltarpm ########################################### [100%]
[Email protected] packages]# RPM-IVH python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
Warning:python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey
Preparing ... ########################################### [100%]
1:python-deltarpm ########################################### [100%]
[Email protected] packages]# RPM-IVH createrepo-0.9.8-4.el6.noarch.rpm
Warning:createrepo-0.9.9-17.el6.noarch.rpm:header V3 rsa/sha256 Signature, key ID Fd431d51:nokey
Preparing ... ########################################### [100%]
1:createrepo ########################################### [100%]
[Email protected] packages]#
4. Copy the RPM package from the optical drive into the system and create the corresponding directory
[Email protected] packages]# mkdir-pv/var/ftp/pub
mkdir:created directory '/var/ftp '
mkdir:created directory '/var/ftp/pub '
[Email protected] packages]# cp-r/mnt/packages/var/ftp/pub/
Note: I do not have this step here
Second, start to build Yum
1. Build dependencies
[Email protected] packages]# createrepo-g/mnt/repodata/ cda5429be6f36ce1348e8f897f4fc96aa00d5727c75e9e5a0b5dc40d22a51116-comps-ol6-server.xml/var/ftp/pub/packages/
Spawning worker 0 with 3720 pkgs
Workers finished
Gathering worker Results
Saving Primary Metadata
Saving file lists Metadata
Saving other metadata
Generating SQLite DBs
Sqlite DBs Complete
Note: I do not do this step here, and finally can. I don't know if this step is necessary.
2. Edit the Yum warehouse configuration file
[Email protected] ~]# cd/etc/yum.repos.d/
[Email protected] yum.repos.d]# VI Local.repo
[Myyum]
Name=olinux Myyum
Baseurl=file:///mnt/server
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-oracle
3. When the local Yum is installed, the test is ready to use
[email protected] yum.repos.d]# Yum grouplist
Loaded Plugins:product-id, Refresh-packagekit, security, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Setting up Group Process
Myyum | 3.8 KB 00:00 ...
myyum/primary_db | 3.1 MB 00:00 ...
Myyum/group_gz | 204 KB 00:00 ...
Installed Groups:
Additional Development
Base
Debugging Tools
Desktop
Desktop Debugging and Performance Tools
Desktop Platform
Dial-up Networking Support
Directory Client
Network File System Client
Assamese support [as]
Available Language Groups:
Afrikaans support [AF]
Albanian support [Sq]
Amazigh support [BER]
Azerbaijani support [AZ]
Ukrainian support [UK]
Upper Sorbian support [HSB]
Uzbek support [UZ]
Vietnamese support [VI]
Walloon support [WA]
WELSH support [CY]
Xhosa support [XH]
Zulu support [zu]
Done
[Email protected] yum.repos.d]#
Ok!!!
Recommended reading:
RedHat configuration of the local Yum source for Linux http://www.linuxidc.com/Linux/2013-08/88217.htm
RedHat 6.2 Linux Modified Yum source free use of CentOS source http://www.linuxidc.com/Linux/2013-07/87383.htm
Configuring Epel Yum Source http://www.linuxidc.com/Linux/2012-10/71850.htm
Redhat local Yum Source configuration http://www.linuxidc.com/Linux/2012-11/75127.htm
Yum configuration file Description http://www.linuxidc.com/Linux/2013-04/83298.htm
RedHat 6.1 Install yum (graphic) http://www.linuxidc.com/Linux/2013-06/86535.htm
YUM Installation and Cleanup http://www.linuxidc.com/Linux/2013-07/87163.htm
Oracle linux6.1 Configuring Yum Local source