Synaptic 'rollback' function?

Toby Kelsey toby_kelsey at ntlworld.com
Mon May 8 20:05:32 UTC 2006


>>>>Or in other words, would it be possible to set/save the current state of
>>>>all installed packages,
>>>
>>>dpkg --get-selections > my-selections.txt
>>>
>>>
>>>>and then roll back to that savepoint?
>>>
>>>dpkg --set-selections < my-selections.txt
>>>apt-get dselect-upgrade

I just tried an experiment to see what happens:

root:~ # dpkg --get-selections > set1
root:~ # wc -l set1
1721 set1

Now after I install gnome-pim (from Universe) with Synaptic.

root:~ # dpkg --get-selections > set2
root:~ # diff set1 set2
311a312
> gnome-pim                                     install

So far so good. Now to rollback:

root:~ # dpkg --set-selections < set1
root:~ # apt-get dselect-upgrade
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root:~ # dpkg --get-selections > set3
root:~ # diff set2 set3

Oops, no effect. Lets try these commands:

root:~ # apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root:~ # dselect install
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Do you want to erase any previously downloaded .deb files? [Y/n]
Press enter to continue.

root:~ # dpkg -l gnome-pim
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                                        Version
            Description
+++-===========================================-===========================================-======================================================================================================
ii  gnome-pim                                   1.4.9-2.2
            calendar and address book for GNOME
root:~ # dpkg --get-selections > set4
root:~ # diff  set2 set4

It's still installed. So it looks like you cannot get a 'rollback' effect with
dpkg.  The man-page only mentions using --set-selections for duplicating a
package set on a different machine.

It's also clear why it cannot do what you want.  In the above example there is
no way for 'set1' to communicate that you will want to remove gnome-pim later
(dpkg doesn't treat it as an exhaustive list).  The only way to do it is to
compare the selections and explicitly deselect any new packages.

This functionality should be added to Synaptic IMHO.

HTH,
Toby




More information about the ubuntu-users mailing list