Score:0

bash install without restart popups

md flag

Bash script at bottom, on Ubuntu 22.04. It keeps getting popups to restart services on install, you can see I have tried quite a few approaches.

sudo apt update -y 

and

sudo apt install -y libgl1

seem to be the problem scripts. And here us an image:

reboot request

#!/bin/bash

# Create a policy-rc.d script to prevent services from being automatically started/restarted
echo '#!/bin/sh' | sudo tee /usr/sbin/policy-rc.d > /dev/null
echo 'exit 101' | sudo tee -a /usr/sbin/policy-rc.d > /dev/null
sudo chmod +x /usr/sbin/policy-rc.d

# Set environment variables to make apt non-interactive
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true

echo "Updating the package list..."
sudo apt update -y

echo "Installing python3-pip..."
sudo apt install -y python3-pip

echo "Installing libgl1..."
sudo apt install -y libgl1

# Remove the policy-rc.d script to allow services to be started/restarted again
sudo rm /usr/sbin/policy-rc.d

echo "Restarting services using outdated libraries..."
sudo needrestart -r a
Artur Meinild avatar
vn flag
Does this answer your question? [apt-get upgrade auto restart services](https://askubuntu.com/questions/1367139/apt-get-upgrade-auto-restart-services)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.