shafa@shafa:~$ sudo apt-get install -y mongodb-org=4.0.1~latest
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-shell but it is not going to be installed
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-org-unstable but 4.3.0~latest is to be installed
Conflicts: mongodb-org-unstable-shell but 4.3.0~latest is to be installed
mongodb-org-unstable : Depends: mongodb-org-unstable-server but it is not going to be installed
Depends: mongodb-org-unstable-mongos but it is not going to be installed
Depends: mongodb-org-unstable-tools but it is not going to be installed
Conflicts: mongodb-org but 4.0.1~latest is to be installed
mongodb-org-unstable-shell : Conflicts: mongodb-org but 4.0.1~latest is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
shafa@shafa:~$ apt --fix-broken install
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
shafa@shafa:~$ 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:
linux-headers-4.15.0-46 linux-headers-4.15.0-46-generic linux-image-4.15.0-46-generic linux-modules-4.15.0-46-generic
linux-modules-extra-4.15.0-46-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-org-unstable-mongos mongodb-org-unstable-server mongodb-org-unstable-tools
The following NEW packages will be installed:
mongodb-org-unstable-mongos mongodb-org-unstable-server mongodb-org-unstable-tools
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/68.6 MB of archives.
After this operation, 221 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 280248 files and directories currently installed.)
Preparing to unpack .../mongodb-org-unstable-server_4.3.0~latest_amd64.deb ...
Unpacking mongodb-org-unstable-server (4.3.0~latest) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-unstable-server_4.3.0~latest_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-unstable-mongos_4.3.0~latest_amd64.deb ...
Unpacking mongodb-org-unstable-mongos (4.3.0~latest) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-unstable-mongos_4.3.0~latest_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-unstable-tools_4.3.0~latest_amd64.deb ...
Unpacking mongodb-org-unstable-tools (4.3.0~latest) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-unstable-tools_4.3.0~latest_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-unstable-server_4.3.0~latest_amd64.deb
/var/cache/apt/archives/mongodb-org-unstable-mongos_4.3.0~latest_amd64.deb
/var/cache/apt/archives/mongodb-org-unstable-tools_4.3.0~latest_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)