Reply
Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello,

 

Added some lines so it will download needed packages (curl & software-properties-common) while updating your system.

This has been reported by a user, thank you!

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 1
Registered: ‎08-12-2017

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

It would be nice to have this housekeeping in the script. I had the same issue. A "sudo rm /etc/apt/sources.list.d/mongodb*" got rid of it all.

Emerging Member
Posts: 40
Registered: ‎11-03-2015
Kudos: 2

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

@AmazedMender16 I just ran the script on an AWS instance that was giving us issues and it now shows the controller version as 5.4.16  Ran on Ubuntu 16.04.

Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @rmiller1257,

 

Thats most likely since you had already a older version installed, Could you share what MongoDB version you are running + java version?

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Emerging Member
Posts: 40
Registered: ‎11-03-2015
Kudos: 2

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Mongo is 3.4.16. Java is 1.8.0_181

Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @rmiller1257,

 

And it installed 5.4.16 or gave you error codes?

 

Lets upgrade the controller manually to 5.6.39 Man Happy (Since im not sure what devices you're running..)

wget https://dl.ubnt.com/unifi/5.6.39/unifi_sysvinit_all.deb
dpkg -i unifi_sysvinit_all.deb
rm unifi_sysvinit_all.deb

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Emerging Member
Posts: 40
Registered: ‎11-03-2015
Kudos: 2

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

It installed 5.4.16, no error codes. I was running 5.7.20 on it previously
Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @rmiller1257,

 

I highly doubt that... May I remote in using teamviewer?

If so please PM me the teamviewer details.

 

If not run this command, after that run the script again.

rm /etc/apt/sources.list.d/100-ubnt-unifi.list

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Emerging Member
Posts: 40
Registered: ‎11-03-2015
Kudos: 2

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Manually upgraded to 5.6.39. Currently it is migrating the database. Once it is back up what would you suggest i do next?
Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello @rmiller1257,

 

Run the command from my previous post, after that run the 5.8.24 script.. I would like to take a look at your controller through teamviewer.

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 11
Registered: ‎06-28-2016
Kudos: 5

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

 

● unifi.service - unifi
Loaded: loaded (/lib/systemd/system/unifi.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-07-20 13:24:07 UTC; 16min ago
Process: 10607 ExecStart=/usr/lib/unifi/bin/unifi.init start (code=exited, status=0/SUCCESS)
Main PID: 21214 (code=exited, status=0/SUCCESS)
Tasks: 48
Memory: 326.6M
CPU: 1min 10.198s
CGroup: /system.slice/unifi.service
├─ 6976 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-oracle/jre -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi.pid -procname uni
├─ 6978 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-oracle/jre -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi.pid -procname uni
├─ 6979 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-oracle/jre -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi.pid -procname uni
├─19375 bin/mongod --dbpath /usr/lib/unifi/data/db --port 27117 --unixSocketPrefix /usr/lib/unifi/run --logappend --logpath /usr/lib/unifi/logs/mongod.log --nohttpinterface --bin
└─19630 /usr/lib/jvm/java-8-oracle/jre/bin/java -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dapple.awt.UIElement=true -Xmx1024M -XX:ErrorFile=/usr/lib/unifi/logs/hs_err_pid%p

Jul 20 13:24:06 ip-xxx-xx-xx-xx systemd[1]: unifi.service: Service hold-off time over, scheduling restart.
Jul 20 13:24:06 ip-xxx-xx-xx-xx systemd[1]: Stopped unifi.
Jul 20 13:24:06 ip-xxx-xx-xx-xx systemd[1]: Starting unifi...
Jul 20 13:24:07 ip-xxx-xx-xx-xx unifi.init[10607]: * Starting Ubiquiti UniFi Controller unifi
Jul 20 13:24:07 ip-xxx-xx-xx-xx unifi.init[10607]: ...fail!
Jul 20 13:24:07 ip-xxx-xx-xx-xx systemd[1]: Started unifi.
Jul 20 13:24:07 ip-xxx-xx-xx-xx systemd[1]: Started unifi.

@AmazedMender16 I have used your scripts to get an AWS Instance up and running 5.6.39. That controller works fine. When I run your script to upgrade to 5.8.24 the above text is what is returned and the controller does not come back online. Is there something I am missing?

Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @georgearnold,

 

Please, could you try to run the following commands.. (Just tried it cannot reproduce..)

systemctl restart unifi

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 11
Registered: ‎06-28-2016
Kudos: 5

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Sorry, Glenn. I am very new to this. I input what you asked and was asked for a password. I never set a password for the user Ubuntu. I have tried no password, toor, and ubuntu for the pass and I'm not getting authentication. @AmazedMender16

 

ubuntu@ip-xxx-xx-xx-xx:~$ systemctl restart unifi
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'unifi.service'.
Authenticating as: Ubuntu (ubuntu)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to restart unifi.service: Access denied
See system logs and 'systemctl status unifi.service' for details.

  

Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello,

 

 

Did you run the scripts as root??

Did you login as root? If not run the following command.

sudo systemctl restart unifi

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 11
Registered: ‎06-28-2016
Kudos: 5

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Whether I run it as root or using sudo, it just sits there and doesn't do anything. I can downgrade back to 5.6.39 and everything will work again. For some reason, when upgrading to 5.8.xx the controller fails to start.

ubuntu@ip-xxx-xx-xx-xx:~$ sudo systemctl restart unifi
^C
ubuntu@ip-xxx-xx-xx-xx:~$ sudo su
root@ip-xxx-xx-xx-xx:/home/ubuntu# sudo systemctl restart unifi
root@ip-xxx-xx-xx-xx:/home/ubuntu# systemctl restart unifi
^C
root@ip-xxx-xx-xx-xx:/home/ubuntu#
Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello,

 

Did you use my scripts to install 5.6.39 aswell?

Can i remote in using teamviewer?

 

What java version are you running?

What mongodb version are you running?

Could you let the server finish the controller restart? You’re canceling the restart..

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Hello,

 

The issue on @georgearnold controller has been solved.

Since it was a new controller i just reinstalled the controller software.

This fixed all issues he was having.

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 3
Registered: ‎12-06-2016

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

Thank you for these scripts, however I am running into an issue. Are you able to help?

 

Selecting previously unselected package unifi.
(Reading database ... 118992 files and directories currently installed.)
Preparing to unpack unifi_sysvinit_all.deb ...
Unpacking unifi (5.8.24-11016) ...
dpkg: dependency problems prevent configuration of unifi:
unifi depends on mongodb-server (<< 1:3.6.0) | mongodb-10gen (<< 3.6.0) | mongodb-org-server (<< 3.6.0); however:
Package mongodb-server is not installed.
Package mongodb-10gen is not installed.
Version of mongodb-org-server on system is 3.6.6.

dpkg: error processing package unifi (--install):
dependency problems - leaving unconfigured
Processing triggers for systemd (237-3ubuntu10.2) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
unifi

########################################
# An error occurred. Aborting script.. #
########################################

thadude@unificont:~$

Senior Member
Posts: 10,618
Registered: ‎08-04-2017
Kudos: 1723
Solutions: 521

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

[ Edited ]

Hello @thadude3,

 

Did you already have a controller running on the server?

 

If not please run these commands to remove the current mongodb

sudo service mongod stop
sudo apt purge mongodb-org*
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
sudo apt autoremove 

 

Regards,

Glenn R.

 

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 3
Registered: ‎12-06-2016

Re: UniFi Installation Scripts - Works on Ubuntu 18.04 and 16.04

No, this is a fresh install of 18.04. I did a reinstall because my controller was on 16 and everything was unsupported for upgrading. So I created a new vm with the latest Ubuntu, only to run into these problems installing because 18.04 isn't supported. So I tried your script and ended up with the error you saw.

I ran your commands above and re ran the script. Still the same error.

Selecting previously unselected package unifi.
(Reading database ... 118992 files and directories currently installed.)
Preparing to unpack unifi_sysvinit_all.deb ...
Unpacking unifi (5.8.24-11016) ...
dpkg: dependency problems prevent configuration of unifi:
unifi depends on mongodb-server (<< 1:3.6.0) | mongodb-10gen (<< 3.6.0) | mongodb-org-server (<< 3.6.0); however:
Package mongodb-server is not installed.
Package mongodb-10gen is not installed.
Version of mongodb-org-server on system is 3.6.6.

dpkg: error processing package unifi (--install):
dependency problems - leaving unconfigured
Processing triggers for systemd (237-3ubuntu10.2) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
unifi

########################################
# An error occurred. Aborting script.. #
########################################


It looks like my aptget is installing mongo 3.6.6 , is there a way to force it to an older version through your script?

Reply