Updating Unifi Controller on Raspberry Pi
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.
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 and look at the top left corner. Just to the right of the logo, you will find the current version:
If we take a look at the Ubiquiti Download page, we see that the latest version is 5.8.28 at the moment of writing. So we can update the controller.
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.
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”