PDA

View Full Version : [ubuntu] DPKG (--get-selections --set-selections) usage.



Nibinaear
June 26th, 2010, 08:32 PM
Hi. I am trying to find a way of backing up my packages or at least the names of them and then reinstall them after a complete format and reinstall.

I've found the dpkg function and have used the get-selections command to backup the package names. I'm now trying to run the set-selections command to test out the file but I get the error:

dpkg: need an action option

Here is what I'm trying to run:

dpkg −−set−selections < /home/daniel/get-selections

get-selections is my input file. So what am I doing wrong please?

oldfred
June 27th, 2010, 12:32 AM
I had it in my home and just ran it without the /home/fred

# Finally, install all the packages from previous install
# must have saved ubuntu-files from previous install to this directory
dpkg --set-selections < ubuntu-files
apt-get -y update
apt-get dselect-upgrade

Nibinaear
June 27th, 2010, 11:01 AM
I had it in my home and just ran it without the /home/fred


Thanks oldfred. Seemed to work.

Just to clarify, I used cd to get to the right directory and then ran the --set-selections command without the full directory.