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, click on More Options (the 3 dots, right in the top bar) and click on About.

If you have an older version running ( < 5.8.xx) you will see the version info in the top left the corner.

Unifi Controller Rasberry Pi Update

If we take a look at the Ubiquiti Download page, we see that the latest version is 5.10.12 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), select Auto Backup 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.

  1. Download Putty
  2. After installing Putty start it and enter the Ip Address from your Pi in the address bar.
  3. 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.

Unifi Controller is updating

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 an installation or update is pretty high. Below I have listed some of the error I ran into during the update of the Unifi Controller.

Conflicting Distribution

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 run 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.

Blank screen after update

If you get a blank screen after updating to 5.10.12 or higher, then your Java version is probably outdated. Rasbian is shipped with an older version of Java, and for 5.10.12 and higher you need atleast Java 1.8.0_201.

You can follow this guide to update your Java version

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”

Get more stuff like this

IT, Office365, Smart Home, PowerShell and Blogging Tips

I hate spam to, so you can unsubscribe at any time.

9 thoughts on “Updating Unifi Controller on Raspberry Pi”

  1. Great article, Ruud! One question: Since this is the Lazy Admin, is there any way automatically see if there is an update and apply it if there is one?

    Regards,
    Karl S

    • Well you should get an notification / popup asking if you want to receive a notification when I publish a new article.

      You can also subscribe to the newsletter, I sent an update once a month with some of the latest articles.

  2. Bummer!
    I have tried all of your recommendations and unfortunately now… My controller will not start.

    [email protected]:~ $ uptime
    05:06:04 up 11 min, 1 user, load average: 0.08, 0.07, 0.01
    [email protected]:~ $
    [email protected]:~ $ java -version
    openjdk version “1.8.0_212”
    OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-2~deb9u1-b03)
    OpenJDK Client VM (build 25.212-b03, mixed mode)
    [email protected]:~ $

    sudo apt-get update && sudo apt-get upgrade -y
    Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
    Hit:3 http://raspbian.raspberrypi.org/raspbian stretch InRelease
    Hit:1 https://dl.ubnt.com/unifi/debian stable InRelease
    Reading package lists… Done
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Calculating upgrade… Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    [email protected]:~ $

    Found the Fix before hitting submit… This is what worked for me:
    sudo chmod 777 /etc/default/unifi
    sudo service unifi stop
    sudo apt purge oracle-java8-jdk -y
    sudo sed -i ‘s/^JAVA_HOME/#JAVA_HOME/’ /etc/default/unifi
    sudo echo “JAVA_HOME=”$( readlink -f “$( which java )” | sed “s:bin/.*$::” )”” >> /etc/default/unifi
    sudo chmod 644 /etc/default/unifi
    sudo service unifi start

    Hope this helps someone!

    Cheers,
    DarcWing

  3. Hi Ruud, many thanks for this! I updated the Unifi controller as per your instructions and it seemed to have worked as I did not get any errors. But now the controller won’t start up, and a reboot doesn’t fix this either. How to proceed?

Leave a Comment