OSMC updates explained

Well you might want to first check (on Kodi Forum) if your addons are compatible to Kodi 15.1 to avoid frustration

If I am interested in achieving the same functionality as My OSMC’s update check tool, but from the command line.

Should the following be functionally equivalent?

sudo apt-get update
sudo apt-get -u dist-upgrade | grep XXXX

Where XXXX is an appropriate search/filter string to identify packages from the apt.osmc.tv repo that have available upgrades.

Yes, should do.

Thanks, I’ll test this when the next update is out.

This is not functionally equivalent. You should autoremove any kernel packages after a full dist-upgrade.

Just do this:

sudo apt-get update
sudo systemctl start manual-update

This will run the blue update screen directly and perform an update in an identical fashion to starting it from My OSMC. The only difference is that it will go to the update screen even if there are only debian updates available, or even if there are no updates available. (But the latter is harmless, it will do nothing then return to Kodi)

This will ensure that old kernels are also removed.

1 Like

Thanks for the replies. I might not have been clear enough.

I only want to replicate the functionality that checks whether OSMC updates are available. I don’t want to actually install anything.

I want to be able to run my script from the command line and (as a basic example) have it output “yes” if there are OSMC updates available (i.e. the icon will be showing on the home screen), and “no” if there are not.

I’ll give what I proposed a go when the next monthly update is available, and I can see the icon on the home screen, but before I install anything.

Check for updates and then use --dry-run on dist-upgrade and grep that for “osmc”

Sam

Simple grepping for osmc won’t work - as it will also match autoremovable kernels or autoremovable no longer required dependencies. Will see if I can think of an easy way to do it properly.

Here is a one liner:

sudo apt-get update >/dev/null && sudo apt-get -s dist-upgrade | grep -q "Inst.*-osmc " && echo "OSMC updates available"

The key is to match for “Inst” at the start of the same line as a package ending with -osmc so that only new or updated packages will be matched. Replace the echo with the command you want to run if updates are available.

1 Like

Fantastic, thanks a lot.