Please check with this
1) Run the gpg-agent command:
gpg-agent --daemon --use-standard-socket --pinentry-program /usr/bin/pinentry-curses
2) Generate enough entropy
sudo rngd -r /dev/urandom
3) Finally run the gpg command to generate the key:
gpg --gen-key
please run all commands with non-root user only
Please login with same user,which is used to create gpg keys.
1.We will export both our public key and private key as follows:
user$ gpg --export -a -o mypublickey.txt user@replaceurmail.com
user$ gpg --export-secret-key -a -o myprivatekey.txt user@replaceurmail.com
user$ ls my*
myprivatekey.txt mypublickey.txt
Import keys with same user
User$ gpg --import myprivatekey.txt
now try decrypt with same user