Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
1  
Manual that explains it all and more: debian.org/doc/manuals/debian-reference/ch02.en.html#s-record –  Rinzwind Nov 18 '11 at 9:26
    
in sudo apt-get -u dselect-upgrade what does dselect do –  Newbi Nov 18 '11 at 9:48
    
By the way... your code is flawed. I added i a - and sudo apt-get -y update. Plus I put a break in the last set: the 1st command you issue on your OLD install. The other 3 on the new install ;) –  Rinzwind Nov 18 '11 at 9:59

1 Answer 1

up vote 1 down vote accepted

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 using apt-get!). You save that file on a FDD, USB stick or disc.

After you installed your new system you copy that backup to /tmp/ and sudo dpkg --set-selections <./ubuntu-files will set it up and

apt-get -y update
apt-get dselect-upgrade

will install only those packages you had installed (with apt-get) in the older system.

share|improve this answer
    
why should we do "apt-get dselect-upgrade" what will happen if i do "apt-get upgrade" –  Newbi Nov 18 '11 at 11:14
    
Like it said in the answer: dselect installs the selected files from the file. upgrade will upgrade -all- packages. –  Rinzwind Nov 18 '11 at 11:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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