Results 1 to 6 of 6

Thread: What is the best way to remove unnecessary packages?

  1. #1
    Join Date
    Jul 2011
    Beans
    264

    What is the best way to remove unnecessary packages?

    I got the following message while trying to install ("sudo apt-get install ...") a new package:
    The following packages were automatically installed and are no longer required:
    gir1.2-ubuntuoneui-3.0 linux-headers-3.2.0-56 libubuntuoneui-3.0-1 linux-headers-3.2.0-56-generic-pae
    linux-headers-3.2.0-56-generic
    Use 'apt-get autoremove' to remove them.
    I do not understand why suggestion to remove unnecessary packages comes while trying to install a new package. How do I know these are the only package which are no longer required? may be when I try to install some other package, I will get names of some more packages which are not required as well. Is the command "autoremove" the best for this purpose?

  2. #2
    Join Date
    Jul 2007
    Location
    UK
    Beans
    17,059
    Distro
    Ubuntu Development Release

    Re: What is the best way to remove unnecessary packages?

    The package manager is merely informing a user that some packages are redundant as part of the normal operation of it.

    sudo apt-get autoremove

    will do the job.

    Also see this.

    man apt-get

  3. #3
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the best way to remove unnecessary packages?

    The suggestion to remove unnecessary packages is not coming because we are installing a new package but because we are in effect running the apt-get update and the apt-get upgrade combination.

    Installing/upgrading can make some libraries obsolete but they may not be listed in the install/upgrade script for removal in case they are part of the dependencies of other packages. So, apt-get advises us of any packages that are on the system and are obsolete but not listed as dependencies of any of the packages that we have installed. And are therefore safe to remove.

    Regards
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  4. #4
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: What is the best way to remove unnecessary packages?

    Yes, it is quite disconcerting to be told that you have extraneous packages while trying to install something. That sounds more like a Microsoft annoyance than a Linux notification. Anyway, apt-get does a reasonably good job keeping tabs on what packages are needed. The autoremove switch is generally safe to use.

    You can manually remove other packages, but you risk breakage. At least you get to keep the pieces.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  5. #5
    Join Date
    Jul 2011
    Beans
    264

    Re: What is the best way to remove unnecessary packages?

    Thanks. I have a doubt to clear, should I use purge command to remove those unnecessary packages or is it better to use autoremove command?

  6. #6
    Join Date
    Aug 2012
    Beans
    Hidden!

    Re: What is the best way to remove unnecessary packages?

    The only real difference in your situation between autoremove and purge is that purge also removes any left over config files (system config not user config).
    From "man apt-get":
    purge
    purge is identical to remove except that packages are removed and
    purged (any configuration files are deleted too).
    These files are usually very small and leaving them does no harm. Purging is useful when reinstalling an application so as to kill the old configuration for the package being removed. Note that purging only removes system config files for an application, if the application stores config files in hidden files or folders in the user's home directory, they need to be manually removed by the user.

    I would suggest you stick just with autoremove if just doing simple cleanup and leave purging for when you need to remove the config specifically.
    Last edited by coldcritter64; March 22nd, 2014 at 11:23 AM. Reason: reworded 1st sentence for clarity

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
  •