I accidently delete postgressSQL and now I am unable to use the yum command. Every time I attempt to use it, I encounter an issue. Can anyone please help me with this?
[root@centos ~]# sudo yum check-update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 7.8 kB 00:00:00
* base: mirrors.nxtgen.com
* epel: repo.extreme-ix.org
* extras: mirrors.nxtgen.com
* updates: mirrors.nxtgen.com
Artifactory/signature | 183 B 00:00:00
Artifactory/signature | 1.5 kB 00:00:00 !!!
Artifactory-pro/signature | 183 B 00:00:00
Artifactory-pro/signature | 1.5 kB 00:00:00 !!!
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
hashicorp | 1.4 kB 00:00:00
jenkins | 2.9 kB 00:00:00
pgdg-common/7/x86_64/signature | 665 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg-common/7/x86_64/signature | 2.9 kB 00:00:00 !!!
https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg-common
Trying other mirror.
One of the configured repositories failed (PostgreSQL common RPMs for RHEL / CentOS 7 - x86_64),
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=pgdg-common ...
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 pgdg-common
or
subscription-manager repos --disable=pgdg-common
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=pgdg-common.skip_if_unavailable=true
failure: repodata/repomd.xml from pgdg-common: [Errno 256] No more mirrors to try.
https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg-common
[root@centos ~]#
I'm guessing you deleting ProgreSQL is not causing the issue you are having with yum. Looks like you either deleted the encryption key or, based on the ProgreSQL web site (https://yum.postgresql.org/), it was updated on 1/3/2024 so the one you have now is out of date. Looks like you need to run this command to update the keys:
That should get you back in business. If not, and you don't care about PostgreSQL, then I would just permanently disable the PostgreSQL repo by running: