Error installing mongo db on ubuntu 20.04.2 LTS - node.js

I have tried purging and reinstalling mongo db several times but I continuously get the following error when installing. It seems like the problem comes in when trying to install additional packages and trying to remove mogodb, mongodb-clients, and mongodb-server:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following packages will be REMOVED:
mongodb mongodb-clients mongodb-server
The following NEW packages will be installed:
mongodb-org mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 6 newly installed, 3 to remove and 23 not upgraded.
3 not fully installed or removed.
Need to get 0 B/49.8 MB of archives.
After this operation, 124 MB of additional disk space will be used.
(Reading database ... 268876 files and directories currently installed.)
Removing mongodb (1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5) ...
Removing mongodb-server (1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5) ...
Removing mongodb-clients (1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5) ...
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 268856 files and directories currently installed.)
Preparing to unpack .../0-mongodb-org-shell_4.4.6_amd64.deb ...
Unpacking mongodb-org-shell (4.4.6) ...
Preparing to unpack .../1-mongodb-org-server_4.4.6_amd64.deb ...
Unpacking mongodb-org-server (4.4.6) ...
dpkg: error processing archive /tmp/apt-dpkg-install-i8t6ED/1-mongodb-org-server_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../2-mongodb-org-mongos_4.4.6_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.6) ...
dpkg: error processing archive /tmp/apt-dpkg-install-i8t6ED/2-mongodb-org-mongos_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-org-database-tools-extra.
Preparing to unpack .../3-mongodb-org-database-tools-extra_4.4.6_amd64.deb ...
Unpacking mongodb-org-database-tools-extra (4.4.6) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../4-mongodb-org-tools_4.4.6_amd64.deb ...
Unpacking mongodb-org-tools (4.4.6) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../5-mongodb-org_4.4.6_amd64.deb ...
Unpacking mongodb-org (4.4.6) ...
Errors were encountered while processing:
/tmp/apt-dpkg-install-i8t6ED/1-mongodb-org-server_4.4.6_amd64.deb
/tmp/apt-dpkg-install-i8t6ED/2-mongodb-org-mongos_4.4.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
If I try to fix the problem using
sudo apt --fix-broken install
I get these errors again:
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.6_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.6) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.4.6_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
additional information:
mongodb-org : Depends: mongodb-org-server but it is not going to be installed
Depends: mongodb-org-mongos but it is not going to be installed

Looks like other attempts to purge mongodb from my computer were insufficient, but I found this solution:
sudo apt remove mongodb
sudo apt purge mongodb
sudo apt autoremove
this removed all instances of mongodb and reinstalling it produced no errors

Related

How to handle the errors during libwebkitgtk installation on Ubuntu 18.04 LTS?

Every time I tries to install something on Ubuntu using sudo apt-get install ..., it shows like that:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libwebkit2gtk-4.0-37 : Depends: libjavascriptcoregtk-4.0-18 (= 2.32.3-0ubuntu0.18.04.1) but 2.32.4-0ubuntu0.18.04.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
First I tried to sudo apt-get install libwebkit2gtk-4.0-37, it shows like that:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libexiv2-14 libgee-0.8-2 libgexiv2-2 libraw16 linux-hwe-5.4-headers-5.4.0-66
linux-hwe-5.4-headers-5.4.0-67 linux-hwe-5.4-headers-5.4.0-73
linux-hwe-5.4-headers-5.4.0-74 shotwell-common
Use 'sudo apt autoremove' to remove them.
Suggested packages:
libwebkit2gtk-4.0-37-gtk2
The following packages will be upgraded:
libwebkit2gtk-4.0-37
1 upgraded, 0 newly installed, 0 to remove and 206 not upgraded.
43 not fully installed or removed.
Need to get 0 B/13.4 MB of archives.
After this operation, 81.9 kB of additional disk space will be used.
dpkg: warning: files list file for package 'fonts-sil-abyssinica' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libatk-adaptor:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libvorbisfile3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libquadmath0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxkbfile1:amd64' missing; assuming package has no files currently installed
<ignoring for a long long list>
Preparing to unpack .../libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libwebkit2gtk-4.0-37:amd64 (2.32.4-0ubuntu0.18.04.1) over (2.32.3-0ubuntu0.18.04.1) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb (--unpack):
cannot copy extracted data for './usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5' to '/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Then I thought that since it says but 2.32.4-0ubuntu0.18.04.1 is to be installed, so I tries uninstalling it using sudo apt-get purge 2.32.4-0ubuntu0.18.04.1, and things goes like that: (I don't know what the 2.32.4-0ubuntu0.18.04.1 means)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package 2.32.4-0ubuntu0.18.04.1
E: Couldn't find any package by glob '2.32.4-0ubuntu0.18.04.1'
E: Couldn't find any package by regex '2.32.4-0ubuntu0.18.04.1'
And I tried sudo apt --fix-broken install, but it still doesn't works. The error messages are the same as that when I run sudo apt-get install libwebkit2gtk-4.0-37.
Could someone help me out? Any reply is in fervent anticipation.
Platform: x64, Ubuntu 18.04 LTS

"mongodb-org : Depends: mongodb-org-server but it is not going to be installed" when installing mongodb in Ubuntu 20.04

