OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: bradforr on March 18, 2022, 01:40:01 PM

Title: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 01:40:01 PM
I'm getting the following screen when I try process an upgrade.

***GOT REQUEST TO CHECK FOR UPDATES***
Currently running OPNsense 21.7.1 (amd64/OpenSSL) at Fri Mar 18 12:38:08 UTC 2022
Fetching changelog information, please wait... done
Updating OPNsense repository catalogue...
Fetching meta.conf: . done
Fetching packagesite.txz: .......... done
Processing entries: .......... done
OPNsense repository update completed. 777 packages processed.
All repositories are up to date.
pkg: pkg is not installed, therefore upgrade is impossible
Checking integrity... done (0 conflicting)
Your packages are up to date.
Checking for upgrades (0 candidates): . done
Processing candidates (0 candidates): . done
Checking integrity... done (0 conflicting)
Your packages are up to date.
***DONE***

So I'm not able to add certain modules (Like Wireguard) because I have the incorrect version. What can I do to fix it?
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 01:41:30 PM
Package manager database trashed... you need to run this manually from the console:

# opnsense-bootstrap


Cheers,
Franco
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 01:42:05 PM
Sorry, I'm a bit new to this... What?
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 01:44:02 PM
It needs a clean reinstall of all packages. Unfortunately the system thinks the packages are not installed but they obviously are... which means it needs to be installed manually from the console (or SSH if you will) running the shell command.


Cheers,
Franco
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 01:44:21 PM
I get

pkg: Error loading trusted certificates
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 01:49:39 PM
By doing what exactly?


Cheers,
Franco
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 01:52:23 PM
I connect to the console, load the shell, type "opnsense-bootstrap" and it asks to confirm, I say Y... And then it starts but then just throws out that line and stops.
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 01:55:13 PM
Ok, this is stranger than expected... It's supposed to not trip over anything.

Can you run it like this and post the output?

# opnsense-bootstrap -V


Thanks,
Franco
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 02:01:26 PM
21.7
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 02:03:18 PM
with a capital "V" :)
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 02:12:47 PM
root@SAICE-OPNS:~ # opnsense-bootstrap -V
+ uname -s
+ FBSDNAME=FreeBSD
+ [ FreeBSD '!=' FreeBSD ]
+ uname -p
+ FBSDARCH=amd64
+ [ amd64 '!=' amd64 ]
+ uname -r
+ colrm 4
+ FBSDVER=12.
+ [ 12. '!=' 12. ]
+ echo 'This utility will attempt to turn this installation into the latest'
This utility will attempt to turn this installation into the latest
+ echo 'OPNsense 21.7 release.  All packages will be deleted, the base'
OPNsense 21.7 release.  All packages will be deleted, the base
+ echo 'system and kernel will be replaced, and if all went well the system'
system and kernel will be replaced, and if all went well the system
+ echo 'will automatically reboot.'
will automatically reboot.
+ [ -z '' ]
+ echo

+ echo -n 'Proceed with this action? [y/N]: '
Proceed with this action? [y/N]: + read YN
Y
+ [ -n '' ]
+ [ -n '' ]
+ echo

+ [ -n '' ]
+ rm -rf /usr/local/etc/pkg
+ rm -rf '/tmp/opnsense-bootstrap/*'
+ mkdir -p /tmp/opnsense-bootstrap
+ export 'ASSUME_ALWAYS_YES=yes'
+ [ -n '' ]
+ pkg bootstrap -f
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest, please wait...
pkg: Error loading trusted certificates
root@SAICE-OPNS:~ #


This is the output
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 02:26:57 PM
Thanks, looks like someone described it here:

https://lists.freebsd.org/pipermail/freebsd-stable/2014-February/077364.html

"Only when I commented out signature_type and fingerprints in /etc/pkg/FreeBSD.conf pkg update ran
without errors."

Edit file accordingly and try opnsense-bootstrap again.


Cheers,
Franco
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 02:32:16 PM
I did some hunting, and typed "man opnsense-bootstrap" and found an option listed.

opnsense-bootstrap -i

This doesn't stop on insecure certificates. Would that work?
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 02:35:10 PM
I thought about it but SSL certificates for the connection (-i) and fingerprints for packages (what the error is about) are separate things...
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: bradforr on March 18, 2022, 02:37:09 PM
I ran it anyway and the system updated.

Now busy with the upgrade to 22.1 without issue.

Thanks for the help.
Title: Re: pkg: pkg is not installed, therefore upgrade is impossible
Post by: franco on March 18, 2022, 02:40:04 PM
Ok, I see now that luckily -i skips the "pkg bootstrap -f" in the code. Nice catch. :)


Cheers,
Franco