File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- apt-get -y remove unattended-upgrades
32
43# Try to disable unattended upgrades and apt automatic updates, should not fail if it is not installed
54sudo systemctl disable unattended-upgrades.service || true
@@ -14,3 +13,18 @@ sudo systemctl disable apt-daily-upgrade.service || true
1413sudo systemctl disable apt-daily-upgrade.timer || true
1514sudo systemctl stop apt-daily-upgrade.service || true
1615sudo systemctl stop apt-daily-upgrade.timer || true
16+
17+ # Send the TERM signal to any remaining unattended-upgrades processes
18+ pgrep unattended-upgrades | xargs -r -n 1 -t kill -TERM || true
19+
20+ max_to_wait=10
21+ while pgrep unattended-upgrades && [ $max_to_wait -gt 0 ]; do
22+ echo " Waiting for unattended-upgrades to terminate"
23+ sleep 1
24+ max_to_wait=$(( max_to_wait - 1 ))
25+ done
26+
27+ # Kill any unattended-upgrades processes that didn't terminate
28+ pgrep unattended-upgrades | xargs -r -n 1 -t kill -KILL || true
29+
30+ apt-get -y purge unattended-upgrades
You can’t perform that action at this time.
0 commit comments