LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Set the status of "purge" packages - dpkg --get-selections (https://www.linuxquestions.org/questions/debian-26/set-the-status-of-purge-packages-dpkg-get-selections-695979/)

kushalkoolwal 01-08-2009 07:41 PM

Set the status of "purge" packages - dpkg --get-selections
 
On doing following on my Lenny system:

Code:

dpkg --get-selections > packages.txt
I got the following output with some packages' status as "purge" or "deinstall" like this:

Code:

................
libsepol1                                      install
libsigc++-2.0-0c2a                              deinstall
libslang2                                      install
libsplashy1                                    install
libss2                                          install
libssl0.9.8                                    install
libstdc++6                                      install
libsysfs2                                      install
libtext-charwidth-perl                          install
libtext-iconv-perl                              install
libtext-wrapi18n-perl                          install
libts-0.0-0                                    install
libusb-0.1-4                                    install
libuuid1                                        install
libvolume-id0                                  install
libwrap0                                        install
libx11-6                                        install
libx11-data                                    install
libxapian15                                    deinstall
....................
logrotate                                      install
lsb-base                                        install
lsof                                            install
lzma                                            purge
make                                            install
makedev                                        install
man-db                                          install
manpages                                        install
mawk                                            install
mdetect                                        install
minicom                                        install
mktemp                                          install
module-init-tools                              install
mount                                          install
nano                                            install
ncurses-base                                    install
ncurses-bin                                    install
net-tools                                      install
netbase                                        install
openssh-blacklist                              purge
openssh-client                                  install
openssh-server                                  install
passwd                                          install
.............

The packages are shown as purge because I had attempted to remove them but was not able to remove them because of dependency errors.

Also the packages that are shown as "deinstall" are removed on my system. How do I remove these packages from the listing.

How do I set the status of those packages (which are shown as "pruge") back to "install" again? I am fine with not removing them.

I use apt-get as my package manager.

kushalkoolwal 01-08-2009 08:01 PM

Sorry folks. I think I found the answer to this one. If anybody wants to know just let me know and I will post it.

Thanks

the trooper 01-09-2009 08:34 AM

I'd be interested in the solution.

farslayer 01-09-2009 09:00 AM

That listing is used if you wish to setup an identical system as far as packages go.

Packages that are installed by default in the system will be listed as purged or de-install so the new system you transfer this package list to will know that is what it is supposed to do with those packages


Original System
Code:

dpkg --get-selections > packages.txt
copy the packages.txt file to the new machine
Code:

dpkg --set-selections < packages.txt

apt-get dselect-upgrade

The new machine will now install and remove packages according to what is in the list. .

the trooper 01-09-2009 09:42 AM

Thanks Farslayer.
Is it possible to use the apt-get dselect-upgrade command with aptitude instead?.Or does it not matter in this case.

Regards.
The trooper.

farslayer 01-09-2009 10:17 AM

I don't believe aptitude is aware of the dselect-upgrade option. This means packages wont get flagged as automatically installed by Aptitude.

Since this is typically the fist thing you would do on a system if you were going for an identical packages selection, I would probably just do the apt-get dselect-upgrade then follow it up with aptitude keep-all, and use aptitude from that point forward.




Sure wish I could find a more recent reference for that info..

the trooper 01-09-2009 10:33 AM

Quote:

Originally Posted by farslayer (Post 3402471)
I don't believe aptitude is aware of the dselect-upgrade option. This means packages wont get flagged as automatically installed by Aptitude.

Since this is typically the fist thing you would do on a system if you were going for an identical packages selection, I would probably just do the apt-get dselect-upgrade then follow it up with aptitude keep-all, and use aptitude from that point forward.




Sure wish I could find a more recent reference for that info..

Just goes to prove you learn something new everyday!
Will make a note of this.

kushalkoolwal 01-09-2009 11:48 AM

Ooops...Sorry for the delay....Looks like farslayer has posted the solution already. Thank you.


All times are GMT -5. The time now is 07:59 AM.