Something I keep meaning to do is upgrade my Unifi network controller that I have a on Pi. It’s an important thing to do too due to the security risk.
It was so long since I last did it I really couldn’t remember how I installed it, so I had to faff a bit and thought I’d share my process.
Firstly log into your existing controller and save a backup, this is done by going to settings – maintenance or on the newer Settings – System page. Scroll down and download the latest backup of the controller.
Firstly SSH into the Pi and do an apt update.
puk@PiHole:~ $ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
So unfortunately, my unifi controller wasn’t seen in the apt list, time to add it.
puk@PiHole:~ $ echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee -a /etc/apt/sources.list.d/ubnt.list > /dev/null
puk@PiHole:~ $ sudo apt-get install dirmngr
Reading package lists... Done
Building dependency tree
Reading state information... Done
dirmngr is already the newest version (2.2.12-1+rpi1+deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
puk@PiHole:~ $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50
Executing: /tmp/apt-key-gpghome.7K4yzlPsCd/gpg.1.sh --keyserver keyserver.ubuntu.com --recv C0A52C50
gpg: key 06E85760C0A52C50: public key "UniFi Developers <unifi-dev@ubnt.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
This has added the unifi controller to the apt list. Time to ugrade it:
puk@PiHole:~ $ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://dl.ubnt.com/unifi/debian stable InRelease [3,038 B]
Get:4 https://dl.ubnt.com/unifi/debian stable/ubiquiti armhf Packages [732 B]
Fetched 3,770 B in 3s (1,336 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
puk@PiHole:~ $
puk@PiHole:~ $ apt list --upgradeable
Listing... Done
unifi/stable 7.1.66-17875-1 all [upgradable from: 5.14.22-13865-1]
N: There is 1 additional version. Please use the '-a' switch to see it
puk@PiHole:~ $ apt list --upgradable -a
Listing... Done
unifi/stable 7.1.66-17875-1 all [upgradable from: 5.14.22-13865-1]
unifi/now 5.14.22-13865-1 all [installed,upgradable to: 7.1.66-17875-1]
puk@PiHole:~ $
puk@PiHole:~ $ sudo apt install unifi -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
unifi
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 177 MB of archives.
After this operation, 42.5 MB disk space will be freed.
Get:1 https://dl.ubnt.com/unifi/debian stable/ubiquiti armhf unifi all 7.1.66-17875-1 [177 MB]
Fetched 177 MB in 1min 4s (2,743 kB/s)
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
(Reading database ... 66161 files and directories currently installed.)
Preparing to unpack .../unifi_7.1.66-17875-1_all.deb ...
Previous setting (UniFi 5.14.22) is found.
Unpacking unifi (7.1.66-17875-1) over (5.14.22-13865-1) ...
Setting up unifi (7.1.66-17875-1) ...
Processing triggers for systemd (241-7~deb10u8+rpi1) ...
puk@PiHole:~ $
This will launch an installer and ask whether you’ve got a backup file, click yes if you have, else go back to the top of this page and do it.
Finally the controller should reload into the latest version.