Solved portupgrade no longer finds any ports to update

FreeBSD rpi2.sentry.org 11.2-BETA3 FreeBSD 11.2-BETA3 #0 r334313: Sat Jun 2 08:22:41 AEST 2018 root@rpi2.sentry.org:/home/obj/usr/src/sys/RPI2 arm

Before the recent upgrade from source to the above, the Raspberry Pi2 was running 11.1-PRE-RELEASE.

Code:
root@rpi2 [/root] # portupgrade -a
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 0 packages found (-0 +0)  nothing to do]

Yet pkg info correctly lists 165 ports as installed :)

curl 7.55.1 is installed; curl-7.60.0 is in the (recently updated) ports directory

Code:
root@rpi2 [/root] # portupgrade curl
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 0 packages found (-0 +0)  nothing to do]

I've tried deleting portupgrade and reinstalling it to no effect.

Any other ideas?
 
I have an idea, but it might not be a popular one (no offense here): consider using ports-mgmt/portmaster instead and drop this tool.

The only reason I mention this is because from what I can tell portupgrade is plain out ancient if not obsolete. I base myself on things I've read on these forums but also when looking at pkg-descr:

Code:
This package also includes the following utilities:
portinstall:    Helps you install new ports in a handy way.
portcvsweb:     Instantly lets you browse change history via CVSweb.
portversion:    Replaces pkg_version(1) and helps you upgrade packages
                with portupgrade(1). (runs much faster)
portsclean:     Cleans ports workdir's, unreferenced distfiles,
                old and orphan shared libraries, and stale packages.
portsdb:        Creates binary database from the ports INDEX.
ports_glob:     Expands ports globs.
pkg_deinstall:  Wraps pkg_delete(1) and provides additional features.
See, tools like pkg_version, pkg_delete and so on have been replaced with pkg quite some years ago. Those tools are no longer used anymore on FreeBSD. Making me conclude that this project hasn't kept up with modern times.

Something I can actually back up if you look at their Github repository: last update was on the 16th of April 2012 (time of writing).

So yeah, I strongly suggest you replace this for another tool, I mentioned my personal preference above.
 
You need to update your ports first.
portsnap auto

then you can check if there's new version.
pkg ver -vL=

when you are updating all ports you need to use recursive option "-r"
portupgrade -ra
 
Latest release: portupgrade 2.4.16 (release 2018-03-09)
I stand corrected, good find.

In the mean time I downloaded the port on my Jail to see how this responded and well... I do want to urge a warning that this tool isn't always the most efficient:

Code:
root@psi:/usr/local/bin # time pkg_which ./unzoo
unzoo-4.4_2
1.282u 0.407s 0:02.76 60.8%     217+172k 26+0io 0pf+0w
root@psi:/usr/local/bin # time pkg which ./unzoo
/usr/local/bin/unzoo was installed by package unzoo-4.4_2
0.000u 0.037s 0:00.03 100.0%    240+186k 2+0io 0pf+0w
Even if I change the sequence (use pkg first, then pkg_which) to try and rule out any caching then I get the same results. Maybe something to keep in mind....

But back to your problem:

Code:
root@psi:/usr/local/bin # portupgrade -a
[Reading data from pkg(8) ... - 73 packages found - done]
[Updating the portsdb <format:bdb_btree> in /usr/ports ... - 32591 port entries found .........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000.........18000.........19000.........20000.........21000.........22000.........23000.........24000.........25000.........26000.........27000.........28000.........29000.........30000.........31000.........32000..... ..... done]
^C
Interrupted.
If you compare this with your example above you'll see that my setup uses pkg somehow while your setup only mentions pkgdb and /var/db/pkg whereas my example points to /usr/ports.

Which now makes me wonder: did you set up /usr/local/etc/pkgtools.conf by any chance, and if so: what's in there? Is it possible that something got mis-configured which now seems to point your portupgrade version to a non-existing package database? (at least that's my theory right now).

My suggestion would be to move this conf file temporary out of the way, then try using: # portupgrade -an to see if that changes anything.

Hope this can help a bit!
 
I removed /usr/local/etc/pkgtools.conf which was identical to the /usr/local/etc/pkgtools.sample and:

Code:
root@rpi2 [/usr/local/etc] $ portupgrade -an 
--->  Session started at: Mon, 04 Jun 2018 16:17:21 +1000
** None has been installed or upgraded.
--->  Session ended at: Mon, 04 Jun 2018 16:17:21 +1000 (consumed 00:00:00)

Dang!

If you compare this with your example above you'll see that my setup uses pkg somehow while your setup only mentions pkgdb and /var/db/pkg whereas my example points to /usr/ports.

Indeed that does appear to be the issue. Now to solve it :-)

Hope this can help a bit!

It does, thanks!
 
Looks like the problem was being caused by pkg ! I had version 1.10.1 installed. On updating it to 1.10.5 using pkg install pkg, portupgrade has started to work again :-)

Code:
root@rpi2 [/usr/sbin] $ portupgrade curl
[Reading data from pkg(8) ... - 166 packages found - done]
--->  Upgrading 'curl-7.55.1' to 'curl-7.60.0' (ftp/curl)
--->  Building '/usr/ports/ftp/curl'
 
Back
Top