From now, you can download RedHat enterprise Linux at no cost for developers !

I did that, but right now, I unfortunately have no any valid subscription, and I’m not able to download any RPM :

[root@redhat ~]# yum update
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>

Copy RPMs from the ISO image

Mount the ISO image

Using vSphere Client :

createrepo

 

 

 

 

 

 

createrepo1

 

 

 

 

 

 

 

 

 

 

 

Mount this ISO image within your virtual machine :

[root@redhat ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only

And copy files to a directory :

[root@redhat ~]# mkdir /RPMs && cp /mnt/Packages/*.rpm /RPMs/.

Release the ISO image

Umount the virtual CDROM :

[root@redhat RPMs]# umount /mnt

Using vSphere Client :

rhel vmware tools2

 

 

 

 

 

 

 

 

 

 

Create the repository

Install “createrepo” package :

[root@redhat ~]# cd /RPMs && rpm -ivh createrepo* deltarpm* python-deltarpm*

Then launch “createrepo” command :

[root@redhat RPMs]# createrepo --database /RPMs
Spawning worker 0 with 2310 pkgs
Spawning worker 1 with 2310 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

Install “yum-utils” package :

[root@redhat RPMs]# rpm -ivh yum-utils* python-kitchen* python-chardet*

Add local (file) repository for yum :

[root@redhat RPMs]# yum-config-manager --add-repo file:///RPMs
Loaded plugins: product-id
adding repo from: file:///RPMs

[RPMs]
name=added from: file:///RPMs
baseurl=file:///RPMs
enabled=1

This file has been created for you :

[root@redhat RPMs]# cat /etc/yum.repos.d/RPMs.repo

[RPMs]
name=added from: file:///RPMs
baseurl=file:///RPMs
enabled=1

This local repos is now ready

You can install “perl” for example :

  • Is perl available in my repo ?
[root@redhat RPMs]# yum --disablerepo="*" --enablerepo="RPMs" provides perl
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
4:perl-5.16.3-286.el7.x86_64 : Practical Extraction and Report Language
Repo        : RPMs
  • Yes : install it !
[root@redhat RPMs]# yum -y --disablerepo="*" --enablerepo="RPMs" --nogpgcheck install perl-5.16.3-286.el7.x86_64

 

 

en.pdf24.org    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


*