As in the post How to create local repositoy SLES 10 we also can do the same thing on RHEL (Redhat Enterprise Linux) 6 using yum. Here are the steps :
- Install the
createrepo
package: - Copy all of the packages into one directory, such as /home/choirul/local_repo/
- Run the
createrepo --database
command on that directory:createrepo --database /home/choirul/local_repo
- Create a new file in /etc/yum.repos.d, with the following contents:
# cat /etc/yum.repos.d/local.repo [local] name=Repository from DVD baseurl=file:/home/choirul/local_repo/ enabled=1 gpgcheck=1 gpgkey=file:/home/choirul/local_repo/RPM-GPG-KEY-release
- update yum with command
yum clean all yum update yum list
- You can find file RPM-GPG-KEY-release in root directory of RHEL DVD
- create mount point for repository :
mkdir -p /path/to/repo
- Mount iso file on the mount point that you just created
mount -r -t iso9660 -o loop /path/to/image/file.iso /path/to/repo
- If you use your cd/dvd drive, you must know where is your drive located. To know that see Linux Sysinfo command. Use this command to mount your drive
mount -r -t iso9660 /dev/device_name /path/to/repo
- Choose a name for the repo file and open it as a new file
vi /etc/yum.repos.d/dvd.repo
- Supply the details of the repository. For example:
[dvd] name=ISO baseurl=file:///mnt/repo/Server enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
- update yum
[root@short Downloads]# yum whatprovides libQtGui.so.4 Loaded plugins: presto, refresh-packagekit 1:qt-x11-4.5.3-7.fc12.i686 : Qt GUI-related libraries Repo : fedora Matched from: Other : libQtGui.so.4 [root@short Downloads]# yum install qt-x11-4.5.3-7.fc12.i686
No comments:
Post a Comment