Thursday, November 17, 2011

HOWTO: Use APT without the Bloat

Today I would like to share a small tidbit with all the users of APT distros out there. One of the reasons Bodhi Linux is so light weight and snappy is because when I install all the base packages for Bodhi I install them with the minimal amount of extra dependencies.

For whatever reason a good deal of Debian packagers like to tack on a whole slew of "optional" dependencies to the packages they create. By default apt-get installs all of these extra dependencies on your computer. If you are like me and don't want all the extra bloat it is as simple as running apt-get with on extra argument:

sudo apt-get install --no-install-recommends foo 

In the above example "foo" is the name of the package you wish to install. Doing this can save a good bit of space on your system. For example:

sudo apt-get install abiword


VS

sudo apt-get install --no-install-recommends abiword


or

sudo apt-get install k3b


VS

sudo apt-get install --no-install-recommends k3b


~Jeff Hoogland

15 comments:

  1. Thanks for the tip! Didn't know about it

    ReplyDelete
  2. Wow,so simple yet effective. Thanks Jeff.

    ReplyDelete
  3. THANK YOU VERY MUCH!!!!!!!

    ReplyDelete
  4. I still can't belive that this is the work of one guy.And you stil manage to post relevant and interesting stuff.Like allways +1 dude

    ReplyDelete
  5. Wouldn't it be good if #apt-get install foo led to the list of all necessary packages, with an question offering to add your choice of recommended packages before going ahead with the download and installation?
    Meanwhile, thanks for a very useful work-around.

    ReplyDelete
  6. Thanks for the info! I've looked into doing this same thing using aptitude and the difference is enormous! I've written it up here:
    http://gnuski.blogspot.com/2011/11/howto-using-aptitude-to-minimize.html

    Thanks for the tip and the inspiration!

    ReplyDelete
  7. To make this the default behavior, I have a file called "/etc/apt/apt.conf.d/97norecommends" with the following:


    APT
    {
    Install-Recommends "false";
    };

    ReplyDelete
  8. It's amazing what efforts you hobbyists will go through to save 75mb.

    - Jon

    ReplyDelete
  9. I think a G+ Page would benefit Bohdi. I'd also like to follow this blog, but don't see a button.

    ReplyDelete
  10. Bodhi has a Google+ page. You can also follow my personal page for blog updates on G+ :)

    ReplyDelete
  11. ya, I also saw that here:

    http://www.liberiangeek.net/2011/11/ubuntu-tips-install-programs-in-ubuntu-without-unnecessary-packages/#more-23398

    ReplyDelete
  12. "It's amazing what efforts you hobbyists will go through to save 75mb."

    I also do crazy, amazing things like turn off the light when I'm leaving a room, and not leaving the water running while I brush my teeth.

    ReplyDelete
  13. Does this sort of thing also work when doing a dist-upgrade? Or a better question - any way to (quickly/easily) go and uninstall all of the optional packages for stuff you already have installed?

    ReplyDelete
  14. Dist upgrade shouldn't pull in all the extra stuff.

    ReplyDelete
  15. Tried the tip above about making this the default behavior, but it didn't work. Any other suggestions?

    ReplyDelete