The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 147     Votes:  1     ✅ Solution
Tags: command-line   apt   scripts  
Link: 🔍 See Original Answer on Ask Ubuntu ⧉ 🔗

URL: https://askubuntu.com/q/1178114
Title: Suspend temporarily linux update apt for the session until reboot
ID: /2019/10/02/Suspend-temporarily-linux-update-apt-for-the-session-until-reboot
Created: October 2, 2019
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


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
⇧ Disabling external monitor with xrandr also disables laptop screen How to set intel_idle.max_cstate=1  ⇩