There are ways that you could do this for an OS, but I'm not sure how transferable from distro to distro it would be. You could do it (using apt & dpkg) for Debian based distros and it would probably work fairly consistently. But there are plenty of distros that don't use apt/dpkg and so it almost certainly wouldn't work for those. E.g. Fedora uses yum and I don't recall what Arch uses.
So probably the best/most transferable way would be to keep a text file of the apps you want... Even then though it won't be foolproof as different distros often even have slightly different naming conventions.
As per your edited answer (keeping it to Ubuntu) a quick and dirty way to list all packages installed would be
apt-cache pkgnames > apps.txt
Note though that that will list all installed packages; not just the ones that you explicitly installed. So if you switch between different Ubuntu versions which have different desktop environments it will be a bit of an issue... It also will list dependencies (that weren't manually installed - so they won't be auto flagged as unneeded if you uninstall the manually installed software).
To minimize the impact of that (although not eliminate it) you could rerun the command on a clean install of the same version (say before you switch to Lubuntu for example). Then clean the first list using the results of the second...
apt-cache pkgnames > clean-install-apps.txt
grep -v -x -f clean-install-apps.txt apps.txt > new-apps.txt
You can then install with this:
sudo apt-get update && sudo apt-get install < new-apps.txt
Keep in mind though that this will manually install the dependencies as well. Also it won't include all the config info (if you've configured those apps the way that you want them... Generally this is kept in your home dir in dot directories (e.g. directories like ".appname". So in theory you could mount your home dir in a different directory and just remount it each time. Even then though it may not work if you are using different distros or version as the software versions may not be the same (shouldn't be an issue if you are using the same version of Ubunut though; e.g. 15.04)...
One other thought that I've had for a quick and dirty way to do this and probably make the installation quicker (and reduce your download bandwidth of that is a concern) would be to copy all the deb packages in /var/cache/apt/archives to a USB (or a separate partition, etc). Then you can install all the debs with dpkg. Assuming that your USB is mounted on /media/USB that would look something like this, on your current system:
mkdir /media/USB/debs-to-install
cp /var/cache/apt/archives/*.deb /media/USB/debs-to-install
Then after reinstall:
dpkg -i --force-depends /<USB-dir>/*.deb
apt-get install -f
Explanation:
dpkg -i
installs
--force-depends
forces install even if dependencies aren't satisfied (generally not recommended but in this case it's ok because it's almost guaranteed that all the dependencies are there in that directory; just that they aren't being installed in the right order).
apt-get install -f
should solve any dependency issues (if there are any).
Note that this second option will also make dependencies marked as manually installed too...
There are also other options as noted as answers to this question: How to list all installed packages
Copying out the debs (sort of like Win installer exes) like I said above is maybe the closest you will get to what I think you are asking for.
– Jeremy Davis Jun 26 '15 at 12:16/usr/local/bin
to a different partition; install x in/usr/local/bin
; if something goes wrong reinstall, delete newly created/usr/local/bin
and mount the one on the different partition in its place. I have no idea if this is possible in any way. – Three Diag Jun 26 '15 at 12:23