Pocket Theories

Linux

Suppressing the Service Restart prompt for "apt install"

Updated: September 8, 2024


export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
export NEEDRESTART_MODE=a  # default is "i"nteractive; change to "a"utomatic ; see: /etc/needrestart/needrestart.conf
export NEEDRESTART_SUSPEND=1
echo 'libc6 libraries/restart-without-asking boolean true' | debconf-set-selections &&

sudo apt-get remove apt-listchanges --assume-yes --force-yes
apt-get dist-upgrade --yes
sudo apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuyq dist-upgrade