Reply
New Member
Posts: 14
Registered: ‎08-18-2017
Accepted Solution

MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

I've tried nearly everything I could find on the web but I'm stuck :/

My UniFi controller is running but I can't connect to the web interface, I tracked it down to a faulty MongoDB Install.

Thing is, it was working fine in 17.10. Now after upgrading to 18.04 I lost access to my UniFi controller due to MongoDB.

I tried reinstalling MongoDB via this webpage.

Now when I run apt upgrade I get the following errors:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mongodb-org : Depends: mongodb-org-server but it is not installed
               Depends: mongodb-org-mongos but it is not installed
               Depends: mongodb-org-tools but it is not installed
 unifi : Depends: mongodb-server (>= 2.4.10) but it is not installed or
                  mongodb-10gen (>= 2.4.14) but it is not installable or
                  mongodb-org-server (>= 2.6.0) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When I then run apt "--fix broken instal"l or "apt install -f" I get this:

The following packages were automatically installed and are no longer required:
  libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 mongo-tools mongodb-server-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  mongodb-org-mongos mongodb-org-server mongodb-org-tools
The following NEW packages will be installed:
  mongodb-org-mongos mongodb-org-server mongodb-org-tools
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.5 MB of archives.
After this operation, 243 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6/multiverse amd64 mongodb-org-mongos amd64 3.6.4 [8,486 kB]
Get:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6/multiverse amd64 mongodb-org-server amd64 3.6.4 [15.0 MB]
Get:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6/multiverse amd64 mongodb-org-tools amd64 3.6.4 [35.0 MB]                                                                                   
Fetched 58.5 MB in 11s (5,328 kB/s)                                                                                                                                                                        
(Reading database ... 397730 files and directories currently installed.)
Preparing to unpack .../mongodb-org-mongos_3.6.4_amd64.deb ...
Unpacking mongodb-org-mongos (3.6.4) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_3.6.4_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-server_3.6.4_amd64.deb ...
Unpacking mongodb-org-server (3.6.4) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_3.6.4_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-tools_3.6.4_amd64.deb ...
Unpacking mongodb-org-tools (3.6.4) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.6.4_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/mongodb-org-mongos_3.6.4_amd64.deb
 /var/cache/apt/archives/mongodb-org-server_3.6.4_amd64.deb
 /var/cache/apt/archives/mongodb-org-tools_3.6.4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I would greatly appreciate any help


Accepted Solutions
Senior Member
Posts: 24,044
Registered: ‎08-04-2017
Kudos: 4557
Solutions: 1185

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Hello @LK_LAW,

 

Did you run the commands above?

Do you have teamviewer so I can take a look?

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK

View solution in original post


All Replies
Member
Posts: 263
Registered: ‎12-12-2015
Kudos: 96
Solutions: 10

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

18.04 is not yet supported but if you search the forums others have gotten it to work.  

Regular Member
Posts: 399
Registered: ‎07-23-2015
Kudos: 163
Solutions: 9

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Would be nice if an official guide was pinned to the forum when a new version of Ubuntu comes out Man Happy
New Member
Posts: 14
Registered: ‎08-18-2017

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

I have this post where they got it to work.

However, this is a problem with conflicting repos, which I have no idea on how to solve :/

Member
Posts: 263
Registered: ‎12-12-2015
Kudos: 96
Solutions: 10

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04


@bledd wrote:
Would be nice if an official guide was pinned to the forum when a new version of Ubuntu comes out Man Happy

Ubuntu does not even support upgrading LTS until the first point release.  Doesn't matter if a guide is pinned since people generally upgrade, break things, and then come here.

 

https://askubuntu.com/questions/125825/upgrading-lts-to-lts-server-why-wait-for-the-first-point-rele...

New Member
Posts: 12
Registered: ‎05-05-2016
Kudos: 1

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

[ Edited ]

LK_LAW, I got exactly the same problem (mongod is OK but crashes when I start Unifi)  but didn't succeed to find a solution by now...

 

I alos got stuck with the broken install of 'mongodb' (from Ubuntu repository) and 'mongodb-org'. You have to manually download the files 'mongodb*.dpkg' or 'mongodb-org*.dpkg' and install them with 'dpkg -i ...' Smiley Wink

New Member
Posts: 14
Registered: ‎08-18-2017

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

It's not that MongoDB crashes, systemctl still it's ok, but some parts of mongodb are not installed because of a conflicting repo :/

New Member
Posts: 14
Registered: ‎08-18-2017

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

