Yum fails on first server in mirrorlist - redhat

After installing the EPEL repo via RPM on a 6.1 RHEL box, I have the following yum config
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
The box has internet connectivity, and can download the mirrorlist fine, but the first server on the mirror list is currently down, and any yum command gives me:
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
Maybe I'm wrong, but shouldn't yum skip to the next mirror in the list in this instance?
Is there a configuration setting missing/incorrect that prevents this from happening? Or is my assumption of how this should be working flawed?

Remove that **# sign beside name in the configuration file and check if it works.**

Related

Couldn't open file /packages/repodata/repomd.xml

I am using Redhat Linux server and trying to install the MongoDB on it.
I am following steps given in the link: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/
Step 1: Create a /etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly, using yum.
sudo nano /etc/yum.repos.d/mongodb-org-4.0.repo
Step 2: Copy and paste below code in the newly created file.
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
Step 3: To install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:
sudo yum install -y mongodb-org
After all this I am getting an error given below:
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
file:///packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /packages/repodata/repomd.xml"
Trying other mirror.`
One of the configured repositories failed (local),
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=localrepo ...
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 localrepo
or
subscription-manager repos --disable=localrepo
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=localrepo.skip_if_unavailable=true
failure: repodata/repomd.xml from localrepo: [Errno 256] No more mirrors to try.
file:///packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /packages/repodata/repomd.xml"
Server OS
NAME="Red Hat Enterprise Linux Server"
VERSION="7.3 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.3"
I already followed steps below but these are not working in my case:
sudo rm -rf /etc/yum.repos.d/mongodb-org-4.0.repo
sudo yum clean all
How could i resolve this error?
Based on your error message it looks like you had a nameserver problem, which can involve a variety of solutions as this answer from redhat.com describes. My mongodb-org-4.0.repo file looks just like yours except with version 4.4 and everything worked fine. Well not at first that's how I found this post, but my problem was a blank space I accidentally inserted at the end of the mongodb-org-4.4.repo file.
I found this Unix & Linux Stack Exchange post with some possible fixes, one of which is updating to the latest CentOS. This ServerFault post also had an Errno 14 error message like you're seeing, but this solution was to disable SELinux.
you should check with baseurl in /etc/yum.repos.d/mongodb-org-4.0.repo file. we can also change the releaseserver version in baseurl.
Here is my /etc/yum.repos.d/mongodb-org-4.0.repo file
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
It works for me.

centos yum fails installing anything or updating system

I am trying to install a package on CentOS, but it throws error when I run the "yum" command. The internet connection is working fine.
I try to yum clean all but problem persist.
Error:
[root#dcos-master3 ~]# yum install ntp
Loaded plugins: fastestmirror
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 find a valid baseurl for repo: base/$releasever/x86_64
My yum repolist is the next:
[root#dcos-master3 ~]# yum repolist list
Loaded plugins: fastestmirror
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
repolist: 0
If I list the repolist:
[root#dcos-master3 ~]# yum repolist
Loaded plugins: fastestmirror
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
repo id repo name status
base/$releasever/x86_64 CentOS-$releasever - Base 0
dockerrepo/$releasever Docker Repository 0
extras/$releasever/x86_64 CentOS-$releasever - Extras 0
updates/$releasever/x86_64 CentOS-$releasever - Updates 0
repolist: 0
BEFORE TRYING ANY OF THIS, HAVE A BACKUP OF YOUR MACHINE, YOU COULD DAMAGE YOUR OS MORE/COMPLETELY
It seems that your yum variable $releasever is somehow corrupt,
it usually is caused by missing centos-release package on the machine for some obscure reasons.
You can check if you have the package by:
rpm -qi centos-release
You will probably see:
"package centos-release is not installed"
First find out the exact centos version that you have by executing as root:
cat /etc/redhat-release
You will see something like this:
CentOS Linux release 7.3.1611 (Core)
You can fetch the centos-release package from repo by:
wget http://vault.centos.org/centos/7.3.1611/updates/x86_64/Packages/centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm
Now run reinstall centos-release package via rpm:
sudo rpm -Uvh --replacepkgs centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm
As next you can try to install something with yum and you might get:
[root#dcos-master3 ikerlan]# sudo yum install wget
error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 - (-30969)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
Now you can try to reboot the machine or try to use the following command to rebuild the rpm db:
rpm --rebuilddb
I came across the same issue while downloading some packages in centos 7. After days of search, I found the solution:
Go to the yum repo directory.
cd /etc/yum.repos.d.
Make a copy of the CentOS-Base.repo file.
cp CentOS-Base.repo CentOS-Base.repo.old
Edit the CentOS-Base.repo file. Comment mirrorlist and uncomment baseurl.
vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Now when you use yum, do the following.
sudo yum --disablerepo=* --enablerepo=base install httpd
Likewise for yum update.
sudo yum --disablerepo=* --enablerepo=base install httpd
It should work now.
I ran into this problem when attempting to install MariaDB on CentOS 7. I was super frustrated and after much searching found the answer at this link.
Here is what fixed this problem for me. Run as root.
# yum --disablerepo "*" --enablerepo epel install [package]
# yum clean all
"epel" can be whatever repo you like, but this one worked for me. Place [package] in the command just as written, not what package you are trying to install.
After you run the above, exit root and run whatever install you were attempting before encountering the error.
I noticed that in the failing url, your $releasever is %24releasever, but it should be 7 or 7.14.xx. Please check your yum config file at /etc/yum/var, or search in every .repo file, to see what is its value. It may be corrupted.
See Red Hat documentation for more information about how to set these variables.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-using_yum_variables
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum -y install yum-utils
yum-config-manager --enable remi-php74
Then proceed to your installation/updates/etc
Always make sure NAT is active on your centos7. Specially when there is a VMnet2 for host. Because sometimes VMNet2 can be active instead of NAT and because of that you will not be able to connect to the internet through centos7. This is just a one reason for getting that error.

Cannot retrieve repository metadata for repository: epel (rhel 6.6)

Im trying to install linux nrpe agent on one of the test rhel boxes for nagiosxi to monitor and when i run the fullinstall script im getting this following error
[root#nrpetest2 linux-nrpe-agent]# ./fullinstall
============================
Nagios Linux Agent Installer
============================
This script will install the Nagios Linux Agent by executing all necessary
sub-scripts.
IMPORTANT: This script should only be used on a clean installed system:
RedHat Enterprise, CentOS, Fedora, or Oracle
OpenSUSE or SUSE Enterprise
Ubuntu or Debian
Do NOT use this on a system running any other distro or that
does not allow additional package installation.
Do you want to continue? [Y/n] y
Proceeding with installation...
Running './0-repos'...
Configuring Repos...
Enabling EPEL repo...
Installing EPEL PKG: ./packages/epel-release-6-5.noarch.rpm
warning: ./packages/epel-release-6-5.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ##################################################
epel-release ##################################################
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
epel-release RPM installed OK
Repos configured OK
RESULT=0
Running './1-prereqs'...
Installing prerequisites...
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
RESULT=1
===================
INSTALLATION ERROR!
===================
Installation step failed - exiting.
Check for error messages in the install log (install.log).
If you require assistance in resolving the issue, please include install.log
in your communications with Nagios XI technical support.
The script that failed was: './1-prereqs'
I have it registered with RedHat network as well and i searched everywhere to find a solution to this error but had no luck.
It looks like you are missing the required epel-release for nagios to install.
Have your tried doing a sudo yum install epel-release?
That would be my biggest guess, according to your line:
Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again RESULT=1The script that failed was: './1-prereqs'
Also, check to make sure that your proxy settings allow for a connection to that repository. Sometimes this causes a problem with downloading certain repo data.
So, in short, update your epel-release and make sure that any other pre-requisities have been updated. It probably wouldn't hurt to do: sudo yum install yum-utils to make sure that yum-utils is fully up-to-date.
UPDATE: From: Access Redhat
Verify that Satellite or Proxy Server has a fully-qualified domain name, and CommonName in SSL cert. used by Apache is set to the fully-qualified domain name.
Verify that the ssl.conf file is pointing to the correct files.grep ^SSLCert /etc/httpd/conf.d/ssl.conf
If system points to a proxy, check to make sure that /etc/sysconfig/rhn/up2date is configured with correct http_proxy information. httpProxy=http_proxy_fqdn or ip_address:port
Update yum to latest version: yum update yum
Clean the cache on client system: rm -rf /var/cache/yum/*

how to add rhel-beta repo on centos 6.2?

I want to install Xvfb on CentOS 6.2 and I added the repo refered in https://serverfault.com/questions/344793/install-xvfb-via-yum-yum-repository-for-xvfb/361304#361304. I found ftp://ftp.redhat.com/pub/redhat/rhel/beta/6/x86_64/os/repodata/repomd.xml is invalid now, only ...beta/7/... is valid. Can I use this repo?
You can follow these steps to do so.
1) Install the RPM containing the repo definitions
$ su -c 'rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm'
2) Enable the Optional channel for your host by logging into RHN and enabling the Optional channel. According to the EPEL wiki page this is required to resolve package dependencies.
3) Make sure EPEL and the Optional channel are enabled
$ yum repolist
Learn more about configuring EPEL at the Fedora wiki.
If you prefer to configure the EPEL repo by hand, follow these steps:
1) As root, put the following in a separate file (with a name ending in .repo) in /etc/yum.repos.d:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
2) import the EPEL rpm key:
rpm --import https://fedoraproject.org/static/0608B895.txt
3) Enable the Optional channel for your host by logging into RHN and enabling the Optional channel. According to the EPEL wiki page this is required to resolve package dependencies.
4) Make sure EPEL and the Optional channel are enabled
$ yum repolist
Thanks to my ever-present technical support person, Paul Frields, for providing the file above way back when the RHEL 6 EPEL repo RPM was not available.

RHEL packetmanager

I am working for some years with debian on engineering/administration level and using apt as packetmanager.
Now I have to work with a RHEL and I need some quick overview of how to handle packetmanagement there. I know the rpm-tool but not very well.
I am looking especially for this:
- how can I link my local PM to a paket-repository in the internet or on CD
- is rpm just for single files (like dpkg) or also for managin (like apt-get: searching etc)
so apt on debian is very cool. is there something comparable in RHEL too??
cheers, chris
is rpm just for single files (like dpkg) or also for managin (like apt-get: searching etc)
Not quite. Rpm is for Redhat what dpkg is for Debian. The Redhat equivalent of apt-tools/aptitute is yum.
I am looking especially for this: - how can I link my local PM to a paket-repository in the internet or on CD
Redhat puts repositories in files, rather then a single sources.list file. You find those repo-definitions in /etc/yum.repos.d/. So see what repositories are available, you use the command yum repolist. For instance, this Scientific Linux system of mine it gives the following output:
# yum repolist
repo id repo name status
epel Extra Packages for Enterprise Linux 6 - x86_64 6.416
sl Scientific Linux 6.1 - x86_64 6.251
sl-security Scientific Linux 6.1 - x86_64 - security updates 336
repolist: 13.003
If you want to add a repository, you either try getting a predefined file (hint: almost any 3rd party repository gives you an rpm which does everything automatically) or write your own repository defintion. Put it in a file called reponame.repo in /etc/yum.repos.d/. This is an example from the EPEL project:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
$basearch resolves to uname -m, so to x86_64 or i686. If you set everything up correctly (mandatory settings are name, baseurl and enabled=1), run yum update and check with yum repolist if your repository was correctly included.
Usually you'll only use yum; rpm alone is rarely used. If you're used to aptitude, yum won't be much of a challenge for you for the commands like update/upgrade/clean/erase are pretty much the same.
The yum documentation can be found on Fedora's webpage: http://docs.fedoraproject.org/en-US/Fedora/14/html/Software_Management_Guide/index.html
Good luck!
Alex.
Ubuntu "dkpg" -> RHEL -> "rpm"
Ubuntu "apt-get install **" RHEL -> "yum install **"
There are various unofficial available for RHEL and if you are subscribed to RHN then you get the packages directly from Red Hat Network.
Configuration files in /etc/yum.repos.d/