2

hi everything is in the title,

i want to Suspend temporarily linux update apt for the session until reboot

reason? when i'm on my mobile phone hotspot i don't want to linux PC to DL GB of data

so i just need a command (non root if possible) saying something like: "apt -stop_auto_update" or at worse a way to "kill apt-auto-update-daemon"

alex
  • 23

1 Answers1

1

You can run a command based on this answer:

Create a script:

#!/bin/bash

systemctl stop apt-daily.service
systemctl kill --kill-who=all apt-daily.service

# wait until `apt-get updated` has been killed
while ! (systemctl list-units --all apt-daily.service | egrep -q '(dead|failed)')
do
  sleep 1;
done

# now proceed
echo Apt Daily Service has been killed

Mark the script as executable in order to call the command:

sudo chmod /path/to/my_script.sh

You need sudo powers to call the command:

sudo /path/to/my_script.sh

When you are away from the hotspot and back to your regular network reboot to reinstate apt services or type:

sudo systemctl start apt-daily.service

Of course you can forgo the fancy script altogether and stop services with:

sudo systemctl stop apt-daily.service