configuring yum repo in centos

General support questions
Post Reply
Anju Singh
Posts: 14
Joined: 2018/12/06 03:48:59

configuring yum repo in centos

Post by Anju Singh » 2019/03/13 23:18:29

Hi I am not able to use yum to install any packages. I get the below error -

[root@test yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror, langpacks
file:///mnt/oel_iso/Server/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/oel_iso/Server/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again


I installed epel -
[root@test yum.repos.d]# rpm -qa | grep epel
epel-release-7-11.noarch

[root@test yum.repos.d]# ls -l
total 16
-rw-r--r-- 1 root root 629 Mar 14 09:20 CentOS-Media.repo
-rw-r--r-- 1 root root 951 Mar 14 09:41 epel.repo
-rw-r--r-- 1 root root 1050 Oct 3 2017 epel-testing.repo
-rw-r--r-- 1 root root 107 Mar 14 09:25 loc_repo.repo
drwxr-xr-x. 2 root root 187 Apr 11 2018 old

[root@test yum.repos.d]# uname -a
Linux test 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

dunch
Posts: 66
Joined: 2018/11/07 13:48:53
Location: Yorkshire

Re: configuring yum repo in centos

Post by dunch » 2019/03/14 10:26:50

There won't be any upstream repository if it's looking for a location marked file:// it will be looking for a locally mounted filesystem. My guess is that it's your loc_repo.repo but you can confirm this by grepping in /etc/yum.repos.d
Once you've found the dodgy repo, you can disable it by editing the repo file and setting "enabled=0"
The other alternative is to mount the missing filesystem.

emailkprasad
Posts: 12
Joined: 2019/03/14 14:25:17

Re: configuring yum repo in centos

Post by emailkprasad » 2019/03/14 16:26:04

Looks like CD/DVD iso has been setup as repo. If you still have the ISO file locally on the host, loop mount it to /mnt/oel_iso path and you will be able to install packages from it.

Code: Select all

$ sudo mount -o loop /<path>/<isofile> /mnt/oel_iso

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: configuring yum repo in centos

Post by TrevorH » 2019/03/14 16:41:46

Though it should also be noted that this is not a support forum for Oracle Enterprise Linux.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Anju Singh
Posts: 14
Joined: 2018/12/06 03:48:59

Re: configuring yum repo in centos

Post by Anju Singh » 2019/03/18 22:55:38

emailkprasad wrote:
2019/03/14 16:26:04
Looks like CD/DVD iso has been setup as repo. If you still have the ISO file locally on the host, loop mount it to /mnt/oel_iso path and you will be able to install packages from it.

Code: Select all

$ sudo mount -o loop /<path>/<isofile> /mnt/oel_iso
Thanks, i will work on the above said steps

Post Reply