Pages

Thursday, August 14, 2014

How to create local repositoy RHEL 6

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 :
  1. Install the createrepo package:
  2. Copy all of the packages into one directory, such as /home/choirul/local_repo/ 
  3. Run the createrepo --database command on that directory:
    createrepo --database /home/choirul/local_repo
  4. 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
  5. update yum with command
    yum clean all
    yum update
    yum list
  6. You can find file RPM-GPG-KEY-release in root directory of RHEL DVD
The above step is for repository that locate in folder. Beside, we also can create repositoy using iso file. Here are the steps :
  1. create mount point for repository :
    mkdir -p /path/to/repo
  2. 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
  3. 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
  4. Choose a name for the repo file and open it as a new file
    vi /etc/yum.repos.d/dvd.repo
  5. 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
    
  6. update yum
If for some reasons you need to install library, you can use command yum whatprovides [library_name] as below:
[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

Don't Forget To Join Our Community
×
Widget