Posted on January 18, 2019 at 10:44 am
To automatically keep current config files when doing apt-get install on Debian:
apt-get install nginx -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
You can find more info on Raphael Hertzog’s Blog.
Here are more info about –force-confold and –force-confdef:
confold: If a conffile has been modified and the version in the package did change, always keep the old version without prompting, unless the --force-confdef is also specified, in which case the default action is preferred. confdef: If a conffile has been modified and the version in the package did change, always choose the default action without prompting. If there is no default action it will stop to ask the user unless --force-confnew or --force-confold is also been given, in which case it will use that to decide the final action.
Other conf* options are here:
If a package (i.e php7.3-fpm from Sury) has interactive questions, use this:
export DEBIAN_FRONTEND=noninteractive; apt-get install php7.3-fpm -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
Some tutorials online suggest to use also “–force-yes” but:
Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should not be used except in very special situations.
So we don’t recommend to use it! More info here:
- How to Clone a Virtual Machine on VirtualBox via Command-Line
- How to Mount a Shared Folder on VirtualBox Windows Guest
- How to Install VirtualBox Guest Additions on Windows Guest
- Add Shared Folder on VirtualBox VM via Command-Line on Debian
- How to Install a .Deb File on Debian Linux via Command-Line
- Install VirtualBox 6.0 on Debian 10 Buster
- Install Windows 7 Guest on VirtualBox Debian Host (Command-Line)
- Create or Restore a VirtualBox Snapshot on Debian (Command-Line)
- Run a Program Inside a VirtualBox Guest VM from Host via Command-line
- Disable User Account Control (UAC) in Windows 10
- Get the Output of a Program in a Variable in Bash
- Automatically Renew Let's Encrypt Certificates (Nginx)
- Capture Multiple Line Output Into a Bash Variable
- How to Extract Domain from URL in Bash
- Get Local File Permissions from Command-Line on Linux
- Disable Driver Signature Enforcement on Windows 7 64-bit