Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Any way to use dpkg to rollback recently installed packages?

  1. #1
    Join Date
    Feb 2010
    Location
    U.K.
    Beans
    782
    Distro
    Ubuntu 12.04 Precise Pangolin

    Any way to use dpkg to rollback recently installed packages?

    Hi,

    Using Ubuntu Lucid with Gnome desktop.

    I was just playing around trying to find a media player I liked and installed Bangarang via the Software Centre. This took an absolute age and now I realise why - it has basically installed the entire KDE environment and associated lib packages as well.

    I have found /var/log/dpkg.log shows what has been installed and of course I can wade through that to make a list of all the packages and uninstall them all via Synaptic. But that will take a long time to do.

    Is there anyway to somehow automate rolling back any package changes since a certain time?

    I've checked the man for dpkg and I can't see any mention of anything like this.

    Any ideas?

    Thanks

  2. #2
    Join Date
    Jul 2005
    Beans
    294
    Distro
    Ubuntu

    Re: Any way to use dpkg to rollback recently installed packages?

    Quote Originally Posted by cryptotheslow View Post
    Hi,

    Using Ubuntu Lucid with Gnome desktop.

    I was just playing around trying to find a media player I liked and installed Bangarang via the Software Centre. This took an absolute age and now I realise why - it has basically installed the entire KDE environment and associated lib packages as well.

    I have found /var/log/dpkg.log shows what has been installed and of course I can wade through that to make a list of all the packages and uninstall them all via Synaptic. But that will take a long time to do.

    Is there anyway to somehow automate rolling back any package changes since a certain time?

    I've checked the man for dpkg and I can't see any mention of anything like this.

    Any ideas?

    Thanks
    First thing to try:
    Go to command line (open terminal):
    1) sudo apt-get remove bangarang
    Should tell you about automatically installed packages being no longer needed.
    2) sudo apt-get autoremove


    More hardcore way (if the first does not work):
    1) copy /var/log/dpkg.log somewhere and edit so that each line contains only name of a package you want to remove. Call the file toremove.txt
    2) sudo apt-get remove `cat toremove.txt`

    Read carefully the list of packages in each case that apt-get wants to remove.

  3. #3
    Join Date
    Feb 2010
    Location
    U.K.
    Beans
    782
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Any way to use dpkg to rollback recently installed packages?

    Thanks for the reply

    Option 1 only gave 1 other package to auto-remove (as below)

    Looks like I am back to manually going through the dpkg log to compile a list of packages to remove and then feed it into your option 2.

    Should speed things up a little... and lesson learnt.... use Synaptic to install new packages so I get to see the dependencies before committing. Would be nice if the Software Centre popped up a message along the lines of "This application is intended for use with the KDE desktop environment - you do not currently have this installed - are you sure you want to proceed?" (Yes/No) type question in these cases.

    In fact I think it may be less effort and time to clean install Lucid than wade through that log to work out what to remove. Thankfully I separated out /home to its own partition on the last install.

    Code:
    graham@gt-desktop:~$ sudo apt-get remove bangarang
    [sudo] password for graham: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      libkcddb4
    Use 'apt-get autoremove' to remove them.
    The following packages will be REMOVED
      bangarang
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    After this operation, 1,499kB disk space will be freed.
    Do you want to continue [Y/n]? y
    (Reading database ... 162233 files and directories currently installed.)
    Removing bangarang ...
    Processing triggers for man-db ...
    Processing triggers for hicolor-icon-theme ...
    Processing triggers for desktop-file-utils ...
    Processing triggers for python-gmenu ...
    Rebuilding /usr/share/applications/desktop.en_GB.utf8.cache...
    Processing triggers for python-support ...
    graham@gt-desktop:~$ sudo apt-get autoremove
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED
      libkcddb4
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    After this operation, 725kB disk space will be freed.
    Do you want to continue [Y/n]? y
    (Reading database ... 162174 files and directories currently installed.)
    Removing libkcddb4 ...
    Processing triggers for libc-bin ...
    ldconfig deferred processing now taking place
    graham@gt-desktop:~$

  4. #4
    Join Date
    Nov 2009
    Beans
    598
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Any way to use dpkg to rollback recently installed packages?

    If you search on Google for Pyschocats, an ubuntu oriented website about desktop environments, there's a code to remove KDE. Which will remove everything that media player installed.

    Much easier than reinstalling Ubuntu.

    Edit:

    Code:
    sudo apt-get remove akonadi-server akregator amarok amarok-common amarok-utils apport-kde apturl-kde ark cdrdao dolphin dragonplayer exiv2 foomatic-db-gutenprint freespacenotifier gdebi-kde gnupg-agent gtk2-engines-qtcurve gwenview hpijs-ppds ibus-qt4 icoutils ijsgutenprint install-package jockey-kde k3b k3b-data kaddressbook kamera kate kbluetooth kcalc kcm-gtk kcm-touchpad kde-window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma kdebase-runtime kdebase-runtime-data kdebase-workspace kdebase-workspace-bin kdebase-workspace-data kdebase-workspace-kgreet-plugins kdegraphics-strigi-plugins kdelibs-bin kdelibs5 kdelibs5-data kdemultimedia-kio-plugins kdepasswd kdepim-groupware kdepim-kresources kdepim-runtime kdepim-strigi-plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdesudo kdm kfind khelpcenter4 klipper kmag kmail kmix kmousetool knm-runtime knotes konqueror konqueror-nsplugins konqueror-plugin-searchbar konsole kontact kopete kopete-message-indicator korganizer kpackagekit kppp krdc krfb krosspython ksnapshot ksysguard ksysguardd ksystemlog ktimetracker ktorrent ktorrent-data kubuntu-debug-installer kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-firefox-installer kubuntu-konqueror-shortcuts kubuntu-notification-helper kvkbd kwalletmanager language-selector-qt libakonadiprivate1 libao2 libattica0 libaudio2 libboost-program-options1.40.0 libclucene0ldbl libdbusmenu-qt2 libepub0 libexiv2-6 libflac++6 libibus-qt1 libindicate-qt0 libiodbc2 libk3b6 libkcddb4 libkdcraw8 libkdecorations4 libkdepim4 libkephal4 libkexiv2-8 libkfontinst4 libkipi7 libkleo4 libkonq5 libkonq5-templates libkonqsidebarplugin4 libkopete4 libkpgp4 libkscreensaver5 libksgrd4 libksieve4 libksignalplotter4 libkwineffects1 libkworkspace4 liblastfm0 libmimelib4 libmng1 libmodplug0c2 libmpcdec3 libmsn0.3 libmysqlclient16 libokularcore1 libotr2 libpackagekit-glib2-12 libpackagekit-qt-12 libphonon4 libplasma-applet-system-monitor4 libplasma-geolocation-interface4 libplasma3 libplasmaclock4 libplasmagenericshell4 libpolkit-qt-1-0 libpoppler-qt4-3 libprocesscore4 libprocessui4 libqca2 libqca2-plugin-ossl libqimageblitz4 libqt4-assistant libqt4-dbus libqt4-designer libqt4-help libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-scripttools libqt4-sql libqt4-sql-mysql libqt4-sql-sqlite libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libqtscript4-core libqtscript4-gui libqtscript4-network libqtscript4-sql libqtscript4-uitools libqtscript4-xml libsolidcontrol4 libsolidcontrolifaces4 libsoprano4 libssh-4 libstreamanalyzer0 libstreams0 libtag-extras1 libtaskmanager4 libvncserver0 libweather-ion4 libxcb-shape0 libxcb-shm0 libxcb-xv0 libxine1 libxine1-bin libxine1-console libxine1-misc-plugins libxine1-x libzip1 mysql-client-core-5.1 mysql-common mysql-server-core-5.1 network-manager-kde okular okular-extra-backends openoffice.org-kde openoffice.org-style-oxygen oxygen-cursor-theme oxygen-icon-theme oxygen-icon-theme-complete packagekit packagekit-backend-apt phonon phonon-backend-xine pinentry-gtk2 pinentry-qt4 plasma-dataengines-addons plasma-dataengines-workspace plasma-desktop plasma-scriptengine-javascript plasma-scriptengine-python plasma-widget-facebook plasma-widget-folderview plasma-widget-kimpanel plasma-widget-kimpanel-backend-ibus plasma-widget-kubuntu-feedback plasma-widget-message-indicator plasma-widget-quickaccess plasma-widgets-addons plasma-widgets-workspace plymouth-theme-kubuntu-logo polkit-kde-1 printer-applet python-kde4 python-packagekit python-qt4 python-qt4-dbus python-sip quassel quassel-data shared-desktop-ontologies software-properties-kde soprano-daemon system-config-printer-kde systemsettings ttf-dejavu ttf-dejavu-extra update-manager-kde usb-creator-kde userconfig virtuoso-nepomuk && sudo apt-get install ubuntu-desktop

  5. #5
    Join Date
    Feb 2010
    Location
    U.K.
    Beans
    782
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Any way to use dpkg to rollback recently installed packages?

    I have no idea what version of Ubuntu that code was intended for and have no way of knowing if that remove list is sane or not. I appreciate the help 100% but there is no way I am blindly going to copy/paste an apt-get remove like that.

    I'm back to weighing up the time required to clean install vs wading through a few thousand lines of dpkg log to uninstall this mess.

    I'm leaning towards clean install right now.

  6. #6
    Join Date
    Nov 2009
    Beans
    598
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Any way to use dpkg to rollback recently installed packages?

    I told you the website. http://www.psychocats.net/ubuntu/index

    Its the code to remove KDE, check it yourself.

    The code is designed for Ubuntu 10.04. There are also versions for 9.10 and previous.

    Its against the Code of Conduct terms of the Ubuntu forum to post malicious codes, no exceptions. I don't plan on breaking that rule any time soon. I've used the code myself with no problems.

  7. #7
    Join Date
    Jul 2005
    Beans
    294
    Distro
    Ubuntu

    Re: Any way to use dpkg to rollback recently installed packages?

    Also, unless you
    1) have a very small hard drive
    or
    2) want to be a purist for some reason and don't want to have any of "KDE stuff polluting your computer";
    then the best thing might just be leave the packages installed. You might find that you will enjoy some of the KDE programs. E.g. my personal preference was to run Gnome, although lately I have been gravitating towards using LXDE. I still keep full Gnome and most of KDE installed on my computers. K3B and Digikam (IMHO) are two programs that are much better than their non-KDE alternatives. Amarok used to be also a killer program, but I gave up on it when they went to version 2.0 with a fresh code-base (and Rhythmbox and Banshee advanced).

    I know this is OT, but this might be the easiest long run solution.

  8. #8
    Join Date
    Feb 2006
    Location
    Arizona
    Beans
    444
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Any way to use dpkg to rollback recently installed packages?

    +1
    ...the best thing might just be leave the packages installed.
    If you are not starving for hard drive space, just leave the KDE stuff there. It doesn't hurt anything, doesn't take up resources other than hard drive space, and doesn't harm or degrade your system performance in the slightest way.
    XFCE, From Now On!

  9. #9
    Join Date
    Mar 2009
    Location
    /dev/random
    Beans
    14
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Lightbulb Re: Any way to use dpkg to rollback recently installed packages?

    Did you install all of the packages on the same day? You can use this grep/sed/xargs pipeline to give you a list of all packages you installed on one day:
    Code:
    grep -E "$INSTALLDATE [0-9: ]* status installed" /var/log/dpkg.log | sed  "s_$INSTALLDATE [0-9: ]* status installed__"  | sed 's_[a-z0-9.\-]*$__' | xargs
    But replace "$INSTALLDATE" with the day you installed the packages in YYYY-MM-DD format. Then, conceivably, you could pipe it to apt-get purge.

  10. #10
    Join Date
    Jul 2005
    Beans
    294
    Distro
    Ubuntu

    Re: Any way to use dpkg to rollback recently installed packages?

    Also fairly simple solution that accomplishes most of this: remove one of the key libraries of KDE and let APT remove everything that depends on it. Just pay attention that you don't remove anything else.

    On my little EEE I would get rid of most of KDE with:
    Code:
    sudo apt-get remove kdelibs-bin
    sudo apt-get autoremove
    Last edited by gaussian; May 31st, 2010 at 04:19 PM. Reason: typo

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •