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?
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.
apt-config is not read-only but does not document all options in --help
apt 2.4.5 (amd64) Usage: apt-config [options] command
apt-config is an interface to the configuration settings used by all APT tools, mainly intended for debugging and shell scripting.
Most used commands: shell - get configuration values via shell evaluation dump - show the active configuration setting
See apt-config(8) for more information about the available commands. Configuration options and syntax is detailed in apt.conf(5). Information about how to configure sources can be found in sources.list(5). Package and version choices can be expressed via apt_preferences(5). Security details are available in apt-secure(8).
Keywords "See apt-config(8) for more information". In other words the information displayed by --help
is incomplete by design. Upon viewing the man page for apt-config vi man apt-config
you see
-o, --option Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options.
Thus the op should have stated what error they were getting. I suppect its because sudo
was not used to execute the command. This is required to modify any system wide configuration such that of apt.
apt-config -o APT::Periodic::Unattended-Upgrade=1 shell var APT::Periodic::Unattended-Upgrade
gives var='1'
but what is the point?
$ 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";
dump
:apt-config dump APT::Periodic::Unattended-Upgrade
to restrict its output (though man page does not tell it currently)