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

Thread: How do I remove "residual config" through the Terminal?

  1. #1
    Join Date
    Feb 2012
    Beans
    2

    How do I remove "residual config" through the Terminal?

    The Synaptic Package Manager has the option to selection all of the unused packages in "Not Installed (Residual Config)" section.

    What I want to know is how do I do this in the Terminal?

    I have used the usual commands: apt-get clean/autoclean/autoremove but some unused packages still remain and show up in the Synaptic Package Manager and the Terminal:

    $ sudo apt-get clean && sudo apt-get autoremove --purge -y $(dpkg -l | grep '^rc' | awk '{print $2}')
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED
    (list of packages)
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    How can I use the same function that the Synaptic Package Manager has but in the Terminal?
    Last edited by Sevenleafbranch; February 13th, 2012 at 03:12 AM.

  2. #2
    Join Date
    Jun 2009
    Location
    Open Linux Forums
    Beans
    2,710

    Re: How do I remove "residual config" through the Terminal?

    try the command without the autoremove options:
    Code:
    $ sudo apt-get clean && sudo apt-get --purge -y $(dpkg -l | grep '^rc' | awk '{print $2}')
    autoremove is used to give apt-get control over what is selected for deletion, however you are providing your own list...
    I'm not antisocial. I'm just not user friendly...
    Open Linux Forums

  3. #3
    Join Date
    Sep 2011
    Beans
    457

    Re: How do I remove "residual config" through the Terminal?

    from here what do I do?:

    danel@danel-Dimension-4700:~$ sudo apt-get clean && sudo apt-get --purge -y $(dpkg -l | grep '^rc^ | awk '(print $2)')
    >

    I have no desire to remove every selected package that exists that isn't installed, as I would have to download it again, and it takes up a very very small amount of memory on the drive. But wouldn't opening synaptic package manager from the GUI, then selecting each package to uninstall do the trick? And I'm guessing the auto remove options would remove just about everything else

  4. #4
    Join Date
    Jun 2009
    Location
    Open Linux Forums
    Beans
    2,710

    Re: How do I remove "residual config" through the Terminal?

    an error seems to have creeped in:
    Code:
    $ sudo apt-get clean && sudo apt-get purge -y $(dpkg -l | grep '^rc' | awk '{print $2}')

    I would normally go for the autoremove thing, but you were saying that you wanted to delete all unused packages.
    I'm not antisocial. I'm just not user friendly...
    Open Linux Forums

  5. #5
    Join Date
    Nov 2006
    Beans
    1,204

    Re: How do I remove "residual config" through the Terminal?

    bleachbit is a good cleaning program

  6. #6
    Join Date
    Feb 2012
    Beans
    2

    Re: How do I remove "residual config" through the Terminal?

    None of the commands worked. They all did the same as the command I used. I ended up using aptitude.

    Is there any commands to achieve what I am asking?
    Last edited by Sevenleafbranch; February 19th, 2012 at 03:06 AM.

  7. #7
    Join Date
    Nov 2006
    Location
    Osaka, Japan
    Beans
    27
    Distro
    Kubuntu Intrepid Ibex (testing)

    Re: How do I remove "residual config" through the Terminal?

    Code:
    sudo apt-get purge $(dpkg -l | grep '^rc' | awk '{print $2}')
    seems to work for me. What errors are you facing? Can you try see if
    Code:
    dpkg -l | grep '^rc' | awk '{print $2}'
    gives you the list of packages with residual config?

  8. #8
    Join Date
    Dec 2008
    Beans
    11

    Re: How do I remove "residual config" through the Terminal?

    Worked well for me. Ubuntu 13.04 beta, Gnome 3.6.

    I couldn't use synaptic because when I clicked on the select window for "residual config" synaptic always crashed.

    Thanks!

    Quote Originally Posted by Syock View Post
    Code:
    sudo apt-get purge $(dpkg -l | grep '^rc' | awk '{print $2}')
    seems to work for me. What errors are you facing? Can you try see if
    Code:
    dpkg -l | grep '^rc' | awk '{print $2}'
    gives you the list of packages with residual config?

  9. #9
    Join Date
    Apr 2007
    Location
    NH USA
    Beans
    1,282
    Distro
    Ubuntu Development Release

    Re: How do I remove "residual config" through the Terminal?

    There seems to be a bit of confusion as to what the different options for apt-get actually do:

    The 'autoremove' option is used to remove packages that were installed as dependencies of another package that has since been removed (so long as no other package depends on them).

    If a package has "residual config", it means that the package was indeed uninstalled, but any configuration files were left behind, such that if you reinstall the package, it will be configured as it was. The 'purge' option uninstalls a package AND its configuration files, if any. This does NOT, BTW, include user's configuration data in their own home directory - it applies to system-wide configuration (e.g., stuff in /etc or /usr/share).

    The 'clean' option simply deletes the package deb files from /var/cache/apt - it doesn't uninstall anything, or remove any configuration data. Then you have to re-download the package if you want to reinstall it.

    Alas, I do not know of a way to remove residual config from the command line. I use Synaptic. The Janitor in Ubuntu Tweak will also deal with residual configs.

  10. #10
    Join Date
    Jul 2007
    Location
    Auckland, NZ
    Beans
    4,154
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How do I remove "residual config" through the Terminal?

    Quote Originally Posted by sgage View Post
    Alas, I do not know of a way to remove residual config from the command line. I use Synaptic.
    The command given in post #7 seems to work. I ran into the problem of synaptic crashing when trying to remove residual configs and was glad to find an alternative.

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
  •