我不小心删除了postgressSQL,现在无法使用yum命令。每次我尝试使用它时,都会遇到问题。谁能帮我解决这个问题吗?
[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 ~]#
我猜您删除 ProgreSQL 不会导致您遇到的 yum 问题。看起来您要么删除了加密密钥,要么根据 ProgreSQL 网站 (https://yum.postgresql.org/),它已于 2024 年 1 月 3 日更新,因此您现在拥有的密钥已过时。看起来您需要运行此命令来更新密钥:
sudo yum --disablerepo=* -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
这应该会让你重新做生意。如果没有,并且您不关心 PostgreSQL,那么我将通过运行永久禁用 PostgreSQL 存储库:
sudo yum-config-manager --disable pgdg-common