On debianized linux distros there is dpkg --get-selections, dpkg --set-selections, dpkg -C to respectively list installed packages, select a list of packages for installations, and list packages that are in a partially installed or broken state. I am wondering if something like this exists for FreeBSD (ports, not packages). I can get the list from pkg_info, but is there a simple way to apply it without cut, for port in list, cd, make install?

  • When you ask this kind of questions, you should describe what the commands you're used to do (like I've done). Otherwise only people who know both systems have a chance to answer. This way someone who only knows FreeBSD has a chance. – Gilles 'SO- stop being evil' Apr 9 '11 at 15:45
  • Sorry Gilles. I haven't probed too deeply into this one(still a FreeBSD n00b, although I do have gnome/flash on native firefox/general multimedia working). – RobotHumans Apr 11 '11 at 17:33

/usr/ports/ports-mgmt/portmaster man page has example how to do bulk port re-install.

  • Thanks. I was using portsnap/portupgrade/portaudit. I hadn't looked into portmaster. The relevant example/switch was --list-origins. – RobotHumans Apr 11 '11 at 17:34

If you want to stick with portupgrade, "portupgrade --all" will upgrade all ports that have newer versions available. The "--force" flag can be used to force a re-install or downgrade of a specified port if you know it's broken.

You can get a list of the current versions of your installed ports and whether newer versions are available in your ports tree with "portversion --fullname --verbose".

I don't know of a tool that automatically detects partially installed ports.

  • Thanks for the effort. I was looking for a batch install type of thing for installing all currently installed packages on another clean box. AlexD had what I was looking for covered. – RobotHumans Jun 21 '11 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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