Will my MacPorts install continue to work after installing a new major OS release or migrating to a new machine with a different CPU architecture? In general the answer is no. See Migration for how to get things working again.
Ubuntu:
do-release-upgrade
...
apt-get install $package
There's a 99% chance that will Just Work (tm). The other 1%, well, likely something's not right to begin with (wrong apt sources, etc.) or it's an edge case.
Look, I love my Macbook, but I choose to run VirtualBox with Windows 7 and Ubuntu because I feel that while it does a great job of some things, it's poor at best at other things in comparison to other OSs. One of those things is having a core, reliable package management system: when it's time to release some new code and/or configuration changes for a client, I don't want to get burnt by a 3rd-party package system not working as expected.
If A = B and B = C, then A = C, except where void or prohibited by law. -- Roy Santoro