[ Edited ]

So not the deb files?

I just tried with the .deb file and got this:

Selecting previously unselected package mongodb.
dpkg: regarding mongodb_3.6.3-0ubuntu1_amd64.deb containing mongodb:
 mongodb-org conflicts with mongodb
  mongodb (version 1:3.6.3-0ubuntu1) is to be installed.

dpkg: error processing archive mongodb_3.6.3-0ubuntu1_amd64.deb (--install):
 conflicting packages - not installing mongodb
Errors were encountered while processing:
 mongodb_3.6.3-0ubuntu1_amd64.deb

Do you have the link for the dpkg file? 

New Member
Posts: 12
Registered: ‎05-05-2016
Kudos: 1

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

[ Edited ]

Try first to remove the version you don't need with "dpkg --purge mongodb??? ..."

 

To find the .deb files, try from you Ubuntu repository...

For me it's : http://fr.archive.ubuntu.com/ubuntu/pool/universe/m/mongodb/

New Member
Posts: 1
Registered: ‎06-17-2018

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

LK_LAW, 

I have the exact same problem with Ubuntu 18.04 LTS and Mongodb.  

Were you able to solve it? What did you do?

Emerging Member
Posts: 44
Registered: ‎06-23-2018
Kudos: 9

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Was anyone ever able to install UniFi Controller on 18.04? I'm stuck without a controller until I can get this working.

Senior Member
Posts: 24,044
Registered: ‎08-04-2017
Kudos: 4557
Solutions: 1185

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Hello @ntrstngftrmth,

 

My scripts will work on Ubuntu 18.04 Man Happy

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
Emerging Member
Posts: 44
Registered: ‎06-23-2018
Kudos: 9

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Thanks! I was able to get it working that night just fine. It took some patience but all is good now.

New Member
Posts: 14
Registered: ‎08-18-2017

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

[ Edited ]

I used your script but it fails at installing unifi because it doesn't install some dependencies when installing mongodb...

@AmazedMender16

Senior Member
Posts: 24,044
Registered: ‎08-04-2017
Kudos: 4557
Solutions: 1185

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

[ Edited ]

Hello @LK_LAW,

 

Please post the errors in the thread you got the scripts from, I will help you get it all working!

 

 

Regards,

Glenn R.

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

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

[ Edited ]

Hello @LK_LAW,

 

Run the commands below.

sudo apt purge unifi -y
sudo service mongod stop sudo apt purge mongodb-org* sudo rm -r /var/log/mongodb sudo rm -r /var/lib/mongodb sudo rm /etc/apt/sources.list.d/mongod*.list sudo apt purge oracle-java* -y sudo apt autoremove
sudo apt clean

After running these commands execute my script once again.

 

 

 

Regards,

Glenn R.

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

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Hi @AmazedMender16 thanks for your help, I've been having trouble with this for quite a while now...

 

Here's the error log I'm getting currently:

(Reading database ... 357954 files and directories currently installed.)
Removing mongodb (1:3.6.3-0ubuntu1) ...
Removing mongodb-server (1:3.6.3-0ubuntu1) ...
Removing mongodb-clients (1:3.6.3-0ubuntu1) ...
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 357937 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_3.4.17_amd64.deb ...
Unpacking mongodb-org-shell (3.4.17) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.4.17_amd64.deb ...
Unpacking mongodb-org-server (3.4.17) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_3.4.17_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.4.17_amd64.deb ...
Unpacking mongodb-org-mongos (3.4.17) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_3.4.17_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_3.4.17_amd64.deb ...
Unpacking mongodb-org-tools (3.4.17) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.4.17_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.4.17_amd64.deb ...
Unpacking mongodb-org (3.4.17) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mongodb-org-server_3.4.17_amd64.deb
 /var/cache/apt/archives/mongodb-org-mongos_3.4.17_amd64.deb
 /var/cache/apt/archives/mongodb-org-tools_3.4.17_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

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

I'm completely clueless as to how to solve this. 

Senior Member
Posts: 24,044
Registered: ‎08-04-2017
Kudos: 4557
Solutions: 1185

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Hello @LK_LAW,

 

Did you run the commands above?

Do you have teamviewer so I can take a look?

 

 

Regards,

Glenn R.

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

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Yup I have run those.

I'll PM you for teamviewer

New Member
Posts: 14
Registered: ‎08-18-2017

Re: MongoDB failing to install (For UniFi Controller) - Ubuntu 18.04

Thanks again for solving my problem, you're a savior Man Very Happy

Reply