Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to add settings to the file apt.conf , but I realized that it was replaced by a folder called etc/apt/apt.conf.d/.

How can I configure with this new model?

share|improve this question
add comment

4 Answers

It is best to create your own user file in /etc/apt/apt.conf.d so you can guarantee that it won't be overwritten by package updates. Rather than adding to existing files in the directory, create your own general file called 99mysettings with

sudo touch /etc/apt/apt.conf.d/99mysettings 

It is labelled with a 99 so that your settings are run last and so override any of the same values for the specified settings present in other files in the directory.

Then to edit your file run

sudo nano /etc/apt/apt.conf.d/99mysettings

and then, for example, you could add the following (although not usually recommended) configuration item:

APT::Install-Suggests "true";

If you wanted apt to stop installing recommended packages (again not usually the best decision) you could use

APT::Install-Recommends "false";

The syntax of these commands differs to how the man page will describe how entries for the older apt.conf should be set up; previously APT::GET::Install-Suggests "true"; would have been the syntax, but that will not work for the example above.

The man page will give you an indication of the general settings available, so please enter man apt.conf or see the Ubuntu manpages online. However, the best source for apt configuration settings is the Debian Handbook, available here online or as a complete pdf here, and it contains very useful information that is mostly applicable for Ubuntu as well.

share|improve this answer
add comment

The apt.conf file which contains configuration for APT is by default located in /etc/apt/.

To check what's under apt directory, do the following in terminal:

cd /etc/apt
ls

The apt.conf file should be listed after the ls command.

However, if it does not exist, you can create it by running the following command:

gksu gedit apt.conf

(Make sure the present working directory is /etc/apt, if not, then cd to /etc/apt first.)

This will ask for your password and launch gedit allowing you to create your apt.conf file.

You can also use:

sudo nano apt.conf
share|improve this answer
add comment

From versions newer than Gutsy, the file /etc/apt/apt.conf has been replaced by /etc/apt/apt.conf.d/proxy (create it if needed), with the same structure.

share|improve this answer
add comment

Just create the file /etc/apt/apt.conf if you need it, and put in the stuff you want.

man apt.conf
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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