Error: GPG check FAILED

I tried installing a programs but it says Error: GPG check FAILED Here is full log


> Last metadata expiration check: 0:20:47 ago on Sun 12 Dec 2021 05:56:58 PM IST.
Dependencies resolved.
========================================================================================================================================================================
 Package                                    Architecture                         Version                                     Repository                            Size
========================================================================================================================================================================
Installing:
 dconf-editor                               x86_64                               3.38.3-2.fc35                               fedora                               670 k

Transaction Summary
========================================================================================================================================================================
Install  1 Package

Total size: 670 k
Installed size: 2.9 M
Downloading Packages:
[SKIPPED] dconf-editor-3.38.3-2.fc35.x86_64.rpm: Already downloaded                                                                                                    
Cannot find rpmkeys executable to verify signatures.
Problem opening package dconf-editor-3.38.3-2.fc35.x86_64.rpm
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

Also is sudo su this error

bash: register-python-argcomplete: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
bash: sh: command not found
bash: tr: command not found
bash: cat: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'

What should I do?

In su if I type any package name this happens For Ex: sudo

[root@fedora sj]# sudo
bash: sudo: command not found...
Install package 'sudo' to provide command 'sudo'? [N/y] N


[root@fedora sj]# exit
exit
[sj@fedora ~]$ 

Here’s my Variables in /etc/environment

PATH="/usr/java/latest/bin:$PATH"
JAVA_HOME="/usr/java/latest"
J2REDIR="/usr/java/latest/jre"
J2SDKDIR="/usr/java/latest"

And .bashrc

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
	for rc in ~/.bashrc.d/*; do
		if [ -f "$rc" ]; then
			. "$rc"
		fi
	done
fi

unset rc

I first edited it and then reset it to default state

sudo rpm --import \
    /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$(rpm -E %{fedora})-$(arch)

Not working same error.

This is on the getfedora.org download verification page. It is possible the main fedora gpg keys did not get installed for some reason
sudo curl https://getfedora.org/static/fedora.gpg | gpg --import

wget https://getfedora.org/static/fedora.gpg
sudo rpm --import fedora.gpg

My understanding, each time we run check-update it will save cache of meta database. But if we run install, upgrade, distro-sync, it will compare the meta then first download the packages and save the downloaded packages as cache.

Sometime on those process some packages failed to download correctly and if it’s come to part on installing the packages or on verification or on running script during installation, it will not works correctly.

From messages above it suggested to clean the cache with dnf clean packages, but you could also clean all cache (including meta etc.) by using dnf clean all then try again to dnf check-update --refresh, dnf install packages --refresh, or any dnf command related.

my /etc/environment is blank

I’d suggest removing the entries from that and retrying.

2 Likes

This works is there any other way to fix it?

These are my variables in /etc/environment

PATH="/usr/java/latest/bin:$PATH"
JAVA_HOME="/usr/java/latest"
J2REDIR="/usr/java/latest/jre"
J2SDKDIR="/usr/java/latest"

Is there any mistake in this

$PATH I don’t believe works in /etc/environment

If you want to set this for all users look at /etc/profile

Just for one user ~/.profile or ~/.bash_profile

Edit:

If your not familiar with doing this I’d suggest doing this at the user level first with a new user.

1 Like

I think you would want that in either ~/.bash_profile or ~/.bashrc.
Also, I think you want to add ‘export’ to the beginning of those lines when you move them from /etc/environment so the variables are actually made part of the environment for your user.
This should work.

export PATH="$PATH:/usr/java/latest/bin"
export JAVA_HOME="/usr/java/latest"
export J2REDIR="/usr/java/latest/jre"
export J2SDKDIR="/usr/java/latest"

If you have other users who need those changes in their environment as well you can put that in /etc/bashrc or /etc/profile instead.

Note that the system searches $PATH from beginning to end and executes the first matching command found, so if you add everything specialized to the beginning as your PATH statement above did then it adds a small amount of time to finding actual commands. It also can potentially interfere with executing system commands if it finds an identically named command in a different location.

yea I have done it