Failed to download metadata for repo appstream - centos

Running on centos 8 today want to install new package and before it wants to run:
yum update -y
but got this:
Failed to download metadata for repo 'appstream': Cannot prepare
internal mirrorlist: No URLs in mirrorlist
Then I did search and found a solution to fix it:
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
I did this but still error persist, any idea? how to fix this? Is there new solution in 2022?
After use this solution
Now error:
Errors during downloading metadata for repository 'extras':
Status code: 403 for https://vault.centos.org/centos/8/extras/x86_64/os/repodata/repomd.xml
(IP: 13.249.9.66) Error: Failed to download metadata for repo
'extras': Cannot download repomd.xml: Cannot download
repodata/repomd.xml: All mirrors were tried

Related

Installing a local repo in RHEL

i found that error during my installation of a local repo in RHEL pay attention that cdrom's contents don't have neither BaseOS , AppStream nor Package directories which should be mounted under it so what should i do ? , every time i install a package like system-config-kickstart as an example an err appears :
Errors during downloading metadata for repository 'Rhel.8.0_BaseOS': - Curl error (37): Couldn't read a file:// file
for file:///rhel.8_dvd/BaseOS/repodata/repomd.xml [Couldn't open file
/rhel.8_dvd/BaseOS/repodata/repomd.xml] Error: Failed to download
metadata for repo 'Rhel.8.0_BaseOS': Cannot download repomd.xml:
Cannot download repodata/repomd.xml: All mirrors were tried

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.

How to fix "Cannot retrieve repository metadata (repomd.xml)" error installing Ripple - yum

I installed the Ripple rpm repo following documentation
(step 1)
$ sudo rpm -Uvh
https://mirrors.ripple.com/ripple-repo-el7.rpm
Then (step2) I run command:
sudo yum install --enablerepo=ripple-stable rippled
but I get the error:
https://mirrors.ripple.com/rpm/%24releasever/stable/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: ripple-stable. Please verify its path and try again
Does anyone know how to resolve it?
That error message occurs when attempting to install the rippled package on an unsupported environment.
The rippled rpm package is currently only available for CentOS/RHEL 7 (and Ubuntu 15+ using alien)
You could try installing with:
sudo yum install --enablerepo=ripple-stable --releasever=el7 rippled
but YMMV.
\The URL is suspect - it says %24releasever which is URL-encoded $releasever which means your yum isn't filling in that blank, e.g. .../rpm/7/stable/.
Try hard-coding it in the file you can find in /etc/yum.repos.d/ that your step one installed.

pecl install mongo command for mongo-1.5.5.tgz produce invalid tgz error

Overview
I was creating my Docker image to setup Rockmongo.
In the Dockerfile, I have a command
pecl install mongo
This command was working before but when ran t today I am getting this error,
downloading mongo-1.5.5.tgz ...
Starting to download mongo-1.5.5.tgz (Unknown size)
....done: 3,582 bytes
Could not get contents of package "/build/buildd/php5-5.3.10/pear-build-download/mongo-1.5.5.tgz". Invalid tgz file.
Download of "pecl/mongo" succeeded, but it is not a valid package archive
Error: cannot download "pecl/mongo"
Reference
To view the whole docker file
https://github.com/gilacode/docker-rockmongo/blob/master/Dockerfile
Question
Is there any way to specificy a different version of the Mongo package during the "pecl install command"?
I see this is an old question but anyway ...
I had the same issue and it was not due to the pecl website.
It seems to be a bug with the "lfs" option when you compile php5.
To verify if this is your case type: php-config --phpapi
I got it working by adding the --nocompress option
[sudo pecl install --nocompress mongo]
You can see other details here https://bugs.php.net/bug.php?id=67075

Unable to access git or pip on pythonanywhere

I'm trying to update some code I am running on PythonAnywhere, but am having some network issues.
When I try and pull from git or install from pip I keep getting errors.
(my-site)04:02 ~/my-site (master)$ git pull
fatal: unable to access 'https://github.com/LegoStormtroopr/possum-mdr.git/': Failed connect to github.com:3128; Connection refused
(my-site)04:02 ~/my-site (master)$ pip install django_select2
Downloading/unpacking django-select2
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement django-select2
No distributions at all found for django-select2
Storing complete log in /home/my-site/.pip/pip.log
Has anyone else experienced this?