Auto update full-upgrade

New to Debian (Or Linux in general)? Ask your questions here!

Auto update full-upgrade

Postby acukcroy » 2017-10-16 13:52

Hi,

I have just installed Debian and love it - it's really peppy and much better than Ubuntu.

I plan to install it on my mum's computer, but would like updates to run in the background:

apt-get update
apt-get full-upgrade

How would I do this?

Thank you :)
acukcroy
 
Posts: 12
Joined: 2017-10-16 13:49

Re: Auto update full-upgrade

Postby Thorny » 2017-10-16 15:34

acukcroy wrote:I plan to install it on my mum's computer, but would like updates to run in the background:

apt-get update
apt-get full-upgrade

How would I do this?

I don't know how you would do it but, if I had the question that you posed, I would use a search engine and see if I could find the topic with the keywords, Debian, unattended, upgrades.

Sure enough, there is a Debian Wiki Page for that topic. https://wiki.debian.org/UnattendedUpgrades So, I would go to that page and see if I understood it and if not then I might pose a more specific question to the Forum regarding what I didn't understand.

Ubuntu is derived from Debian but is not exactly the same, expect some differences from what you may already know. Our Forum is also different, as you will see if you stay around.

Since you are new here and don't yet know what to expect, it would probably also be a good idea to read this. viewtopic.php?f=30&t=47078 Maybe even this. viewtopic.php?f=30&t=58557

The information on the following site is fairly long to read but I think it can be valuable to read and understand. http://www.catb.org/esr/faqs/smart-questions.html
Thorny
 
Posts: 340
Joined: 2011-02-27 13:40

Re: Auto update full-upgrade

Postby peer » 2017-10-17 04:51

in the terminal:
sudo apt update && sudo apt full-upgrade
peer
 
Posts: 34
Joined: 2017-03-26 10:14

Re: Auto update full-upgrade

Postby Gaius » 2017-10-20 11:29

peer wrote:in the terminal:
sudo apt update && sudo apt full-upgrade

That can only be considered "automatic" if you have your butler do it.

Have you actually read the OP?
If you can’t explain it simply, you don’t understand it well enough.
Albert Einstein
User avatar
Gaius
 
Posts: 33
Joined: 2012-12-18 10:54
Location: Germany

Re: Auto update full-upgrade

Postby pylkko » 2017-10-21 16:43

User avatar
pylkko
 
Posts: 1174
Joined: 2014-11-06 19:02

Re: Auto update full-upgrade

Postby Ardouos » 2017-10-21 16:47

Ensure your sources are pointing towards the systems codename instead of stable when using unattended upgrades. Otherwise your mother nice get a surprise in 2 years.
User avatar
Ardouos
 
Posts: 929
Joined: 2013-11-03 00:30
Location: Elicoor II

Re: Auto update full-upgrade

Postby acukcroy » 2017-10-22 07:24

Thanks - I got a bit confused with unattended upgrades, so opted for this in /etc/cron.weekly

It does everything I need.

Admit, it's probably overkill, but for a newbie like me it seems to do the trick nicely in the background.
It outputs to a .txt file as listed, so I can see what went on in the update process.

I also added in a fstrim -a for my SSD.

Code: Select all
#!/bin/bash
sleep 30s

dt=$(date '+%d/%m/%Y %H:%M:%S');
echo "Last ANTupdate run = " "$dt" > "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
echo "=====================================================" >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
echo " " >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"

sudo apt-get update >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
sudo apt-get full-upgrade -y >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
sudo apt-get dist-upgrade -y >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
sudo apt-get autoremove -y >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
sudo apt-get clean y >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"
sudo apt-get autoclean y >> "/home/adam/ZZ_Last_Anacron_Updates/Anacron_Last_APT_Update.txt"

fstrim -a
Last edited by acukcroy on 2017-10-22 07:28, edited 2 times in total.
acukcroy
 
Posts: 12
Joined: 2017-10-16 13:49

Re: Auto update full-upgrade

Postby acukcroy » 2017-10-22 07:26

Ensure your sources are pointing towards the systems codename instead of stable when using unattended upgrades. Otherwise your mother nice get a surprise in 2 years.


My sources do currently say stable instead of stretch, so thanks for the heads up. :D

What will happen in 2 years - when the new release comes out?

Will the system get wiped with a full-upgrade in apt?
acukcroy
 
Posts: 12
Joined: 2017-10-16 13:49

Re: Auto update full-upgrade

Postby 4D696B65 » 2017-10-22 15:49

acukcroy wrote:What will happen in 2 years - when the new release comes out?

Will the system get wiped with a full-upgrade in apt?

Yes
User avatar
4D696B65
 
Posts: 2022
Joined: 2009-06-28 06:09

Re: Auto update full-upgrade

Postby acukcroy » 2017-10-22 17:50

Thanks
acukcroy
 
Posts: 12
Joined: 2017-10-16 13:49


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable