Ubiquiti NVR install after HDD replace

Create booting USB with rufus. Install Debian 7 from USB key. Copy the rtl_nic directory to usb key from the firmware-realtek_0.36+wheezy.1_all.deb file.

The network packages is avaible in the debian archive, so the package manager mirror must be set to archive.debian.org.

1. Add Java 8 PPA

First you need to add webupd8team Java PPA repository in your system. Edit a new ppa file /etc/apt/sources.list.d/java-8-debian.list in text editor
$ sudo vim /etc/apt/sources.list.d/java-8-debian.list
and add following content in it.
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
Now import GPG key on your system for validate packages before installing them.
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886

2. Install Java 8

Now use the following commands to update apt cache and then install Java 8 on your Debian system.
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

3. Verify Java Version

At this stage you have successfully installed oracle Java on your Debian system. Let’s use following command to verify installed version of Java on your system.
root@hackthesec:~$ java -version

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

4. Configure Java Environment

In Webupd8 ppa repository also providing a package to set environment variables, Install this package using following command.
$ sudo apt-get install oracle-java8-set-default

wget https://dl.ubnt.com/firmwares/unifi-video/v3.10.1/unifi-video.Debian7_amd64.v3.10.1.deb

sudo dpkg -i unifi-video.Debian7_amd64.v3.10.1.deb

sudo apt-get install -f

sudo dpkg -i unifi-video.Debian7_amd64.v3.10.1.deb