Created
July 10, 2012 17:42
-
-
Save xuru/3084995 to your computer and use it in GitHub Desktop.
non-interactive debian/ubuntu upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
PATH=/usr/sbin:/sbin:/usr/bin:/bin | |
cat <<EOF > /etc/apt/apt.conf.noninteractive | |
APT::Get::Assume-Yes "true"; | |
APT::Get::Show-Upgraded "true"; | |
APT::Quiet "true"; | |
DPkg::Options {"--force-confmiss";"--force-confold"}; | |
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; | |
Dir::Etc::SourceList "/etc/apt/sources.list"; | |
APT::ExtractTemplates::TempDir "/tmp"; | |
EOF | |
if [ ! "`apt-get -q update | grep ^Fetched`" ] | |
then | |
exit 0 | |
fi | |
# Packages updated: do an upgrade | |
export DEBIAN_FRONTEND=noninteractive | |
export DEBIAN_PRIORITY=critical | |
/usr/bin/apt-get --config-file /etc/apt/apt.conf.noninteractive -y --force-yes upgrade | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment