On 01-07-17, Larry Dighera wrote: > On Fri, 30 Jun 2017 16:31:37 -0400, you wrote: > > >> Someone else mentioned unattended upgrades, which is a thing I have > >> never used, and which is also a thing I would disable if I ever found > >> it running. But that's just me. > > > >I would like to do that but don't know how. Anyone caring to enlighten > >me without me having to bother poor old Mr. Google yet again - it would > >be appreciated. :) > > Perhaps you'll find this useful: > > =========================================================================== > # auto-update-on-off.sh This script will enable and disable > unattended-updates > # > # LGD: Thu Jun 1 15:00:09 PDT 2017 > # > > [[ $# != 1 ]] && echo -e "\n\t\"$@\" Unknown\n\tUsage: $0 <e|d|s> > \n\t\tWhere: e = Enable\n\t\t\td = Disable\n\t\t\ts = Status" >&2 && > exit 1 > > FILNAM="/etc/apt/apt.conf.d/10periodic" > OFF="APT::Periodic::Unattended-Upgrade \"0\";" > ON="APT::Periodic::Unattended-Upgrade \"1\";" > > status(){ # Get current status > if [[ -s "$FILNAM" ]] ;then # Does file exist with >0 file > length? > [[ $(grep -qs 1 "$FILNAM") ]] && STATUS=Enabled > [[ $(grep -qs 0 "$FILNAM") ]] && STATUS=Disabled > else > STATUS="Not Configured (Disabled)" > fi > return $STATUS > } > > > case $1 in > -[sS]*) status; echo "Current $0 status: $STATUS">&2;exit 0 ;; > -[dD]*) echo "$OFF" >/etc/apt/apt.conf.d/10periodic ;; > -[eE]*) echo "$ON" >/etc/apt/apt.conf.d/10periodic ;; > *) echo -e "\n\t\"$@\" Unknown\n\tUsage: $0 <e|d|s> \n\t\tWhere: e > = Enable\n\t\t\td = Disable\n\t\t\ts = Status" >&2 && exit 1 > esac > > ================================================================================= >
Why would you do that? Write and use script to change one 0/1 in /etc/apt/apt.conf/20auto-upgrades? Or even 2, in case that you change both for update and upgrade. Not to mention that those using gnome software or some kde equivalent can do it in GUI too.