Not able to install or update packages using Yum Local respository

yum

I have a Red hat 6.2 server which is in an isolated env which i need to update using Yum. I tried downloading the 51 GB reository from ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/ (which is the default URL as per default yum repo files) and conducted the below steps.

  1. Deleted all repositories under /etc/yum.repos.d
  2. Created a new repo file with below information

    [localrepo]
    name=LocalRepository
    baseurl=file:///YUMREPO/SRPMS/Packages<BR>
    gpgcheck=0
    enabled=1
    

When i execute yum update, for the first time it is downloading the repository db properly however it is not updating anything new. When i try installing any other package e.g. vsftpd it fails to install as well mentioning the package not found, but the rpm files are present in the folder which i configured as repository.

# yum install vsftpd

Loaded plugins: product-id, security, subscription-manager<BR>
Updating certificate-based repositories.<BR>
Setting up Install Process<BR>
No package vsftpd available.<BR>
Error: Nothing to do<BR>

# ls -ltr /YUMREPO/SRPMS/Packages/vsftpd

-rw-r--r-- 1 root root 238016 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-11.el6.src.rpm
-rw-r--r-- 1 root root 239565 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-11.el6_4.1.src.rpm
-rw-r--r-- 1 root root 239801 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-12.el6_5.1.src.rpm
-rw-r--r-- 1 root root 240907 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-13.el6_6.1.src.rpm
-rw-r--r-- 1 root root 229354 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-6.el6.src.rpm<BR>
-rw-r--r-- 1 root root 242118 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-14.el6.src.rpm<BR>
-rw-r--r-- 1 root root 243417 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-14.el6_7.1.src.rpm<BR>
-rw-r--r-- 1 root root 230778 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-6.el6_0.1.src.rpm<BR>
-rw-r--r-- 1 root root 231280 Apr 14 08:18 /YUMREPO/SRPMS/Packages/vsftpd-2.2.2-6.el6_2.1.src.rpm<BR>

I have already tried using createrepo and createrepo -d (for sqllite db) but nothing works. Yum is not able to install any of the RPMs available in the folder.

When I do a repolist, the repository details are shown but Repo-pkgs and Repo-size are zero while the count shown under Repo-exculded is same as the number of rpm files in the repository directory.

# yum -v repolist

Not loading "rhnplugin" plugin, as it is disabled<BR>
Loading "product-id" plugin<BR>
Loading "security" plugin<BR>
Loading "subscription-manager" plugin<BR>
Updating certificate-based repositories.<BR>
Config time: 0.036<BR>
Yum Version: 3.2.29<BR>
Setting up Package Sacks<BR>
pkgsack time: 0.006<BR>
Repo-id      : localrepo<BR>
Repo-name    : LocalRepository<BR>
Repo-revision: 1460764382<BR>
Repo-updated : Sat Apr 16 08:13:29 2016<BR>
**Repo-pkgs    : 0<BR>
Repo-size    : 0<BR>**
Repo-baseurl : file:///YUMREPO/SRPMS/Packages<BR>
Repo-expire  : 21,600 second(s) (last: Sat Apr 16 08:13:41 2016)<BR>
**Repo-excluded: 6,575**<BR>

I want to just configure the YUM repository for updating the packages and install new components. Due to security concerns CD and access to internet or any other network is blocked. In such isolated network, we can only use authorized USB disks to copy the RPM packages. /YUMREPO is the mount location of the USB disk that is being used.

Best Answer

The ftp location that you refer to only contains sources to be re-compiled. Red Hat does not publish compiled updates, because you need to pay for them. That's their business model.

You can use CentOS systems. Or better pay Red Hat support fee for all the isolated systems (they actively develop Open Source projects, so giving them money is a Good Thing), install a separate system able to connect to Internet, subscribe the system to Red Hat and use the system to download the rpm files to the USB storage (not the src.rpm files!). The instructions how to subscribe will be available from Red Hat.