I've committed the error of installing mongodb first by sudo apt install mongodb, removing it and then trying to install as the official documentation says so for Ubuntu 20.04 (Linux Mint), but now I can't install any other package because it gives me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
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 going to be installed
Depends: mongodb-org-mongos but it is not going to be installed
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Tried sudo apt reinstall sudo apt --fix-broken install sudo apt purge <package_name> sudo apt remove <package_name> sudo apt-get install -f
When running sudo apt install --fix-broken:
sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
The following NEW packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/89,2 MB of archives.
After this operation, 148 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 414079 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.6_amd64.deb ...
Unpacking mongodb-org-server (4.4.6) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6
d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.6_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.6) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6
d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.3.1_amd64.deb ...
Unpacking mongodb-database-tools (100.3.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.3.1_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-server_4.4.6_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.6_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.3.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
If I try to reinstall mongodb following the official doc it gives me again the same error I've mentioned before.
Thanks in advance.
This solved my problem;
dpkg -l | grep mongo will show the list of packages, then dpkg -r <nameofpkg> could be used for each packages for the output of dpkg -l | grep mongo.
Solved it.
sudo apt-get clean
sudo pkexec synaptic >> filter by "broken" >> remove completely the package
sudo apt-get install -f
Tanks for the help.

how to fix mongodb broken installation

i install mongo db from a website guide then i folllowed the step until i got this error on installation
I was try using install -f & apt update --fix-missing but still not working
root#danil-Lenovo-ideapad-120S-14IAP:/usr/bin# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libboost-filesystem1.65.1 libboost-iostreams1.65.1 libboost-program-options1.65.1 libgoogle-perftools4 libtcmalloc-minimal4 libyaml-cpp0.5v5 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 13 not upgraded.
2 not fully installed or removed.
Need to get 0 B/77,2 MB of archives.
After this operation, 266 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 267730 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_3.6.18_amd64.deb ...
Unpacking mongodb-org-server (3.6.18) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_3.6.18_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_3.6.18_amd64.deb ...
Unpacking mongodb-org-mongos (3.6.18) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_3.6.18_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-tools_3.6.18_amd64.deb ...
Unpacking mongodb-org-tools (3.6.18) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.6.18_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-server_3.6.18_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_3.6.18_amd64.deb
/var/cache/apt/archives/mongodb-org-tools_3.6.18_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

How to install software-properties-gtk package in python? on ubuntu

i run this command sudo apt install python3.7.
E: The package libglu1-mesa:i386 needs to be reinstalled, but I can't find an archive for it.
this error massage still showing.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
python3.7-venv python3.7-doc
The following NEW packages will be installed:
python3.7
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
Need to get 0 B/528 kB of archives.
After this operation, 439 kB of additional disk space will be used.
Selecting previously unselected package python3.7.
(Reading database ... 199040 files and directories currently installed.)
Preparing to unpack .../python3.7_3.7.7-1+bionic1_amd64.deb ...
Unpacking python3.7 (3.7.7-1+bionic1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Setting up python3.7 (3.7.7-1+bionic1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
dpkg: error processing package libglu1-mesa:i386 (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Errors were encountered while processing:
libglu1-mesa:i386
E: Sub-process /usr/bin/dpkg returned an error code (1)
use sudo apt-get install software-properties-gtk

Starting database: mongod failed

I fail to install mongodb on my server (ssh; linux-gnu). Get the following trace:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-tools
0 upgraded, 4 newly installed, 0 to remove and 47 not upgraded.
Need to get 0 B/46.7 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Selecting previously deselected package mongodb-org-server.
(Reading database ... 73280 files and directories currently installed.)
Unpacking mongodb-org-server (from .../mongodb-org-server_3.0.5_amd64.deb) ...
Selecting previously deselected package mongodb-org-mongos.
Unpacking mongodb-org-mongos (from .../mongodb-org-mongos_3.0.5_amd64.deb) ...
Selecting previously deselected package mongodb-org-tools.
Unpacking mongodb-org-tools (from .../mongodb-org-tools_3.0.5_amd64.deb) ...
Selecting previously deselected package mongodb-org.
Unpacking mongodb-org (from .../mongodb-org_3.0.5_amd64.deb) ...
Processing triggers for man-db ...
Setting up mongodb-org-server (3.0.5) ...
Starting database: mongod failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mongodb-org-mongos (3.0.5) ...
configured to not write apport reports
Setting up mongodb-org-tools (3.0.5) ...
dpkg: dependency problems prevent configuration of mongodb-org:
mongodb-org depends on mongodb-org-server; however:
Package mongodb-org-server is not configured yet.
dpkg: error processing mongodb-org (--configure):
dependency problems - leaving unconfigured
configured to not write apport reports
Errors were encountered while processing:
mongodb-org-server
mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have been following instructions from official documentation.
I tried to repair it, but it didn't help.
mongod --repair
2015-08-03T09:11:28.456+0200 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
2015-08-03T09:11:28.456+0200 I CONTROL [initandlisten] dbexit: rc: 100
I was also trying to install locales, but it also didn't help.
How can I get around this and install mongodb? What can be the error?
After successfully installing MongoDB (via Homebrew) on Yosemite, these instructions were displayed:
To have launchd start mongodb at login:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
Then to load mongodb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Or, if you don't want/need launchctl, you can just run:
mongod --config /usr/local/etc/mongod.conf
"/usr/local/etc/mongod.conf" contains the "dbpath" argument. After reviewing that file I was also able to start MongoDB as follows:
$ mongod --dbpath /usr/local/var/mongodb
On a Linux environment your paths are probably different, but I hope this helps answer your question and provides you with some direction to solve your problem.

Resources