Hi, its been awhile since ive done one of these with that said here is a small tutorial on how to get OSMC self-updating, this can cause breakage if a bad package is added to the repositories remember that so its a good idea to have some Linux skills if you want a self-updating OSMC installation.
DISCLAIMER
this might disqualify you from getting official support since this is not a supported way to getting updates. This is the official Debian way of getting automated updates but its not the official way for OSMC (Sam and the rest of the team recommends users to always use MyOSMC).
Pre-installation issues: Disable updates in MyOSMC so they dont fight over lock status in APT. With all of these fair warnings lets get to it first we need to install using these instructions.
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
sudo rm /etc/apt/apt.conf.d/50unattended-upgrades
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
then add this content
Unattended-Upgrade::Origins-Pattern {
"o=Debian,n=jessie";
"o=Debian,n=jessie-updates";
"o=Debian,n=jessie,l=jessie-Security";
"o=OSMC,n=jessie,l=OSMC"
};
Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::SyslogEnable true;
Acquire::http::Dl-Limit "512";
These commands will update OSMC and Debian automatically every day if updates are found, it will also throttle downloads to 512kb/sec and it will fix interrupted installations if there are any it will also install using minimal steps in order to make it more safe. Also it will cleanup every 7th day and last but not least it will remove unnecessary packages.
Next up is to make this run periodically with the following command
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
add this content to
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
to check if it work try this command
sudo unattended-upgrade --dry-run --debug
too add more repositories do
sudo apt-cache policy
from that command you can grab additional repositories that are not covered in this tutorial, for more information on unattended-upgrades check: UnattendedUpgrades - Debian Wiki
p.s there is ways to blacklist packages like kernel etc if you dont want that to update and even kodi just google unattended-upgrades blacklist, also you can setup mail whenever it runs and updates packages so you get a report on what was upgraded.
This file can give you a clue of something goes wrong
cat /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
Target platform: All
Tested platform: RPI3, RPI2, RPI1