Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Auto update full-upgrade

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
acukcroy
Posts: 12
Joined: 2017-10-16 13:49

Auto update full-upgrade

#1 Post by acukcroy »

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 :)

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: Auto update full-upgrade

#2 Post by Thorny »

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. http://forums.debian.net/viewtopic.php?f=30&t=47078 Maybe even this. http://forums.debian.net/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

peer
Posts: 443
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 20 times

Re: Auto update full-upgrade

#3 Post by peer »

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

User avatar
Gaius
Posts: 33
Joined: 2012-12-18 10:54
Location: Germany

Re: Auto update full-upgrade

#4 Post by Gaius »

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
Ardouos
Posts: 1075
Joined: 2013-11-03 00:30
Location: Elicoor II
Has thanked: 1 time
Been thanked: 4 times

Re: Auto update full-upgrade

#6 Post by Ardouos »

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.
There is only one Debian | Do not break Debian | Stability and Debian | Backports

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

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

Re: Auto update full-upgrade

#7 Post by acukcroy »

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

#8 Post by acukcroy »

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?

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 85 times

Re: Auto update full-upgrade

#9 Post by 4D696B65 »

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

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

Re: Auto update full-upgrade

#10 Post by acukcroy »

Thanks

Post Reply