SungHoon_Kim

Configuring yum repository from local media (offline)

Blog Post created by SungHoon_Kim Employee on Sep 29, 2015

This is going to make things very convenient when you need to install packages and you cannot find the ISO or the install media.

Or, when you want to install a package but there are dependencies and you cannot figure out which one to install first.

YUM makes it very easy. But what if your server do not have internet access?

 

Mount the OS ISO file.

Create "/apps/repository" folder.

Copy "<DVD>/repodata" and "<DVD>/Packages" to /apps/repository

Copy "<DVD>/media.repo" to "/etc/yum.repos.d" folder.

Update the  "/etc/yum.repos.d/media.repo" file as below.

You can unmount the ISO and will not need it anymore for installing packages.

 

Add lines below.

baseurl=file:///apps/repository/

enabled=1

 

It will look like below.

[InstallMedia]

name=Red Hat Enterprise Linux 6.1

mediaid=1305068199.328169

baseurl=file:///apps/repository/

enabled=1

metadata_expire=-1

gpgcheck=0

cost=500

 

Make this media.repo file read-only.

 

Then run "yum repolist"

It will return the following

 

[root@rhel61 Desktop]# yum repolist

Loaded plugins: product-id, refresh-packagekit, subscription-manager

Updating Red Hat repositories.

repo id                          repo name                                               status

InstallMedia               Red Hat Enterprise Linux 6.1                3,480

Repolist: 3,480

Outcomes