Technically speaking, the GUI version of apt-get update
does it automatically already - those already cater to the needs of a desktop user. Command line tools are more of a technical type of user, typically admins , who know what they're doing.
However, there's nothing stopping you from making a script out of it, and reviewing logs every once in a while. For example, here's a quick sketch:
#!/bin/bash
main()
{
local DATE=$(date +%Y_%m_%d_%H_%M)
local LOGFILE=AUTO_UPDATE_$DATE
local DIR="/home/localuser/logs" # where to store logs
apt-get update &> "$DIR"/"$LOGFILE"
}
main
And use that as script to run upon shutdown or reboot using /etc/rc6.d
directory scripts or alternatively - cronjob to schedule this script at specific time of day. Remember though that checking logs will be your responsibility.
In future, there will come snappy
- a newer system for transactional updates which is now is in very young stage and supposedly should come to 16.04. My experience with it is somewhat limited, but on Raspberry Pi it does update automatically and reboots itself once newer version of packages are available, sort of how Windows update works
Addition
Per muru's suggestion one could use unattended-upgrades to automate the updates as well, and probably in a less verbose way than my solution.
apt-get
update fails (due to network problems, or similar) and you want to have the output. Moreover, using a user's network silently in the background is a very bad idea. Finally, soon we will move to snappy packages, abandoning the oldapt-get
system. – dadexix86 Mar 07 '16 at 22:00apt-get update
automatically. Open the Software & Updates app and you can change that schedule. – TheWanderer Mar 07 '16 at 22:04sudo apt-get upgrade
won't actually upgrade everything, to upgrade all things that need upgrading dosudo apt-get dist-upgrade
(though obviously this won't upgrade you to a new distribution -sudo do-release-upgrade
will do that). – Mar 07 '16 at 22:07do-release-upgrade
? – Mar 07 '16 at 22:28do-release-upgrade
because this is what theapt-get
manpage says and it doesn't say anything you say about thedist-upgrade
option: – Mar 07 '16 at 22:30dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages;
– Mar 07 '16 at 22:31apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.
– Mar 07 '16 at 22:31