Overview
This article describes how to set up and update a UVC-NVR if updating via the UniFi Video user interface is not working, which is the case if the NVR is on a very old version. The NVR has the singularity that when reset back to factory defaults, it will go back to the original firmware, sometimes going back to versions that are more than five years old. Because of this, depending on the version it goes back to, different upgrade processes must be followed. This article provides a script that will allow any NVR to be brought to the most current version possible.
Table of Contents
Introduction
When setting up an NVR for the first time, or after performing a factory reset, the NVR operating system should be updated, credentials secured, and the video software installed from scratch (rather than upgrading). The steps in the following section will guide you through that process.
How to Perform UVC-NVR Setup
1. SSH into the NVR using a CLI application (such as Command Prompt or Terminal, for example). Follow this article to learn how to make an SSH connection. Since the NVR has been reset to defaults (or is new) the username to be used for the SSH session will be root, and the default password will be ubnt. The IP address requested is the NVR's IP. There are several ways to find out the NVR's IP address which will vary, one way is to use WiFiman.
2. Use one of the following commands (depending on the NVR device in question) to clean any old versions of UniFi Video or airVision that may be part of the original firmware. Hover and click on the Click to copy pop-up and then paste the command on the CLI application, hitting enter to run the commands. Only one of these should be successful, nothing will happen if the incorrect command is used.
apt-get purge airvision
apt-get purge airvision2
apt-get purge unifi-video
3. Issue the following commands hitting enter.
rm -rf /etc/apt/sources.list.d/*airvision* /etc/apt/sources.list.d/*video* /etc/apt/sources.list.d/*mfi*;
apt-get autoclean -y;
rm /etc/apt/sources.list;
rm /etc/apt/sources.list.d/security.list;
wget -qO - https://www.ubnt.com/downloads/unifi-video/apt-3.x/unifi-video.gpg.key | sudo apt-key add -;
echo 'deb [arch=amd64] http://www.ubnt.com/downloads/unifi-video/apt-3.x wheezy ubiquiti' > /etc/apt/sources.list.d/unifi-video.list;
echo 'deb http://archive.debian.org/debian/ wheezy main contrib non-free' >> /etc/apt/sources.list;
echo 'deb http://archive.debian.org/debian-security/ wheezy/updates main' >> /etc/apt/sources.list.d/security.list;
dpkg --configure -a;
apt-get update -o Acquire::Check-Valid-Until=false --force-yes;
apt-get upgrade -y -o Acquire::Check-Valid-Until=false -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes;
4. Issue the following commands, hitting enter. If asked if you'd like to restart services during package upgrades without being asked, select 'yes'.
echo 'deb http://archive.debian.org/debian/ jessie-backports main' >> /etc/apt/sources.list.d/openjdk.list;
echo 'deb http://archive.debian.org/debian/ jessie main' >> /etc/apt/sources.list.d/openjdk.list;
apt-get update -o Acquire::Check-Valid-Until=false;
apt-get install -y -t jessie-backports openjdk-8-jre-headless --force-yes;
5. Issue the following command and hit enter:
apt-get install -y nano --force-yes;
6. Issue the following commands and hit enter:
rm /etc/apt/sources.list.d/openjdk.list;
apt-get install -y unifi-video
7. Issue the following command and hit enter:
apt-get install -f -y -o Acquire::Check-Valid-Until=false;
8. Issue the following commands and hit enter:
apt-get autoremove;
apt-get clean;
apt-get update -o Acquire::Check-Valid-Until=false;
hn=$(cat /etc/hostname)
if [[ $hn == "airVisionNVR" ]]; then
/usr/sbin/nvr-systool hostname UniFi-Video-a
fi
9. Exit the SSH session by typing out the following command and hitting enter:
exit
Related Articles
Intro to Networking - How to Establish a Connection Using SSH
UniFi Video - How to Enable SSH on the UVC-NVR
UniFi Video - How to Reset a UniFi Video Installation for Linux / UVC-NVR