4

I have tried to change a apt config value with apt-config but without success:

apt-config -o APT::Periodic::Unattended-Upgrade=1 shell

Is there a another program on Debian / Ubuntu with you can customize the configuration?

  • I do not understand what the -o option is for then. I can see some temporary effect: $ apt-config -o APT::Periodic::Unattended-Upgrade=1 dump | grep ^APT::Periodic::Unattended-Upgrade APT::Periodic::Unattended-Upgrade "1"; $ apt-config dump | grep ^APT::Periodic::Unattended-Upgrade APT::Periodic::Unattended-Upgrade "0"; – jarno Feb 15 '19 at 11:06
4

Nope, apt-config is read-only (as its --help will tell you):

 apt-config is a simple tool to read the APT config file

To persist an Apt configuration change, you need to edit/add to the configuration files in /etc/apt/apt.conf.d/. Before you start creating new files, you might want to check to see if that variable has already been set. Here's a quick grep looking for "Periodic":

$ grep -R Periodic /etc/apt/apt.conf.d/
/etc/apt/apt.conf.d/10periodic:APT::Periodic::Update-Package-Lists "1";
/etc/apt/apt.conf.d/10periodic:APT::Periodic::Download-Upgradeable-Packages "1";
/etc/apt/apt.conf.d/10periodic:APT::Periodic::AutocleanInterval "0";
/etc/apt/apt.conf.d/10periodic:APT::Periodic::Unattended-Upgrade "1";

This may differ from your computer so run it. If I were going to make any changes, I'd run sudoedit /etc/apt/apt.conf.d/10periodic. Apt should pick those up the next time one of its commands runs.


Note: the above obviously applies to the apt.config side of things. There are other settings lurking around in /etc/apt/ (the parent directory of above) that may be applicable if you're trying to set other things.

| improve this answer | |
  • apt-config --help does not tell it is read-only (apt 1.2.29). – jarno Feb 15 '19 at 11:00

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.