Note: Using this method you may import both the public and private key using just the private key
gpg --armor --export-secret-keys --output foo.asc bar@gmail.com
gpg --import foo.asc
Note: Using this method you have to import both the public and private keys
gpg --output public-key.pgp --armor --export bar@gmail.com
gpg --export-secret-key key-id | paperkey --output-type raw | qrencode --8bit --output secret-key.qr.png
gpg --dearmor public-key.pgp
zbarimg -1 --raw -q -Sbinary secret-key.qr.png | paperkey --pubring public-key.pgp.gpg | gpg --import
Reference: https://wiki.archlinux.org/title/Paperkey