CentOS: Install Packages Via yum Command Using DVD / CD as Repo

How do I install packages via DVD / CD using yum command under CentOS Community Enterprise Linux version 5.x?

CentOS Linux comes with CentOS-Media.repo which 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. Open /etc/yum.repos.d/CentOS-Media.repo file, enter:
# vi /etc/yum.repos.d/CentOS-Media.repo
Make sure enabled is set to 1:
enabled=1
Save and close the file. To use repo put your DVD and along with the other repos, enter:
# yum --enablerepo=c5-media install pacakge-name
To only use the DVDmedia repo, do this:
# yum --disablerepo=\* --enablerepo=c5-media install pacakge-name
OR use groupinstall command
# yum --disablerepo=\* --enablerepo=c5-media groupinstall 'Virtualization'

See Also:

RHEL 5.x user can use the following tutorial to install files from DVD / CD using yum:

  1. Howto Setup yum repositories to update or install package from ISO CDROM Image

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 9 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
9 comments… add one
  • Kimura Jul 1, 2009 @ 13:18

    Thanks, was the tip I needed at this time

  • aneesh Jul 3, 2009 @ 5:54

    good reference

  • raman Oct 21, 2009 @ 7:40

    centos all command use with exampal
    pelije send my id

  • santosh Nov 23, 2011 @ 6:14

    # yum –disablerepo=\* –enablerepo=c5-media install gcc*

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * c5-media:
    file://media/CentOS_5.4_Final/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: ‘/CentOS_5.4_Final/repodata/repomd.xml’
    Trying other mirror.
    file:///media/CentOS/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: ‘/media/CentOS/repodata/repomd.xml’
    Trying other mirror.
    file:///media/cdrecorder/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: ‘/media/cdrecorder/repodata/repomd.xml’
    Trying other mirror.
    file:///media/cdrom/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: ‘/media/cdrom/repodata/repomd.xml’
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: c5-media. Please verify its path and try again

  • sanjay Dec 2, 2011 @ 10:34

    i do not have any internet connection i use mobile to connect via usb can i download rmps in cd and use yum command help me plz i m a student and new in this field waiting for reply

    • kiran goud Jan 2, 2012 @ 7:15

      Steps
      1) connect ur nokia mobile to system

      2)Check ur nokia connection as it’s vendor and product number
      [root@server1 ~]# lsusb
      Bus 001 Device 001: ID 0000:0000
      Bus 002 Device 004: ID 0421:0061 Nokia Mobile Phones
      Bus 002 Device 003: ID 0e0f:0002
      Bus 002 Device 001: ID 0000:0000

      3)Add ur modem here with following command
      [root@server1 ~]# sudo /sbin/modprobe usbserial vendor=0x421 product=0x061

      4)add ur setting with following command
      [root@server1 ~]# wvdialconf /etc/wvdial.conf
      Scanning your serial ports for a modem.

      ttyS0: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
      ttyS0: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
      ttyS0: ATQ0 V1 E1 — and failed too at 115200, giving up.
      ttyS1: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
      ttyS1: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
      ttyS1: ATQ0 V1 E1 — and failed too at 115200, giving up.
      Port Scan: S2 S3
      WvModem: Cannot get information for serial port.
      ttyACM0: ATQ0 V1 E1 — OK
      ttyACM0: ATQ0 V1 E1 Z — OK
      ttyACM0: ATQ0 V1 E1 S0=0 — OK
      ttyACM0: ATQ0 V1 E1 S0=0 &C1 — OK
      ttyACM0: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
      ttyACM0: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
      ttyACM0: Modem Identifier: ATI — Nokia
      ttyACM0: Speed 4800: AT — OK
      ttyACM0: Speed 9600: AT — OK
      ttyACM0: Speed 19200: AT — OK
      ttyACM0: Speed 38400: AT — OK
      ttyACM0: Speed 57600: AT — OK
      ttyACM0: Speed 115200: AT — OK
      ttyACM0: Speed 230400: AT — OK
      ttyACM0: Speed 460800: AT — OK
      ttyACM0: Max speed is 460800; that should be safe.
      ttyACM0: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
      WvModem: Cannot get information for serial port.
      ttyUSB0: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
      ttyUSB0: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
      ttyUSB0: ATQ0 V1 E1 — and failed too at 115200, giving up.

      Found an USB modem on /dev/ttyACM0.
      Modem configuration written to /etc/wvdial.conf.
      ttyACM0: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0″
      [root@server1 ~]#
      [root@server1 ~]# vim /etc/wvdial.conf
      [root@server1 ~]# wvdial
      –> WvDial: Internet dialer version 1.54.0
      –> Cannot get information for serial port.
      –> Initializing modem.
      –> Sending: AT+CGDCONT=1,”IP”,”aircelgprs”,””,0,0
      AT+CGDCONT=1,”IP”,”aircelgprs”,””,0,0
      OK
      –> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
      ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
      OK
      –> Modem initialized.
      –> Sending: ATDT*99#
      –> Waiting for carrier.
      ATDT*99#
      CONNECT
      ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
      –> Carrier detected. Starting PPP immediately.
      –> Starting pppd at Sun Oct 4 03:25:12 2009
      –> pid of pppd: 9507
      –> Using interface ppp0
      –> pppd: 60800
      –> pppd: 60800
      –> pppd: 60800
      –> pppd: 60800
      –> local IP address 10.183.117.164
      –> pppd: 60800
      –> remote IP address 10.6.6.6
      –> pppd: 60800
      –> primary DNS address 202.148.200.3
      –> pppd: 60800
      –> secondary DNS address 202.148.202.4
      –> pppd: 60800
      Caught signal #2! Attempting to exit gracefully…
      –> Terminating on signal 15
      –> pppd: 60800
      –> Connect time 7.2 minutes.
      –> pppd: 60800
      –> pppd: 60800
      –> pppd: 60800
      –> Disconnecting at Sun Oct 4 03:32:23 2009

      root@server1 proc]# cat /etc/wvdial.conf

      [Dialer Defaults]
      Modem = /dev/ttyACM0
      Init1 = AT+CGDCONT=1,”IP”,”aircelgprs”,””,0,0
      Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
      Baud = 460800
      #Init1 = ATZ
      #Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
      ISDN = 0
      Modem Type = USB Modem
      ; Phone =
      ; Username =
      ; Password =
      Username = a
      Password = a
      Phone = *99#
      Stupid Mode = 1

      check the kppp pakage and start ur linux in graphic mode with startx

      open kppp–>applications–>internet–>kppp
      click on configure–>click account tab and click on new–>Manual setup–>dial–>connection name–aircel
      clikc add–enter a phone no as put–>*99#–ok–>0k
      click on Modems tab–>>New–>Modem name–/dev/ttyAMC0–>modem device–>select /dev/ttyAMC0
      now click on Modem tab–>Modem commands–>
      Initialization strings1=AT+CGDCONT=1,”IP”,”aircelgprs”,””,0,0
      Initialization strings2=ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
      click -ok
      Query Modem to test it-
      click ok and ok
      put the user name=a
      password = a
      now connect ur aircel gprs properly

      this for sanjay.
      sanjay make changes according to your provider, its 100% works.
      thank you.

  • srv_das Nov 24, 2012 @ 14:05

    Just 4 Step to done CentOS 6.3 Install Packages Via yum Command Using DVD / CD as Repo : ……………………. very easy ……….

    1. Create a Folder Named CentOS/cdrom/cdrecorder under /media [directory]
    2. mount /dev/cdrom /media/CentOS
    3. vim /etc/yum.repos.d/CentOS-Base.repo

    # –> All mirrorlist=

    add baseurl=file:///media/CentOS/

    4. Run Yum Command –> yum install gcc

    Like below …………………………………

    [base]

    name=CentOS-$releasever – Base
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    baseurl=file:///media/CentOS/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #released updates

    [updates]

    name=CentOS-$releasever – Updates
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
    baseurl=file:///media/CentOS/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #additional packages that may be useful

    [extras]

    name=CentOS-$releasever – Extras
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
    baseurl=file:///media/CentOS/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #additional packages that extend functionality of existing packages

    [centosplus]

    name=CentOS-$releasever – Plus
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
    baseurl=file:///media/CentOS/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #contrib – packages by Centos Users

    [contrib]

    name=CentOS-$releasever – Contrib
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
    baseurl=file:///media/CentOS/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    [root@centossrv1 ~]#

    • Chuk May 5, 2014 @ 13:18

      Worked Great!

  • vijay patil Jan 27, 2015 @ 20:58

    Please tell me how to configure my huawei e3131 dongle in cent os 6.3 version

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum