6

I want to install a bunch of packages, but I don't want to install the documentation of them. How can I do this?

2 Answers 2

8

Exclude documentation from .deb installation (DPKG)

  • Onetime option: --path-exclude could be used to filter out unwanted files when installing a package:

    dpkg -i --path-exclude=/usr/share/doc/* ...
    
  • Permanent solution: Create a file /etc/dpkg/dpkg.cfg.d/01_nodoc which specifies the desired filters. Example:

    path-exclude /usr/share/doc/*
    # we need to keep copyright files for legal reasons
    path-include /usr/share/doc/*/copyright
    path-exclude /usr/share/man/*
    path-exclude /usr/share/groff/*
    path-exclude /usr/share/info/*
    # lintian stuff is small, but really unnecessary
    path-exclude /usr/share/lintian/*
    path-exclude /usr/share/linda/*
    

Skip recommended dependencies (APT)

Then change /etc/apt/apt.conf.d/99synaptics or create new file containing:

APT::Install-Recommends "false";

By the way, this is the permanent option of muru's answer for this question.

References:

2
  • Is there a way to do this with apt? I am using the apt-get command to install my packages
    – Robert
    Oct 24, 2014 at 15:54
  • @Rob3 yes, i've update answer. setup conf files then use the command/tools you want.
    – user.dz
    Oct 24, 2014 at 16:23
4

Usually, the doc packages are recommended by the main package, but aren't hard dependencies. If they were hard dependencies (for example, texlive-full), I don't think there's a safe or simple way. For recommended packages, the answer is simple:

sudo apt-get install --no-install-recommends <package-name>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.