What is the difference between the following?
sudo apt-get update
sudo apt-get upgrade
and
dpkg --get-selections | grep -v deinstall > ubuntu-files
plus
sudo dpkg --set-selections < ./ubuntu-files
sudo apt-get -y update
sudo apt-get -u dselect-upgrade
The 1st part is just a normal update/upgrade.
The last part is about saving your package list and restoring them into a new system.
Let's say you have a crashed system and can get to a commandprompt.
pkg --get-selections|grep -v deinstall>ubuntu-files
makes a file list of all installed packages (when usingapt-get
!). You save that file on a FDD, USB stick or disc.After you installed your new system you copy that backup to
/tmp/
andsudo dpkg --set-selections <./ubuntu-files
will set it up andwill install only those packages you had installed (with apt-get) in the older system.