The tutorial is written for Linux Mint 17.2 Rafaela. It does not work as-is on Linux Mint 18.
Before you do this!
Some food for thought beforehand as to whether you should enable automatic upgrades, as it goes against Linux Mint's policy of the user being in control of upgrades.
- You can configure Update Manager as to how often it will check for, and thus show, available upgrades. (From its menu select Edit > Preferences, go to Auto-Refresh tab, and configure as needed.) For example set it to updating once a week. This may be a better approach (optionally combined with only installing security upgrades automatically).
- If you have installed Linux Mint for somebody else (or yourself
) and want to use automatic upgrades for them, consider they will not be able to tell you "I just updated and now LibreOffice won't open" or "I updated yesterday and today my computer doesn't boot." For problem diagnosis you can of course go through /var/log/dpkg.log yourself when somebody comes to you with a problem, to check what upgrades have been applied when that could have caused the problem. But having the user themselves be able to give you that information can be a time saver.
- It would also allow the users some form of control. "I have a paper due the day after tomorrow, so I'll postpone upgrades till then to not take any risk having to call <insert your name here> tomorrow in panic if the computer doesn't work." Perhaps this is a little overcautious, but there you have it.
If not already installed, install the package unattended-upgrades. Either using Software Manager or with the command:
Code: Select all
apt update && apt install unattended-upgrades
First step is to configure from where automatic upgrades will be installed. You configure this in the file /etc/apt/apt.conf.d/50unattended-upgrades. To edit it run this command (that is for Cinnamon and Xfce; for MATE replace "gedit" with "pluma"; for KDE replace "gksudo gedit" with "kdesudo kate"):
Code: Select all
gksudo gedit /etc/apt/apt.conf.d/50unattended-upgrades
Code: Select all
"${distro_id}:${distro_codename}-security
Code: Select all
Unattended-Upgrade::Origins-Pattern {
"o=Ubuntu,a=trusty-security";
};
Code: Select all
Unattended-Upgrade::Origins-Pattern {
"o=Ubuntu,a=trusty-security";
"o=Ubuntu,a=trusty-updates";
"o=Ubuntu,a=trusty";
"o=Canonical,a=trusty";
"o=linuxmint,n=rafaela";
};
Configuration — Part II — Testing your changes
Now before you enable automatic upgrades you should test your configuration. You can do this with the command (it will likely ask for your password; note that on the terminal you do not get any visual feedback as you type a password):
Code: Select all
sudo unattended-upgrades --verbose --dry-run
Code: Select all
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=Ubuntu,a=trusty-security']
Code: Select all
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=Ubuntu,a=trusty-security', 'o=Ubuntu,a=trusty-updates', 'o=Ubuntu,a=trusty', 'o=Canonical,a=trusty', 'o=linuxmint,a=rafaela']
With you having confirmed the configuration is correct you can configure the automatic upgrades. First step is to install the default configuration file /etc/apt/apt.conf.d/20auto-upgrades. You do this with the command:
Code: Select all
sudo dpkg-reconfigure -plow unattended-upgrades

You might want to edit /etc/apt/apt.conf.d/20auto-upgrades and add the following line to once a month run autoclean:
Code: Select all
APT::Periodic::AutocleanInterval "30";