sudo -H pip freeze > requirements.txt
source: http://askubuntu.com/questions/24022/how-can-i-backup-my-repositories
tar cvzf sources.tar.gz /etc/apt/sources.list.d/
Or use y-ppa-manager
source: http://askubuntu.com/questions/17823/how-to-list-all-installed-packages
# Create a backup of what packages are currently installed:
dpkg --get-selections > list.txt
# Then (on another system) restore installations from that list:
dpkg --clear-selections
sudo dpkg --set-selections < list.txt
# To get rid of stale packages
sudo apt-get autoremove
# To get installed like at backup time (i.e. to install packages set by dpkg --set-selections)
sudo apt-get dselect-upgrade
# or
sudo apt-get -u dselect-upgrade
A very important point to remember is that it will break dependencies. Read comments on http://askubuntu.com/a/17829/258167
So I will use this to compare with the fresh installed Ubuntu and check what are the packages I had earlier installed which are not installed by default in the fresh Ubuntu OS.