How to update OSMC via command line (ssh)?

Hi guys,
sometimes I’d like to be able to update OSMC via command line (login via ssh) instead of via the menu option… is it possible?

1 Like

Hi there,

You can use

apt-get update
apt-get dist-upgrade

remember to reboot after they are installed/updated…

there is a bit more info about apt-get here:

-H

Thanks and sorry for the basic question.

Just for clarity, is it best that you stop kodi by running sudo systemctl stop mediacenter before running the updates or does it not really matter?

Doesn’t really matter in my experience.

Not necessary.

If the update includes Kodi, the My OSMC addon or My OSMC skin then Kodi will automatically be stopped.

(It won’t be restarted automatically when you update from the command line though so you’ll need to start the mediacenter service back up again or reboot)

Thanks for the fast reply @ActionA and @DBMandrake.

I just ran an update through SSH and then rebooted but osmc is still saying update available. Is that normal?

Yes. My OSMC won’t remove the updates available icon until you check for updates via My OSMC.

Do you know if there is a way to reset the update notification trigger? I’d like for OSMC to notify me when there is an update but run my bash script that runs a backup and syncs it to my remote file server before running the update and then reset the update notification.

cc @Karnage

I’m interested in that feature to.
I usually do the updates (3 Osmc devices in the house) remotely. It’s convenient to do them all at once, and usually done late in the evening when the rest of the users (family) are asleep.

It would be great to be able to trigger an update that behaves the same way as doing it via MyOsmc addon.

Why not just restart Kodi afterwards?

That doesn’t reset the updates required icon AFAIK.

Interesting if it doesn’t.

We could set a postinst script to touch a file which @Karnage can check for. He then removed the notification and deletes the file

One problem with doing a restart is the EDID information (TV/Projector is of when I do the remote update).

Is there a way around that?

http://kodi.wiki/view/Raspberry_Pi_FAQ#TV_is_not_detected_unless_powered_on_first

Is there a similar function for the Vero? (I currently have Rbp 1, Rpb 2 and a Vero)

You can either ignore the EDID on Vero via uEnv.txt or specify a custom EDID. If you have a quick search you should find some info on this.

Sam

Thanks for the hints, will have a look.

This is probably not a very common use case or very important (since the normal update works fine). But its always fun to play around and try to make small improvements to the management of the Kodi setup at home :slightly_smiling: