anette asked this 10 months ago

yum repo Error installing packages from CentOS 7 DVD

I am trying to install dhcpd package from CentOS 7 DVD using yum install. (No internet connection)

yum is trying to look for the package in online repos and I am getting this error:

[root@otg yum.repos.d]# yum install dhcp
Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#7 - "Failed to connect to 2607:f8f8:700:12::10: Network is unreachable"
http://anorien.csc.warwick.ac.uk/mirrors/centos/7.4.1708/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to anorien.csc.warwick.ac.uk:80; No route to host"
Trying other mirror.

How do I add DVD as a repo for yum?


mamdouh 10 months ago
2 likes

hi,

Your media repo may not be enabled. run the command yum repolist which should show all the repos that are enabled.

Here is a sample output.. you should see c7-media in the list if the dvd repo is enabled.

# yum repolist
repo id               repo name                                           status
base/7/x86_64         CentOS-7 - Base                                      9,591
c7-media              CentOS-7 - Media                                         0
epel/x86_64           Extra Packages for Enterprise Linux 7 - x86_64      12,071
extras/7/x86_64       CentOS-7 - Extras                                      329
updates/7/x86_64      CentOS-7 - Updates                                   1,718
repolist: 23,709

anette 10 months ago

I cant't see c7-media in the repolist.

[root@otg yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
 * base: anorien.csc.warwick.ac.uk
 * extras: centos.mirroring.pulsant.co.uk
 * updates: anorien.csc.warwick.ac.uk
repo id                      repo name                                    status
!base/7/x86_64               CentOS-7 - Base                              9,591
!daftaupe-hugo/x86_64        Copr repo for hugo owned by daftaupe            14
!extras/7/x86_64             CentOS-7 - Extras                              282
!updates/7/x86_64            CentOS-7 - Updates                           1,089
repolist: 10,976

 

mamdouh 10 months ago
1 like

To enable the repo edit /etc/yum.repos.d/CentOS-Media.repo

and change enabled=1

Vikas 10 months ago

Check if there is a file called /etc/yum.repos.d/CentOS-Media.repo if not create it.

[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

anette 10 months ago

I tried that. Still getting the same error 

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#7 - "Failed to connect to 2607:f8f8:700:12::10: Network is unreachable"
http://anorien.csc.warwick.ac.uk/mirrors/centos/7.4.1708/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to anorien.csc.warwick.ac.uk:80; No route to host"
Trying other mirror.

 

Best Answer by mamdouh
2 likes

Disable online repos and enable only the local DVD repo and do the yum install.

yum --disablerepo=\* --enablerepo=c7-media install <packagename>