Step by Step Enable Install Software Package from CentOS DVD

 

Step by Step Enable Install Software Package from CentOS DVD.

 

   The article below show step by step how to enable install software package from CentOS DVD and example on using the Add Remove Package Manager and yum package manager to install the software package on CentOS system.  The Add Remove Software Package Manager by default use the repos from the internet as software packages source to enable software package installation and update.  The Add Remove Software Package Manager, yum update and yum install command not going to work properly when your CentOS sever or CentOS desktop not connected to the internet.  No use trying to use these tools (Add/Remove Software Package and yum package manager) to install or update software package on CentOS without internet connection. The step by step below show how to configure the CentOS to use the Installation DVD as source of software package installation, so that you can install software package from the CentOS DVD media... but please be aware that you still need internet connection to make sure your CentOs system is up to date.

 

Enable Add/Remove Software Package and yum to use installation DVD as source of software installation.

 

1.  To make CentOS to use DVD as source of package installation, we need to edit certain configuration file... so to make life little bit easier... just login as root user on CentOS graphical Desktop

 

2.  Insert the CentOS installation DVD inside the DVD drive, let the CentOS auto mount the DVD drive... or click on the the DVD drive icon that you can find when you click on computer icon on the Desktop.  Note, the figure below show example of CentOS installation DVD icon on Desktop that show the CentOS installation DVD mounted as CentOS_5.2_Final inside the /media directory...

Mount DVD on CentOS Desktop

 

3.  To verify CentOS DVD mount on /media/CentOS directory, just browse inside the media directory... you should see the CentOS_5.2_Final directory... see example below..

Verify CentOS DVD mount

 

4.  Now we start the configuration process by open the x-terminal and list list all files inside the yum.repos.d directory using ll command as show on command example below.

================================

[root@pc13 ~]# ll /etc/yum.repos.d/

total 16

-rw-r--r-- 1 root root 2049 Jun 19  2008 CentOS-Base.repo

-rw-r--r-- 1 root root  659 Jul  8 20:08 CentOS-Media.repo

[root@pc13 ~]#

 

5.  Then Execute mv command as show on command example below to disable CentOS software package installation and software package update from search internet for update sources...

================================

[root@pc13 ~]# mv /etc/yum.repos.d/CentOS-Base.repo  /etc/yum.repos.d/CentOS-Base.repo.disable

[root@pc13 ~]#

 

NOTE: you can turn back the CentOS capability to install and update software package from the internet by reversing the above command (mv /etc/yum.repos.d/CentOS-Base.repo.disable  /etc/yum.repos.d/CentOS-Base.repo)

 

6.  We need to edit the CentOS-Media.repo configuration file, but before we make any changes to the CentOS-Media.repo configuration file... follow command below to make backup file for the CentOS Media repo...

================================

[root@pc13 ~]# cp -pr /etc/yum.repos.d/CentOS-Media.repo  /etc/yum.repos.d/CentOS-Media.repo.bak

[root@pc13 ~]#

 

7.  Verify by execute the command below to list all file inside the /etc/yum.repos.d/ directory

yum repos files on CentOS

[root@pc13 ~]# ll /etc/yum.repos.d/

total 24

-rw-r--r-- 1 root root 2049 Jun 19  2008 CentOS-Base.repo.disable

-rw-r--r-- 1 root root  659 Jul  8 20:08 CentOS-Media.repo

-rw-r--r-- 1 root root  659 Jul  8 20:08 CentOS-Media.repo.bak

[root@pc13 ~]#

 

8.  To enable install from CentOS DVD, start edit the CentOS-Media.repo... execute gedit command as show on command example below if you like to edit the Centos-Media.repo configuration file using gedit editor... or you can use any Linux editor as you wish

================================

[root@pc13 ~]# gedit /etc/yum.repos.d/CentOS-Media.repo

[root@pc13 ~]#

Install software from CentOS DVD configuration

================================

# CentOS-Media.repo

#

# This repo is used to mount the default locations for a CDROM / DVD on

#  CentOS-5.  You can use this repo and yum to install items directly off the

#  DVD ISO that we release.

#

# To use this repo, put in your DVD and use it with the other repos too:

#  yum --enablerepo=c5-media [command]

# or for ONLY the media repo, do this:

#

#  yum --disablerepo=\* --enablerepo=c5-media [command]

 

[c5-media]

name=CentOS-$releasever - Media

baseurl=file:///media/CentOS/

        file:///media/cdrom/

        file:///media/cdrecorder/

        file:///media/CentOS_5.2_Final/    <-- add this line base on where CentOS DVD directory mounted on the system

gpgcheck=1

enabled=1    <-- To enable install from DVD, change enabled=1 as show on example

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

================================

 

9.  Save and close CentOs-Media.repo configuration file.

 

Install software package from CentOS installation DVD.

 

10.  Execute yum clean all command as show on example below to clear all yum metadata and yum cache files on the system.

================================

[root@pc13 ~]# yum clean all

Cleaning up Everything

[root@pc13 ~]#

 

11.  The execute the yum install command to start using the CentOS DVD as repo to install software package from the installation DVD.

--CentOS software package installation example using yum command...

================================

[root@pc13 ~]# yum install squid

 

12.  Or you can go to CentOS Application menu -> click on Add/Remove Software and use CentOS Package Manager to install software package from CentOS DVD... see example below :-)...

Add Remove Software Package Manager install from CentOS DVD.

... to zaitul iradah... good luck and happy CentOS package installation

 

Keywords: install from dvd, install from dvd centos, install software package from centos dvd, centos package manager, install software centos, install package centos, install from centos dvd, add remove package centos, install software centos, enable add remove package, enable add remove software, add package centos, add software centos

 

6 comments

17
Aug

Thanks for this useful

Thanks for this useful article.

I used the exact steps described above and I am able to install SW from the DVD media but only using yum.

When I try to use the add/remove SW GUI, all the groups are empty, when I do a refresh I get the error:
No network connection available
Cannot refresh cache whilst offline

I also made sure that the software sources is only the CD/DVD media.

The strange thing is however that when I go to the "al packages" group all the packages are displayed.

Any ideas?

17
Nov

Hi, I have the same

Hi,

I have the same problem.
Have you find the solution.

Thank for your help

20
Dec

No need to move the files out of the way

No need to move the files out of the way, just temporarily disable them with --disablerepo.

The following command works in Centos 6.3, you'll need to modify the c6-media call for other versions of centos.

yum --enablerepo=c6-media install gcc --disablerepo=base --disablerepo=extras --disablerepo=updates

21
Dec

agree

agree with you... thank by the way

13
Jan

The best explanation I have

The best explanation I have found--disabling CentOS-Base.repo the key step for me. Thank you!

2
Apr

It works !

It works with somme corrections for CentOS 6.5

[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
file:///media/CentOS_5.2_Final/ <-- add this line base on where CentOS DVD directory

Change 5.2 to 6.5
and change this line "name=CentOS-$releasever - Media" to "name=c6-media" <-- take the name as reported by any error like :
Errors were encountered while downloading packages.
from c6-media: [Errno 256] No more mirrors to try.

so that the bloc will be
[c6-media]
name=c6-media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
file:///media/CentOS_6.5_Final/ <-- add this line base on where CentOS DVD directory

Have fun