list of installed ports?

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,589
Messages: 28,098

#6
ale said:
portversion -v (from ports-mgmt/portupgrade) is a lot faster (about 6s vs. 70s here).
It does require an additional port. Pkg_version and pkg_info are part of the base OS. I also doubt the speed. It takes a while for portversion to collect data before it produces output. Pkg_version immediately starts producing output. Which probably accounts for the apparent difference in speed.
 

ale

Daemon

Thanks: 166
Messages: 1,059

#7
SirDice said:
It does require an additional port. Pkg_version and pkg_info are part of the base OS.
Obviously, but if the OP is using portupgrade for upgrading his ports, portversion is free.

SirDice said:
I also doubt the speed. It takes a while for portversion to collect data before it produces output. Pkg_version immediately starts producing output. Which probably accounts for the apparent difference in speed.
Apparent?
Code:
$ time `pkg_version -v > /dev/null`

real	1m15.667s
user	0m41.320s
sys	0m12.968s

$ time `portversion -v > /dev/null`

real	0m7.332s
user	0m5.066s
sys	0m1.199s
(with 749 installed ports)
 

phoenix

Administrator
Staff member
Administrator
Moderator

Thanks: 1,177
Messages: 4,017

#9
Don't forget that portupgrade (and hence portversion) require two separate databases be installed and kept up-to-date (portsdb and pkgdb). All the portupgrade tools use these databases to pull their info, they don't use the /usr/ports/INDEX* or /var/db/pkg/* directly.

While it's not common, it is possible for the separate databases used by the portupgrade tools to become out-of-sync with the actual data in /var/db/pkg/* and/or /usr/ports/INDEX*, in which case you get incorrect results when using portversion.

Hence why, even though it may be slower, it's generally safer/more accurate to use pkg_version. (Plus, it's always nice to use the built-in tools.) :)

Just something to keep in mind.
 

jb_fvwm2

Daemon

Thanks: 180
Messages: 1,687

#10
Code:
ls -lac /var/db/pkg
-l -a -c == "lack", for that reason, I always have used it,
even aliasing it to a shorter version (one word)
............
I wouldn't have posted it here, but its output seems
easier to read (the names are on the right of the screen).
(its usage here, maybe not in other instances).
......................

Also weekly it may be wise to
Code:
ls -lac /var/db/pkg | tee -a vardMODA.YR
(month day year)
and copy it elsewhere. (You may be at another
computer wondering what ports you have installed and
have a backup copy available).
 

js

New Member


Messages: 2

#12
Thanks for the info. Been meaning to have a useful easy to refer to list of what ports are installed that can be emailed somewhere else regularly, and this has done the trick perfectly.
 

FKEinternet

Member

Thanks: 5
Messages: 65

#16
I did find a pointer to pkg in the mean time. When this thread shows up in a search (which is how I found it), it will now have more useful information. From somewhere else, the command I found to use is

pkg query --all '%o %n-%v %R'
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,589
Messages: 28,098

#18
I would use pkg version -vR because this also tells me which packages need updating.
 
Top