Score:0

How do I skip the interactive prompts asking to restart services on apt upgrade?

in flag

When doing an apt update -y && apt upgrade -y for an automated script (that runs on startup in an interactive shell) I am prompted to restart certain services.

enter image description here

My script looks like

#!bin/bash

export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a

sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y --fix-broken install

This is a "remote dev environment" based on Ubuntu that can only be accessed via ssh and is wiped when restarted - so I run these commands on initial ssh login (in an interactive shell).

guiverc avatar
cn flag
Please provide OS & release details; what do you mean by *base on Ubuntu* specifically?
pLumo avatar
in 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.