Score:0

Ubuntu unattended-upgrades

cn flag

Origanally I have posted this question on stackoverflow, due to the fact it is the wrong forum. I'm asking the question again here with some extra information I have gathered.

I'm looking into creating a script in bash for automating my update-u^grade process for all my virtual machiens as a homelabber.

I'm a developer but currently not have that good knowledge of bash:

My current script is pretty simple:

#!/bin/sh

apt update -y
apt upgrade -y
apt autoremove -y

After some answers on the stackoverflow and some research on this forum I missed the DEBIAN_FRONTEND=noninteractive part So i tested with this command: sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y but still witouth good results.

The problem i'm facing is that all my virtual machines have the sh config file edited with a /etc/issue.net included since this is a standard security practice founded on every information I could gather. Due to the fact that this file has been edited, while upgradeing the ssh-server package it asks what I want to do? Default it will take the local edited version but it requires the user to PRESS ENTER When trying the command above I still had to PRESS ENTER, however after the upgrade was done I discovered in the terminal NEEDRESTART DEBIAN_FRONTEND=noninteractive service.

So first: Is it possible after env variable change it need a restart to take affect? Due to the fact that the ssh package does not always have an upgrade available is there something I can do to test this?

And/or as last question Does the env variable not change the effect for the user input? I haven't tested my script on cron tab to see if it's is working or not due to the fact again that there is not always an upgrade available.

terminal

Artur Meinild avatar
vn flag
Specifically see [this answer](https://askubuntu.com/a/832648/1066942) on how to configure `unattended-upgrade` for different scenarios.
muru avatar
us flag
Does this answer your question? [How can I automate a "conffile" prompt in unattended upgrades?](https://askubuntu.com/questions/921162/how-can-i-automate-a-conffile-prompt-in-unattended-upgrades)
muru avatar
us flag
And also: [What happens with changed config files when unattended-upgrades runs?](https://askubuntu.com/q/1237366/158442)
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.