# GNUPG (GPG) is unable to find secret key



## mdudley (Jul 4, 2018)

I just upgraded one of my computers from 7.2 to 11.2, and reinstalled all the packages.  A perl program which is essential for me to use that has worked for the last 20 years, now reports that the secret key cannot be found.

I checked and it is in the /root/.gnupg/secring.gpg as always.  The permissions are rw-r-r so that should  not be the problem.

Any idea why gpg can no longer find the secret key after updating, and how to fix it?

Thanks,

Marshall


----------



## rigoletto@ (Jul 5, 2018)

If you upgraded directly from 7.2 to 11.2, there is a big chance of you actually have a broken system. Those kind of up upgrades should be made at least from a major version to the next one until you reach the one you target.


----------



## obsigna (Jul 5, 2018)

In the ports there are 2 versions of GnuPG, namely security/gnupg1 and security/gnupg version 2. I bet every one that at times of FreeBSD 7.2, there was no GnuPG Version 2. So chances are, that you simply installed the wrong version for your old (yet valid) setup. Try the following:

`pkg delete gnupg`
`pkg install gnupg1`


----------



## mdudley (Jul 5, 2018)

lebarondemerde said:


> If you upgraded directly from 7.2 to 11.2, there is a big chance of you actually have a broken system. Those kind of up upgrades should be made at least from a major version to the next one until you reach the one you target.



No, I did not upgrade that way at all.  I put the 11.2 iso image on a cd rom, and installed, then ported all the packages that I needed over, and restored from backup.


Marshall


----------



## mdudley (Jul 5, 2018)

obsigna said:


> In the ports there are 2 versions of GnuPG, namely security/gnupg1 and security/gnupg version 2. I bet every one that at times of FreeBSD 7.2, there was no GnuPG Version 2. So chances are, that you simply installed the wrong version for your old (yet valid) setup. Try the following:
> 
> `pkg delete gnupg`
> `pkg install gnupg1`




You might have a point there, since gpg is a link to gpg2.  I will give that a try.  Thanks.

Marshall


----------



## mdudley (Jul 11, 2018)

obsigna said:


> In the ports there are 2 versions of GnuPG, namely security/gnupg1 and security/gnupg version 2. I bet every one that at times of FreeBSD 7.2, there was no GnuPG Version 2. So chances are, that you simply installed the wrong version for your old (yet valid) setup. Try the following:
> 
> `pkg delete gnupg`
> `pkg install gnupg1`



Thanks.  That worked.

Marshall


----------

