How often to update ubuntu with openhab

Hey guys,

I am relatively new to OpenHAB and have a ‘best practices’ question for all of you linux users out there. My OpenHAB is running on a Ubuntu server 18.04 instance. Should i keep ubuntu up to date?

I usually log in and:
-sudo apt update
-sudo apt upgrade
about once a month or more frequently if im sshing in for another reason but i know some software is sensitive to OS/package upgrades.

Your guidance is appreciated.

It depends on how you want to deal with problems. If you upgrade frequently each upgrade will be a fewer amount if changes so if something goes wrong it’s easier to pinpoint the problem. But every time you upgrade you potentially have to deal with some problem which can take more time than you have at that moment.

Personally, I upgrade a few times a week. And it’s worth noting that I’ve never run into trouble except when I’ve tried to upgrade the whole os to the next release (e.g. from Jessy to Buster).

The upgrades from Ubuntu seem to be really well tested so I would recommend you upgrade as often as you get to it.

I run tripwire on all of my machines and it sends me a report every night with all the changes to the monitor files. I have filters set up in Gmail to ignore the reports where no files changed. So I pretty much run an upgrade every time the tripwire emails start showing up in my inbox because my upgrade scripts (Ansible playbooks) perform an upgrade and reset Tripwire.

I can say that at least in the industry where I work, upgrading every 90 days is considered really frequently. Others will recommend to never ever upgrade until you are ready to rebuild. My approach runs a higher risk if something going wrong but I get to take advantage of the bleeding edge.

1 Like

I’m running openHAB on Ubuntu 16.04 and upgrade whenever I can and haven’t run into problems so far. Just make sure you have the right setting for the openHAB upgrade: snapshot, milestone or stable if I remember correctly. See docs how to change between these releases.

That’s a great point. I want to manually upgrade OpenHAB via the openHABian-config. Not through apt upgrade.

Can you possibly point me to the docs where it says how to set how Openhab is upgraded via apt?

OpenHABian-config sets the repo and uses apt to install & upgrade. OpenHABian also lets you change to a different repo.

I thought Ubuntu does auto updates by default and complains mightily if you turn them off.

1 Like

Ohh got it. That makes sense. I am running 2.4 stable right now and have that selected in the config.

Not in my experience, at lest no more than Raspbian. When I log in there is a notification in the terminal along the lines of

Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-54-generic x86_64)
...
1 package can be updated.
0 updates are security updates.

Those numbers will continue to grow but I’ve not seen any other complaints from the OS.

Whenever I tried working with Ubuntu I usually collided with its unwanted automated systems while trying to install what I want on the server.
Consequently, I tend to avoid Ubuntu in favor of something else.

I’ve no idea what automation systems you are taking about. I’ve never had any issues installing anything on my machines. All but one of my VMs run Ubuntu (that one is running Debian). One of those VMs is a Desktop image, the other three are Ubuntu Lite.

In my experience, in terms of installing/uninstalling software, Ubuntu is identical to Debain, Raspian, and Mint and only different from SuSE and Fedora/Red Hat/CentOS in that those use a different package manger.

OK. Never tried Ubuntu Lite. Just the original full Desktop version.

But I also use the desktop version and I’m not sure what automation system you are referring to. I’m curious what you could be referencing. Maybe I’m missing something. Maybe there are ways around the problems you experienced.

Just noticed you´re running a 18.04.3. Mine says:

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 3.14.79-117 aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage


0 packages can be updated.
0 updates are security updates.

When updating, doesnt it update the kernel as well? Or is the differences because of the different OS ?

That’s not the kernel version. That’s the Ubuntu Distro version.

Ubuntu has two releases a year and they use a yy.mm.p format for their version numbers. So “Ubuntu 16.04.6 LTS” means you are running the version of Ubuntu that was released in April of 2016 (code named Xenial Xerus) patch 6 and the LTS (long term support) means that that version of Ubuntu will continue to be supported until 2021 (five years) at which point Ubuntu will no longer provide patches. Ubuntu releases a LTS version every two years which is why my 2018 distro also has LTS.

The stuff in the parentheses to the right indicates the kernel version. Typically a Linux distro will not upgrade the kernel except when they release a whole new distro. That doesn’t mean they do not provide patches for the kernel as bugs and security problems are discovered. The kernel is patched for that stuff with an apt-get upgrade or apt-get dist-upgrade.

That being said, 3.14 seems pretty old even for Ubuntu 16. All the stuff online says it should be something like 4.4.

The current release of the Ubuntu distro is 19.04 but it’s not a LTS version. We need to wait for next April for the next one of those.

I never broke anything upgrading packages from an LTS (I work as sys admin)…even when it’s the kernel, because with those commands you cannot perform a release upgrade, you can go and update as much often you want to.

The release upgrade is a different story I would go carefully with that because usually there are potentially breaking changes.

During the install process Ubuntu server aks if you want to install security updates automatically, that’s the only automation “out of the box” I’m aware of.

This is my 16.04 LTS version:

Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-151-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

20 packages can be updated.
0 updates are security updates

I think the difference is in the version, my version is x86_64 while @Kim_Andersen uses a aarch64 version.

So the one I´m running is quite old I suspect?

If it aint broke, dont fix it is my moto. Shit breaks when people upgrade and touch stuff, so unless theres some glaring security issue i never update mine.

Okay, I´ll let it run :smiley:

I can’t say. I know with x86_64 I’d expect to see 4.4 as the version. But maybe the latest and greatest for aarch64 is 3.14.

I’m sure you are fine and as long as the “X updates are security updates” is zero most of the time (don’t forget to reboot when that login info tells you to too) I’m sure you are fine. Just plan on reinstalling the OS sometime before April 2021. You’ll probably want to grab version 20.4 at that point.

And I probably have had the time to figure what all this Ubuntu is… Atm its running on my Odroid which Stuart helped me with. I have aprox zero knowledgde about it :smiley: