It’s important to keep your network product up-to-date. Most new firmware releases contain bug fixes, performance improvements and may contain support new technology/protocols. The Unifi Controller software is one of the most important parts of the Unifi network, so check regularly if there is a new firmware release. Or even better, signup for the newsletter, I will drop you an email with a download link and instructions 😉
We installed the Unifi Controller on a Raspberry Pi, so updating might be a little different then you are used to on a Windows machine. This guide will help you getting through the few steps to update every part of you Unifi Network.
- 1 Checking the currently running version
- 2 Make a backup of the Configuration
- 3 Login to the Unifi Controller with SSH
- 4 Updating the Pi and Unifi Controller
- 5 Error or warning during the update
- 6 Updating the AccessPoints
Checking the currently running version
First, let’s check which version we have running at our Unifi Controller. This is really simple, just log in to your controller, click on More Options (the 3 dots, right in the top bar) and click on About.
If you have a older version running ( < 5.8.xx) you will see the version info in the top left corner.
If we take a look at the Ubiquiti Download page, we see that the latest version is 5.9.29 at the moment of writing.
Make a backup of the Configuration
Before you update any device, always make sure you have a backup of the configuration. There are many reasons why things can break and create a backup is just a few clicks. Go to the settings page in the Unifi Controller (lower left corner) and download the last backup in the list.
In case the upgrade goes wrong, we can re-install the Unifi Controller and simply load the configuration back into the controller. Saving us a lot of time with figuring out all the (optimized) settings that we made before.
Login to the Unifi Controller with SSH
Just like when we installed the Unifi Controller on the Raspberry Pi, we need Putty to log in over SSH to update the controller.
Connecting to the Pi with SSH
So we are now ready to remotely manage the Raspberry Pi over SSH. You will need a client for this, I suggest Putty is the best tool for the job.
- Download Putty
- After installing Putty start it and enter the Ip Address from your Pi in the address bar.
- Click on Open, the prompt will ask you to log in (pi and your password (or default raspberry)
Updating the Pi and Unifi Controller
We are logged in to the Pi and with a single command, we can now update the Unifi Controller and the rest of the software on the Raspberry Pi.
Run the following command:
sudo apt-get update && sudo apt-get upgrade -y
All the package that needs to be updated will be processed and updated. You will receive a notice with the question if you have a backup of the Unifi Configuration. Click Yes, because we did that a few steps ago.
During the installation of the update the Pi will reboot. A blue screen with a grey dialog box will appear, asking if you have make a backup file. Click yes, we did that in step 1, and the installation will continue.
Error or warning during the update
With Linux the change you run into an error during a installation or update is pretty high. Below I have listed some of the error I ran into during the update of the Unifi Controller.
If we are performing an update to the next major version, for example, from 5.8.xx to 5.9.xx, we can get an error like below:
Conflicting distribution: http://dl.ubnt.com/unifi/debian stable InRelease (expected unifi-5.8 but got unifi-5.9)
We can fix this error with the following command:
sudo apt update --allow-releaseinfo-change
Now I got an error running the command above, is not understood in combination with the other options. But we can running the following two commands to fix this:
sudo apt clean
sudo apt update
error: dpkg interrupted
If somehow the update/upgrade gets interrupted and you try it again, you can get an error: dpkg interrupted, you must manually run ‘sudo dpkg –configure -a’ to correct the problem. The fix for this is in the message, just run the command to correct the problem. When that process is finished you can run the update/upgrade command again.
error: Sub-process /usr/bin/dpkg returned an error code (1)
The above error happened on me last time I updated to the new Unifi Controller version. If you get this error, then one of the packages is broken, the line above the error will tell you which package is causing the error.
So there are a few ways to fix the error, what worked for me was to reconfigure the package database. It got probably corrupted while installing a package. Reconfiguring solves this issue most of the time:
sudo dpkg --configure -a
If that doesn’t work you can try to remove the package and then update the package list.
sudo rm /tmp/apt-dpkg-install-HHVVn9/10-libraspberrypi-doc_1.20180919-1_armhf.deb
#Then update package lists:
sudo apt-get update
#And then install all upgrades including new dependencies:
sudo apt-get dist-upgrade
#Also you can remove some junk packages:
sudo apt-get autoremove
#If problem persists - clean package cache with
sudo apt-get clean
#and start over.
Updating the AccessPoints
After you updated the controller, you can also update the Unifi devices. After you log back into the controller you probably will see a notice that there is a new firmware version available. Just go to the Devices page and hit the upgrade button on the right side of each device. Or even better, hit the big blue button (top right) with “Start rolling update”