2011年1月14日星期五

HowTo: Not install “recommends” packages in Debian Linux with aptitude

Ubuntu (and Debian) Linux will, by default, add "recommended" / "suggested" packages to some installs. If you are short of storage space, this can be of high importance. Here, I present 2 ways, one persistent, one temporary, to prevent these extra packages being installed.


The persistent way
Create or Edit the file /etc/apt/apt.conf file and add the following contents to it:

// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";


This will apply to ALL package installs.


The temporary way
Alternatively, if you would prefer to normally install recommended packeages, but ignore them in one case, you can simply add a flag to the command line. Eg:


sudo aptitude install xxx


sudo aptitude install --without-recommends xxx


Note, you can have this set up the opposite way. To do this, make the changes above under "The persistent way". Then, when you want to install a package WITH all the recommended/suggested additional packages, simply add a --with-recommends flag to the command (the flag overrides the apt.conf file).

没有评论:

发表评论