Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a FreeBSD 8.2-RELEASE system which I now upgrading to 9.0-RELEASE. In this process I need to rebuild all my ports installed.
How can I list the date of last build for each installed port, to be sure, everything was rebuilt now.
I used portmaster -af to rebuild everything, but when some build error happens, I continue with the command it gives in the end (with names of the folloing packages in its argument), but I would like to be sure that everything was rebuilt now.

share|improve this question
up vote 2 down vote accepted

ls -Alt /var/db/pkg | grep '/$' | tail -n 20 should show 20 oldest apps installed from ports.

Also, pkg_version -vIL= command could be usefult to compare versions of installed ports and ports in updated tree.

share|improve this answer
1. the ls -Alt /var/db/pkg | grep '/$' | tail -n 20 gives me empty result, because grep '/$' matches zero lines. I greatly appreciate your answer. So if I mean well the folder dates in /var/db/pkg means the build dates of each package? – netmano Oct 30 '12 at 7:46
Yes, contents of those directories displays actions associated with any of installed port and lists of its files. So, if some of ports was changed or updated, last access time of appropriate directory will be changed too. By the way, you can remove | grep '/$' from command (I used it to filter only dirs in ls output). – hangover Oct 30 '12 at 7:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.