Unable to install or remove mongodb - mongodb

I am trying to install mongodb 4.4 by using (running as root): apt install -y mongodb-org
but then I got
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-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).
So I use apt --fix-broken install and got:
(Reading database ... 72856 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.2_amd64.deb ...
Unpacking mongodb-org-server (4.4.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.2_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_4.4.2_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.2_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-database-tools_100.2.1_amd64.deb ...
Unpacking mongodb-database-tools (100.2.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.2.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.2_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.2_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.2.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
So I try to remove mongodb by using: apt remove mongodb-org and got:
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-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).

See Mongodb is not updated properly from 4.2 to 4.4.
Remove all installed mongodb packages then install the 4.4 ones.
Use dpkg -l |grep mongodb to find which ones you have installed.

Related

I'm having trouble running apt-get upgrade after installing all of the tools from Katoolin3

I installed katoolin3 in my Ubuntu 22.04 LTS Jammy release. I can't run the "sudo apt-get upgrade" command, and I can't fix the problem with "sudo apt --fix-broken install."
Whenever I am trying to do an "apt-get upgrade," it is giving me this error.
# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libgl1-mesa-dri : Depends: libglapi-mesa (= 22.0.5-0ubuntu0.3) but 22.3.2-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
And whenever I try "apt --fix-broken install" again, I get this error.
# apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libgl1-mesa-dri : Depends: libglapi-mesa (= 22.0.5-0ubuntu0.3) but 22.3.2-1 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
 And whenever I am trying to run "dpkg --remove libglapi-mesa," I get this error
# dpkg --remove libglapi-mesa
dpkg: dependency problems prevent removal of libglapi-mesa:amd64:
libosmesa6:amd64 depends on libglapi-mesa (= 22.3.2-1).
libglx-mesa0:amd64 depends on libglapi-mesa (= 22.3.2-1).
libgl1-mesa-dri:amd64 depends on libglapi-mesa (= 22.0.5-0ubuntu0.3).
libgl1-amber-dri:amd64 depends on libglapi-mesa (>= 21.3.5).
libegl-mesa0:amd64 depends on libglapi-mesa (= 22.3.2-1).
dpkg: error processing package libglapi-mesa:amd64 (--remove):
dependency problems - not removing
Errors were encountered while processing:
libglapi-mesa:amd64
Please help.

unfinished installation of pgadmin4 keeps blocking other installations

I have been trying to install pgAdmin4 but I get this error below, I tried to resolve the error and I couldn't, so I decided to go on with my installations, then I tried Mongodb, it also can't install
sudo apt-get install -y mongodb-org=4.4.2 mongodb-org-server=4.4.2 mongodb-org-shell=4.4.2 mongodb-org-mongos=4.4.2 mongodb-org-tools=4.4.2
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-tools : Depends: mongodb-database-tools but it is not going to be installed
Depends: mongodb-org-database-tools-extra but it is not going to be installed
pgadmin4 : Depends: pgadmin4-web but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I have tried:
sudo apt --fix-broken install
but still no positive yields as the error persists
How can I fully remove pgAdmin, I mean anything related to postgres, so that I re install a new fresh bundle.
The problem was with my dpkg config. but this helped me out
https://itectec.com/ubuntu/ubuntu-how-to-remove-install-a-package-that-is-not-fully-installed/

mongoDB in Ubuntu 20.04 Problems

so i installed mongodb in a wrong way , like watched a video of it in youtube even if "mongo" command is working that doesn't mean its really working
so i'm trying to uninstall mongodb-org but i got this error :
sudo apt remove mongodb-org
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-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).
when i tried sudo 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-program-options1.71.0 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.6 mongo-tools mongodb-server-core
Use 'sudo apt autoremove' to remove them.
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 0 not upgraded.
4 not fully installed or removed.
Need to get 90.4 MB of archives.
After this operation, 146 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-org-server amd64 4.4.1 [20.3 MB]
8% [1 mongodb-org-server 8,584 kB/20.3 MB 42%] Get:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-org-mongos amd64 4.4.1 [15.7 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-database-tools amd64 100.1.1 [54.4 MB]
Fetched 90.4 MB in 1min 11s (1,266 kB/s)
(Reading database ... 215423 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.1_amd64.deb ...
Unpacking mongodb-org-server (4.4.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.1_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.1_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.1_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)
Preparing to unpack .../mongodb-database-tools_100.1.1_amd64.deb ...
Unpacking mongodb-database-tools (100.1.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.1.1_amd64.deb (--un
pack):
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.1_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.1_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
when trying this commands :
apt upgrade , autoclean,remove,purge
they give the same first error
i tried sudo apt clean , then sudo apt --fix-broken install the same problem happend and the same response
all i want is to remove it .
In general if you are removing a package and you get that error, and you don't want the other packages that are being kept that want additional dependencies, you can remove all packages in the same command:
sudo apt remove mongodb-org mongodb-org-tools
The problem is with program:
http://manpages.ubuntu.com/manpages/focal/man1/bsondump.1.html
that is installed in package: mongo-tools from mongo v3
You can try:
sudo apt remove mongo-tools
In docs you can read that in mongo v4 this package has name mongodb-database-tools
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

Not able to download the mongodb dependencies

Getting the below error tried every command to download the dependency but still not able to download it
Please refer to the log here. These are the logs for installing mongodb by using the command sudo apt-get install mongodb
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 : Depends: mongodb-server (>= 1:2.4.1-2) but it is not going to be installed
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
Depends: mongodb-org-tools but it is not going to be installed
Conflicts: mongodb but 1:3.6.3-0ubuntu1.1 is to be installed
mongodb-org-shell : Conflicts: mongodb but 1:3.6.3-0ubuntu1.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

How to resolve this error while installing VSCode in Kali Linux?

I get this error code while installing.
I have tried using
sudo apt intall ./<filename>.deb
but it gives this error
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:
code : Depends: libgconf-2-4 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
And also this:
sudo dpkg -i code_1.30.2-1546901646_amd64.deb
But it gives another error.
Selecting previously unselected package code.
(Reading database ... 340375 files and directories currently installed.)
Preparing to unpack code_1.30.2-1546901646_amd64.deb ...
Unpacking code (1.30.2-1546901646) ...
dpkg: dependency problems prevent configuration of code:
code depends on libgconf-2-4; however:
Package libgconf-2-4 is not installed.
dpkg: error processing package code (--install):
dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-11) ...
Processing triggers for desktop-file-utils (0.23-4) ...
Processing triggers for mime-support (3.61) ...
Errors were encountered while processing:
code
Even sudo apt --fix-broken install doesn't help.
You need to install libgconf as the error states. You can find a deb for it here or use apt:
sudo apt install gconf