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

Thread: remove residual config packages/files from the command line

  1. #1
    Join Date
    Jun 2009
    Location
    Edinburgh, Scotland
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    remove residual config packages/files from the command line

    In synaptic, there's an option in the package manager to mark residual config files/packages for complete removal, and I'm wondering how to do this from the command line. I ran

    Code:
    sudo deborphan | xargs sudo apt-get purge -y
    sudo apt-get autoremove -y
    sudo apt-get clean
    but some packages still show up in synaptic, so clearly, these commands aren't removing everything. My main laptop runs a command line ubuntu interface with icewm on top, so I primarily use the command line, and I'd like to know how to remove residual config packages from the command line. Maybe something using dpkg -l to search for packages labeled "rc?" Thanks!

  2. #2
    Join Date
    Oct 2008
    Location
    colachel
    Beans
    517
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: remove residual config packages/files from the command line

    Hi

    For complete removal

    sudo apt-get purge packagename


    more info

  3. #3
    Join Date
    Jun 2009
    Location
    Edinburgh, Scotland
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: remove residual config packages/files from the command line

    I know about apt-get purge, but what if I don't remember what the packages are? When I looked in synaptic in gnome, there were packages from a while back that still had config files left all over my system, so is there a way from the command line to run purge for all packages that have already been installed? Thanks!

  4. #4
    Join Date
    Oct 2008
    Location
    colachel
    Beans
    517
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: remove residual config packages/files from the command line


  5. #5
    Join Date
    Jun 2009
    Location
    Edinburgh, Scotland
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: remove residual config packages/files from the command line

    Let me rephrase my question... How can I use "dpkg -l" or "dpkg-query" so it will only show the output of packages labeled as "rc?" (As opposed to those labeled "ii" etc). Thanks!

  6. #6
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: remove residual config packages/files from the command line

    Maybe this will do?
    Code:
    dpkg-query -W -f='${Package}\t${Status}\n' | awk '/deinstall/{print $1}'

  7. #7
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: remove residual config packages/files from the command line

    The CLI equivalent of Synaptic is aptitude. Run sudo aptitude in a terminal. More info here: http://algebraicthunk.net/~dburrows/...titude/doc/en/
    It's a few years old, but the commands are still the same.

  8. #8
    Join Date
    Jun 2009
    Location
    Edinburgh, Scotland
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: remove residual config packages/files from the command line

    Quote Originally Posted by unutbu View Post
    Maybe this will do?
    Code:
    dpkg-query -W -f='${Package}\t${Status}\n' | awk '/deinstall/{print $1}'
    Thank you! I really appreciate the help!

  9. #9
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: remove residual config packages/files from the command line

    Code:
    aptitude search '~c'
    will show you uninstalled packages that still have configuration around. With the -F option you can have it only print the package name (%p)
    Code:
    aptitude -F %p search '~c'
    See the aptitude readme for more; /usr/share/doc/aptitude/README

  10. #10
    Join Date
    Jun 2009
    Location
    Edinburgh, Scotland
    Beans
    545
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: remove residual config packages/files from the command line

    To save space in on my laptop, I've actually uninstalled aptitude... because I tend to use apt-get. Once I get back to my apartment, I'll check to see if similar commands apply. Thanks for the help!

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
  •