$ sudo apt-get install -y mongodb-org
Reading package lists… Done
Building dependency tree
Reading state information… Done
mongodb-org is already the newest version (4.2.6).
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
Depends: mongodb-org-tools but it is not going to be installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).
:~$ mongo
MongoDB shell version v4.2.6
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-04-27T12:29:07.313-0500 E QUERY [js] Error: couldn’t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
after launch :~$ ss -tlnp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 80 127.0.0.1:3306 0.0.0.0:*
LISTEN 0 128 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 5 127.0.0.1:631 0.0.0.0:*
LISTEN 0 128 :80 :
LISTEN 0 5 [::1]:631 [::]:
:~$ sudo apt --fix-broken install
[sudo] password for forperuse:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… failed.
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
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
It is not clear what problem you are trying to fix. From some of the post it looks like you are trying to fix an installation issues. My reply was to fix