0

Solved: dpkg error: "trying to overwrite file, which is also in..."

i tried once to reinstall and install mongod and mongodb, after that my ubuntu system became very low, now in each time i try to install a new package, i got this error, i tried to do sudo apt --fix-broken install but i got errors too bcz of mongodb package

sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libssl-dev libffi-dev libsqlite3-dev wget libbz2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
wget is already the newest version (1.20.3-1ubuntu2).
wget set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: gcc (>= 4:9.2) but it is not going to be installed
                   Depends: g++ (>= 4:9.2) but it is not going to be installed
                   Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
 libbz2-dev : Depends: libc6-dev but it is not going to be installed or
                       libc-dev
              Recommends: bzip2-doc but it is not going to be installed
 libgdbm-dev : Depends: libc6-dev but it is not going to be installed or
                        libc-dev
 libncurses5-dev : Depends: libncurses-dev (= 6.2-0ubuntu2) but it is not going to be installed
 libnss3-dev : Depends: libnss3 (= 2:3.49.1-1ubuntu1.8) but 2:3.49.1-1ubuntu1.6 is to be installed
               Depends: libnspr4-dev (>= 4.6.6-1) but it is not going to be installed
 libreadline-dev : Depends: libncurses-dev but it is not going to be installed
 libsqlite3-dev : Depends: libsqlite3-0 (= 3.31.1-4ubuntu0.3) but 3.31.1-4ubuntu0.2 is to be installed
                  Depends: libc6-dev but it is not going to be installed
 libssl-dev : Depends: libssl1.1 (= 1.1.1f-1ubuntu2.16) but 1.1.1f-1ubuntu2.12 is to be installed
 mongodb-org-database : 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
 zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-2ubuntu1.3) but 1:1.2.11.dfsg-2ubuntu1.2 is to be installed
              Depends: libc6-dev but it is not going to be installed or
                       libc-dev
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

after i run this sudo apt --fix-broken install i got :

The following packages were automatically installed and are no longer required:
  libboost-program-options1.71.0 libgoogle-perftools4 libpcrecpp0v5
  libpthread-stubs0-dev libtcmalloc-minimal4 libxau-dev libxcb-xinerama0-dev
  libxcb1-dev libxdmcp-dev libyaml-cpp0.6 mongo-tools mongodb-server-core
  x11proto-core-dev x11proto-dev xorg-sgml-doctools
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 248 not upgraded.
9 not fully installed or removed.
Need to get 0 B/92.8 MB of archives.
After this operation, 187 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 190222 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_5.0.11_amd64.deb ...
Unpacking mongodb-org-server (5.0.11) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_5.0.11
_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.3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_5.0.11_amd64.deb ...
Unpacking mongodb-org-mongos (5.0.11) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_5.0.11
_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.3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.6.0_amd64.deb ...
Unpacking mongodb-database-tools (100.6.0) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_10
0.6.0_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_5.0.11_amd64.deb
 /var/cache/apt/archives/mongodb-org-mongos_5.0.11_amd64.deb
 /var/cache/apt/archives/mongodb-database-tools_100.6.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

after i run this sudo apt update i get :

Hit:1 http://dz.archive.ubuntu.com/ubuntu focal InRelease                      
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]      
Get:3 http://dz.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]     
Hit:4 https://download.docker.com/linux/ubuntu focal InRelease                 
Ign:5 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease      
Hit:6 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 Release        
Get:8 http://dz.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:9 http://dz.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [941 kB]
Get:10 http://dz.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [688 kB]
Fetched 1,964 kB in 9s (215 kB/s)                                              
Reading package lists... Done
Building dependency tree       
Reading state information... Done
248 packages can be upgraded. Run 'apt list --upgradable' to see them.

after i run this sudo apt upgrade i get :

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-database : Depends: mongodb-org-server but it is not installed
                        Depends: mongodb-org-mongos but it is not installed
 mongodb-org-tools : Depends: mongodb-database-tools but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

when i run this sudo apt list --upgradable i get :

Listing... Done
alsa-ucm-conf/focal-updates,focal-updates 1.2.2-1ubuntu0.13 all [upgradable from: 1.2.2-1ubuntu0.11]
apport-gtk/focal-updates,focal-updates,focal-security,focal-security 2.20.11-0ubuntu27.24 all [upgradable from: 2.20.11-0ubuntu27.21]
apport/focal-updates,focal-updates,focal-security,focal-security 2.20.11-0ubuntu27.24 all [upgradable from: 2.20.11-0ubuntu27.21]
apt-transport-https/focal-updates,focal-updates 2.0.9 all [upgradable from: 2.0.6]
apt-utils/focal-updates 2.0.9 amd64 [upgradable from: 2.0.6]
apt/focal-updates 2.0.9 amd64 [upgradable from: 2.0.6]
bash/focal-updates,focal-security 5.0-6ubuntu1.2 amd64 [upgradable from: 5.0-6ubuntu1.1]
bluez-cups/focal-updates,focal-security 5.53-0ubuntu3.6 amd64 [upgradable from: 5.53-0ubuntu3.5]
bluez-obexd/focal-updates,focal-security 5.53-0ubuntu3.6 amd64 [upgradable from: 5.53-0ubuntu3.5]
bluez/focal-updates,focal-security 5.53-0ubuntu3.6 amd64 [upgradable from: 5.53-0ubuntu3.5]
bolt/focal-updates 0.9.1-2~ubuntu20.04.1 amd64 [upgradable from: 0.8-4ubuntu1]
ca-certificates/focal-updates,focal-updates,focal-security,focal-security 20211016~20.04.1 all [upgradable from: 20210119~20.04.2]
command-not-found/focal-updates,focal-updates 20.04.6 all [upgradable from: 20.04.5]
containerd.io/focal 1.6.7-1 amd64 [upgradable from: 1.5.10-1]
cups-bsd/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
cups-client/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
cups-common/focal-updates,focal-updates,focal-security,focal-security 2.3.1-9ubuntu1.2 all [upgradable from: 2.3.1-9ubuntu1.1]
cups-core-drivers/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
cups-daemon/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
cups-ipp-utils/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
cups-ppdc/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
cups-server-common/focal-updates,focal-updates,focal-security,focal-security 2.3.1-9ubuntu1.2 all [upgradable from: 2.3.1-9ubuntu1.1]
cups/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
curl/focal-updates,focal-security 7.68.0-1ubuntu2.12 amd64 [upgradable from: 7.68.0-1ubuntu2.7]
dbus-user-session/focal-updates,focal-security 1.12.16-2ubuntu2.2 amd64 [upgradable from: 1.12.16-2ubuntu2.1]
dbus-x11/focal-updates,focal-security 1.12.16-2ubuntu2.2 amd64 [upgradable from: 1.12.16-2ubuntu2.1]
dbus/focal-updates,focal-security 1.12.16-2ubuntu2.2 amd64 [upgradable from: 1.12.16-2ubuntu2.1]
dirmngr/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
distro-info-data/focal-updates,focal-updates,focal-security,focal-security 0.43ubuntu1.10 all [upgradable from: 0.43ubuntu1.9]
dnsmasq-base/focal-updates,focal-security 2.80-1.1ubuntu1.5 amd64 [upgradable from: 2.80-1.1ubuntu1.4]
docker-ce-cli/focal 5:22.06.0~beta.0-0~ubuntu.20.04.0~focal amd64 [upgradable from: 5:20.10.13~3-0~ubuntu-focal]
docker-ce-rootless-extras/focal 5:22.06.0~beta.0-0~ubuntu.20.04.0~focal amd64 [upgradable from: 5:20.10.13~3-0~ubuntu-focal]
docker-ce/focal 5:22.06.0~beta.0-0~ubuntu.20.04.0~focal amd64 [upgradable from: 5:20.10.13~3-0~ubuntu-focal]
dpkg/focal-updates,focal-security 1.19.7ubuntu3.2 amd64 [upgradable from: 1.19.7ubuntu3]
e2fsprogs/focal-updates,focal-security 1.45.5-2ubuntu1.1 amd64 [upgradable from: 1.45.5-2ubuntu1]
firefox-locale-en/focal-updates,focal-security 103.0+build1-0ubuntu0.20.04.1 amd64 [upgradable from: 98.0.2+build1-0ubuntu0.20.04.1]
firefox/focal-updates,focal-security 103.0+build1-0ubuntu0.20.04.1 amd64 [upgradable from: 98.0.2+build1-0ubuntu0.20.04.1]
fwupd-signed/focal-updates 1.27.1ubuntu7+1.2-2~20.04.1 amd64 [upgradable from: 1.27.1ubuntu5+1.5.11-0ubuntu1~20.04.2]
fwupd/focal-updates 1.7.5-3~20.04.1 amd64 [upgradable from: 1.5.11-0ubuntu1~20.04.2]
gir1.2-gdkpixbuf-2.0/focal-updates,focal-security 2.40.0+dfsg-3ubuntu0.3 amd64 [upgradable from: 2.40.0+dfsg-3ubuntu0.2]
gir1.2-gst-plugins-base-1.0/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
gir1.2-gstreamer-1.0/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-2]
gir1.2-gtk-3.0/focal-updates 3.24.20-0ubuntu1.1 amd64 [upgradable from: 3.24.20-0ubuntu1]
gir1.2-javascriptcoregtk-4.0/focal-updates,focal-security 2.36.6-0ubuntu0.20.04.1 amd64 [upgradable from: 2.34.6-0ubuntu0.20.04.1]
gir1.2-webkit2-4.0/focal-updates,focal-security 2.36.6-0ubuntu0.20.04.1 amd64 [upgradable from: 2.34.6-0ubuntu0.20.04.1]
git-man/focal-updates,focal-updates,focal-security,focal-security 1:2.25.1-1ubuntu3.5 all [upgradable from: 1:2.25.1-1ubuntu3.2]
git/focal-updates,focal-security 1:2.25.1-1ubuntu3.5 amd64 [upgradable from: 1:2.25.1-1ubuntu3.2]
gnome-control-center-data/focal-updates,focal-updates 1:3.36.5-0ubuntu4 all [upgradable from: 1:3.36.5-0ubuntu3]
gnome-control-center-faces/focal-updates,focal-updates 1:3.36.5-0ubuntu4 all [upgradable from: 1:3.36.5-0ubuntu3]
gnome-control-center/focal-updates 1:3.36.5-0ubuntu4 amd64 [upgradable from: 1:3.36.5-0ubuntu3]
gnupg-l10n/focal-updates,focal-updates,focal-security,focal-security 2.2.19-3ubuntu2.2 all [upgradable from: 2.2.19-3ubuntu2.1]
gnupg-utils/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gnupg/focal-updates,focal-updates,focal-security,focal-security 2.2.19-3ubuntu2.2 all [upgradable from: 2.2.19-3ubuntu2.1]
gpg-agent/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gpg-wks-client/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gpg-wks-server/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gpg/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gpgconf/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gpgsm/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
gpgv/focal-updates,focal-security 2.2.19-3ubuntu2.2 amd64 [upgradable from: 2.2.19-3ubuntu2.1]
grub-common/focal-updates 2.04-1ubuntu26.15 amd64 [upgradable from: 2.04-1ubuntu26.13]
grub-pc-bin/focal-updates 2.04-1ubuntu26.15 amd64 [upgradable from: 2.04-1ubuntu26.13]
grub-pc/focal-updates 2.04-1ubuntu26.15 amd64 [upgradable from: 2.04-1ubuntu26.13]
grub2-common/focal-updates 2.04-1ubuntu26.15 amd64 [upgradable from: 2.04-1ubuntu26.13]
gstreamer1.0-alsa/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
gstreamer1.0-gl/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
gstreamer1.0-gtk3/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-1ubuntu2.1]
gstreamer1.0-plugins-bad/focal-updates 1.16.3-0ubuntu1 amd64 [upgradable from: 1.16.2-2.1ubuntu1]
gstreamer1.0-plugins-base-apps/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
gstreamer1.0-plugins-base/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
gstreamer1.0-plugins-good/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-1ubuntu2.1]
gstreamer1.0-pulseaudio/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-1ubuntu2.1]
gstreamer1.0-tools/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-2]
gstreamer1.0-x/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
gtk-update-icon-cache/focal-updates 3.24.20-0ubuntu1.1 amd64 [upgradable from: 3.24.20-0ubuntu1]
gvfs-backends/focal-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1ubuntu1]
gvfs-bin/focal-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1ubuntu1]
gvfs-common/focal-updates,focal-updates 1.44.1-1ubuntu1.1 all [upgradable from: 1.44.1-1ubuntu1]
gvfs-daemons/focal-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1ubuntu1]
gvfs-fuse/focal-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1ubuntu1]
gvfs-libs/focal-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1ubuntu1]
gvfs/focal-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1ubuntu1]
gzip/focal-updates,focal-security 1.10-0ubuntu4.1 amd64 [upgradable from: 1.10-0ubuntu4]
iio-sensor-proxy/focal-updates 2.8-1ubuntu2 amd64 [upgradable from: 2.8-1ubuntu1]
intel-microcode/focal-updates,focal-security 3.20220510.0ubuntu0.20.04.1 amd64 [upgradable from: 3.20210608.0ubuntu0.20.04.1]
isc-dhcp-client/focal-updates 4.4.1-2.1ubuntu5.20.04.3 amd64 [upgradable from: 4.4.1-2.1ubuntu5.20.04.2]
isc-dhcp-common/focal-updates 4.4.1-2.1ubuntu5.20.04.3 amd64 [upgradable from: 4.4.1-2.1ubuntu5.20.04.2]
klibc-utils/focal-updates,focal-security 2.0.7-1ubuntu5.1 amd64 [upgradable from: 2.0.7-1ubuntu5]
kmod/focal-updates 27-1ubuntu2.1 amd64 [upgradable from: 27-1ubuntu2]
language-pack-gnome-en-base/focal-updates,focal-updates 1:20.04+20220211 all [upgradable from: 1:20.04+20210802]
language-pack-gnome-en/focal-updates,focal-updates 1:20.04+20220211 all [upgradable from: 1:20.04+20210802]
libapt-pkg6.0/focal-updates 2.0.9 amd64 [upgradable from: 2.0.6]
libarchive13/focal-updates,focal-security 3.4.0-2ubuntu1.2 amd64 [upgradable from: 3.4.0-2ubuntu1.1]
libavcodec58/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libavfilter7/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libavformat58/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libavutil56/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libbluetooth3/focal-updates,focal-security 5.53-0ubuntu3.6 amd64 [upgradable from: 5.53-0ubuntu3.5]
libc-bin/focal-updates 2.31-0ubuntu9.9 amd64 [upgradable from: 2.31-0ubuntu9.7]
libcom-err2/focal-updates,focal-security 1.45.5-2ubuntu1.1 amd64 [upgradable from: 1.45.5-2ubuntu1]
libcups2/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
libcupsimage2/focal-updates,focal-security 2.3.1-9ubuntu1.2 amd64 [upgradable from: 2.3.1-9ubuntu1.1]
libcurl3-gnutls/focal-updates,focal-security 7.68.0-1ubuntu2.12 amd64 [upgradable from: 7.68.0-1ubuntu2.7]
libcurl4/focal-updates,focal-security 7.68.0-1ubuntu2.12 amd64 [upgradable from: 7.68.0-1ubuntu2.7]
libdbus-1-3/focal-updates,focal-security 1.12.16-2ubuntu2.2 amd64 [upgradable from: 1.12.16-2ubuntu2.1]
libdpkg-perl/focal-updates,focal-updates,focal-security,focal-security 1.19.7ubuntu3.2 all [upgradable from: 1.19.7ubuntu3]
libevdev2/focal-updates,focal-security 1.9.0+dfsg-1ubuntu0.2 amd64 [upgradable from: 1.9.0+dfsg-1ubuntu0.1]
libexempi8/focal-updates,focal-security 2.5.1-1ubuntu0.1 amd64 [upgradable from: 2.5.1-1build1]
libext2fs2/focal-updates,focal-security 1.45.5-2ubuntu1.1 amd64 [upgradable from: 1.45.5-2ubuntu1]
libfprint-2-2/focal-updates 1:1.90.2+tod1-0ubuntu1~20.04.8 amd64 [upgradable from: 1:1.90.2+tod1-0ubuntu1~20.04.6]
libfprint-2-tod1/focal-updates 1:1.90.2+tod1-0ubuntu1~20.04.8 amd64 [upgradable from: 1:1.90.2+tod1-0ubuntu1~20.04.6]
libfreerdp-client2-2/focal-updates,focal-security 2.2.0+dfsg1-0ubuntu0.20.04.3 amd64 [upgradable from: 2.2.0+dfsg1-0ubuntu0.20.04.2]
libfreerdp2-2/focal-updates,focal-security 2.2.0+dfsg1-0ubuntu0.20.04.3 amd64 [upgradable from: 2.2.0+dfsg1-0ubuntu0.20.04.2]
libfreetype6/focal-updates,focal-security 2.10.1-2ubuntu0.2 amd64 [upgradable from: 2.10.1-2ubuntu0.1]
libfribidi0/focal-updates,focal-security 1.0.8-2ubuntu0.1 amd64 [upgradable from: 1.0.8-2]
libfwupd2/focal-updates 1.7.5-3~20.04.1 amd64 [upgradable from: 1.5.11-0ubuntu1~20.04.2]
libgdk-pixbuf2.0-0/focal-updates,focal-security 2.40.0+dfsg-3ubuntu0.3 amd64 [upgradable from: 2.40.0+dfsg-3ubuntu0.2]
libgdk-pixbuf2.0-bin/focal-updates,focal-security 2.40.0+dfsg-3ubuntu0.3 amd64 [upgradable from: 2.40.0+dfsg-3ubuntu0.2]
libgdk-pixbuf2.0-common/focal-updates,focal-updates,focal-security,focal-security 2.40.0+dfsg-3ubuntu0.3 all [upgradable from: 2.40.0+dfsg-3ubuntu0.2]
libgnutls30/focal-updates,focal-security 3.6.13-2ubuntu1.7 amd64 [upgradable from: 3.6.13-2ubuntu1.6]
libgstreamer-gl1.0-0/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
libgstreamer-plugins-bad1.0-0/focal-updates 1.16.3-0ubuntu1 amd64 [upgradable from: 1.16.2-2.1ubuntu1]
libgstreamer-plugins-base1.0-0/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-4ubuntu0.1]
libgstreamer-plugins-good1.0-0/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-1ubuntu2.1]
libgstreamer1.0-0/focal-updates,focal-security 1.16.3-0ubuntu1.1 amd64 [upgradable from: 1.16.2-2]
libgtk-3-0/focal-updates 3.24.20-0ubuntu1.1 amd64 [upgradable from: 3.24.20-0ubuntu1]
libgtk-3-bin/focal-updates 3.24.20-0ubuntu1.1 amd64 [upgradable from: 3.24.20-0ubuntu1]
libgtk-3-common/focal-updates,focal-updates 3.24.20-0ubuntu1.1 all [upgradable from: 3.24.20-0ubuntu1]
libharfbuzz-icu0/focal-updates,focal-security 2.6.4-1ubuntu4.2 amd64 [upgradable from: 2.6.4-1ubuntu4]
libharfbuzz0b/focal-updates,focal-security 2.6.4-1ubuntu4.2 amd64 [upgradable from: 2.6.4-1ubuntu4]
libhttp-daemon-perl/focal-updates,focal-updates,focal-security,focal-security 6.06-1ubuntu0.1 all [upgradable from: 6.06-1]
libinput-bin/focal-updates,focal-security 1.15.5-1ubuntu0.3 amd64 [upgradable from: 1.15.5-1ubuntu0.2]
libinput10/focal-updates,focal-security 1.15.5-1ubuntu0.3 amd64 [upgradable from: 1.15.5-1ubuntu0.2]
libjavascriptcoregtk-4.0-18/focal-updates,focal-security 2.36.6-0ubuntu0.20.04.1 amd64 [upgradable from: 2.34.6-0ubuntu0.20.04.1]
libjcat1/focal-updates 0.1.4-0ubuntu0.20.04.1 amd64 [upgradable from: 0.1.3-2~ubuntu20.04.1]
libkeyutils1/focal-updates 1.6-6ubuntu1.1 amd64 [upgradable from: 1.6-6ubuntu1]
libklibc/focal-updates,focal-security 2.0.7-1ubuntu5.1 amd64 [upgradable from: 2.0.7-1ubuntu5]
libkmod2/focal-updates 27-1ubuntu2.1 amd64 [upgradable from: 27-1ubuntu2]
libldap-2.4-2/focal-updates,focal-security 2.4.49+dfsg-2ubuntu1.9 amd64 [upgradable from: 2.4.49+dfsg-2ubuntu1.8]
libldap-common/focal-updates,focal-updates,focal-security,focal-security 2.4.49+dfsg-2ubuntu1.9 all [upgradable from: 2.4.49+dfsg-2ubuntu1.8]
libldb2/focal-updates,focal-security 2:2.2.3-0ubuntu0.20.04.3 amd64 [upgradable from: 2:2.2.3-0ubuntu0.20.04.2]
liblouis-data/focal-updates,focal-updates,focal-security,focal-security 3.12.0-3ubuntu0.1 all [upgradable from: 3.12.0-3]
liblouis20/focal-updates,focal-security 3.12.0-3ubuntu0.1 amd64 [upgradable from: 3.12.0-3]
liblzma5/focal-updates,focal-security 5.2.4-1ubuntu1.1 amd64 [upgradable from: 5.2.4-1ubuntu1]
libmbim-glib4/focal-updates 1.26.2-1~ubuntu20.04.1 amd64 [upgradable from: 1.24.8-1~20.04]
libmbim-proxy/focal-updates 1.26.2-1~ubuntu20.04.1 amd64 [upgradable from: 1.24.8-1~20.04]
libmm-glib0/focal-updates 1.18.6-1~ubuntu20.04.1 amd64 [upgradable from: 1.16.6-2~20.04.1]
libmysqlclient21/focal-updates,focal-security 8.0.30-0ubuntu0.20.04.2 amd64 [upgradable from: 8.0.28-0ubuntu0.20.04.3]
libnetplan0/focal-updates 0.104-0ubuntu2~20.04.2 amd64 [upgradable from: 0.103-0ubuntu5~20.04.5]
libnss-systemd/focal-updates 245.4-4ubuntu3.17 amd64 [upgradable from: 245.4-4ubuntu3.15]
libnss3/focal-updates,focal-security 2:3.49.1-1ubuntu1.8 amd64 [upgradable from: 2:3.49.1-1ubuntu1.6]
libntfs-3g883/focal-updates,focal-security 1:2017.3.23AR.3-3ubuntu1.2 amd64 [upgradable from: 1:2017.3.23AR.3-3ubuntu1.1]
libpam-systemd/focal-updates 245.4-4ubuntu3.17 amd64 [upgradable from: 245.4-4ubuntu3.15]
libpcre3/focal-updates,focal-security 2:8.39-12ubuntu0.1 amd64 [upgradable from: 2:8.39-12build1]
libpcrecpp0v5/focal-updates,focal-security 2:8.39-12ubuntu0.1 amd64 [upgradable from: 2:8.39-12build1]
libpostproc55/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libpq5/focal-updates,focal-security 12.12-0ubuntu0.20.04.1 amd64 [upgradable from: 12.9-0ubuntu0.20.04.1]
libpython3.8-minimal/focal-updates,focal-security 3.8.10-0ubuntu1~20.04.5 amd64 [upgradable from: 3.8.10-0ubuntu1~20.04.2]
libpython3.8-stdlib/focal-updates,focal-security 3.8.10-0ubuntu1~20.04.5 amd64 [upgradable from: 3.8.10-0ubuntu1~20.04.2]
libpython3.8/focal-updates,focal-security 3.8.10-0ubuntu1~20.04.5 amd64 [upgradable from: 3.8.10-0ubuntu1~20.04.2]
libqmi-glib5/focal-updates 1.30.4-1~ubuntu20.04.1 amd64 [upgradable from: 1.28.6-1~20.04.1]
libqmi-proxy/focal-updates 1.30.4-1~ubuntu20.04.1 amd64 [upgradable from: 1.28.6-1~20.04.1]
libsensors-config/focal-updates,focal-updates 1:3.6.0-2ubuntu1.1 all [upgradable from: 1:3.6.0-2ubuntu1]
libsensors5/focal-updates 1:3.6.0-2ubuntu1.1 amd64 [upgradable from: 1:3.6.0-2ubuntu1]
libsepol1/focal-updates,focal-security 3.0-1ubuntu0.1 amd64 [upgradable from: 3.0-1]
libsmbclient/focal-updates,focal-security 2:4.13.17~dfsg-0ubuntu1.20.04.1 amd64 [upgradable from: 2:4.13.17~dfsg-0ubuntu0.21.04.1]
libsnmp-base/focal-updates,focal-updates 5.8+dfsg-2ubuntu2.5 all [upgradable from: 5.8+dfsg-2ubuntu2.3]
libsnmp35/focal-updates 5.8+dfsg-2ubuntu2.5 amd64 [upgradable from: 5.8+dfsg-2ubuntu2.3]
libsqlite3-0/focal-updates,focal-security 3.31.1-4ubuntu0.3 amd64 [upgradable from: 3.31.1-4ubuntu0.2]
libss2/focal-updates,focal-security 1.45.5-2ubuntu1.1 amd64 [upgradable from: 1.45.5-2ubuntu1]
libssl1.1/focal-updates,focal-security 1.1.1f-1ubuntu2.16 amd64 [upgradable from: 1.1.1f-1ubuntu2.12]
libswresample3/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libswscale5/focal-updates,focal-security 7:4.2.7-0ubuntu0.1 amd64 [upgradable from: 7:4.2.4-1ubuntu0.1]
libsystemd0/focal-updates 245.4-4ubuntu3.17 amd64 [upgradable from: 245.4-4ubuntu3.15]
libtiff5/focal-updates,focal-security 4.1.0+git191117-2ubuntu0.20.04.3 amd64 [upgradable from: 4.1.0+git191117-2ubuntu0.20.04.2]
libudev1/focal-updates 245.4-4ubuntu3.17 amd64 [upgradable from: 245.4-4ubuntu3.15]
libwbclient0/focal-updates,focal-security 2:4.13.17~dfsg-0ubuntu1.20.04.1 amd64 [upgradable from: 2:4.13.17~dfsg-0ubuntu0.21.04.1]
libwebkit2gtk-4.0-37/focal-updates,focal-security 2.36.6-0ubuntu0.20.04.1 amd64 [upgradable from: 2.34.6-0ubuntu0.20.04.1]
libwinpr2-2/focal-updates,focal-security 2.2.0+dfsg1-0ubuntu0.20.04.3 amd64 [upgradable from: 2.2.0+dfsg1-0ubuntu0.20.04.2]
libxml2/focal-updates,focal-security 2.9.10+dfsg-5ubuntu0.20.04.4 amd64 [upgradable from: 2.9.10+dfsg-5ubuntu0.20.04.2]
libxslt1.1/focal-updates,focal-security 1.1.34-4ubuntu0.20.04.1 amd64 [upgradable from: 1.1.34-4]
linux-firmware/focal-updates,focal-updates 1.187.33 all [upgradable from: 1.187.26]
linux-generic-hwe-20.04/focal-updates,focal-security 5.15.0.46.49~20.04.16 amd64 [upgradable from: 5.13.0.37.42~20.04.22]
linux-headers-generic-hwe-20.04/focal-updates,focal-security 5.15.0.46.49~20.04.16 amd64 [upgradable from: 5.13.0.37.42~20.04.22]
linux-image-generic-hwe-20.04/focal-updates,focal-security 5.15.0.46.49~20.04.16 amd64 [upgradable from: 5.13.0.37.42~20.04.22]
locales/focal-updates,focal-updates 2.31-0ubuntu9.9 all [upgradable from: 2.31-0ubuntu9.7]
login/focal-updates 1:4.8.1-1ubuntu5.20.04.2 amd64 [upgradable from: 1:4.8.1-1ubuntu5.20.04.1]
logsave/focal-updates,focal-security 1.45.5-2ubuntu1.1 amd64 [upgradable from: 1.45.5-2ubuntu1]
modemmanager/focal-updates 1.18.6-1~ubuntu20.04.1 amd64 [upgradable from: 1.16.6-2~20.04.1]
mongodb-mongosh/focal 1.5.4 amd64 [upgradable from: 1.3.1]
mongodb-org-database-tools-extra/focal 5.0.11 amd64 [upgradable from: 5.0.6]
mongodb-org-database/focal 5.0.11 amd64 [upgradable from: 5.0.6]
mongodb-org-shell/focal 5.0.11 amd64 [upgradable from: 5.0.6]
mongodb-org-tools/focal 5.0.11 amd64 [upgradable from: 5.0.6]
mongodb-org/focal 5.0.11 amd64 [upgradable from: 5.0.6]
netplan.io/focal-updates 0.104-0ubuntu2~20.04.2 amd64 [upgradable from: 0.103-0ubuntu5~20.04.5]
networkd-dispatcher/focal-updates,focal-updates,focal-security,focal-security 2.1-2~ubuntu20.04.3 all [upgradable from: 2.1-2~ubuntu20.04.1]
ntfs-3g/focal-updates,focal-security 1:2017.3.23AR.3-3ubuntu1.2 amd64 [upgradable from: 1:2017.3.23AR.3-3ubuntu1.1]
openssh-client/focal-updates 1:8.2p1-4ubuntu0.5 amd64 [upgradable from: 1:8.2p1-4ubuntu0.4]
openssl/focal-updates,focal-security 1.1.1f-1ubuntu2.16 amd64 [upgradable from: 1.1.1f-1ubuntu2.12]

  • @Nmath i'm trying to install python so i run this sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libssl-dev libffi-dev libsqlite3-dev wget libbz2-dev – sadok Abdelbasset Aug 23 '22 at 18:41
  • @Nmath i did what you asked for sir – sadok Abdelbasset Aug 23 '22 at 18:49
  • @Nmath, it still giving me errors, – sadok Abdelbasset Aug 23 '22 at 18:59
  • i run sudo apt list --upgradable , and i past the result above @Nmath – sadok Abdelbasset Aug 23 '22 at 19:13
  • Do you have a backup of your database? You may want to run sudo apt remove mongodb-org-database mongodb-org-tools and get rid of these packages. Then run sudo apt update and sudo apt upgrade again until your system is up-to-date. Only then should you try to add anything new. – Nmath Aug 23 '22 at 19:15
  • @Nmath when i run sudo apt remove mongodb-org-database mongodb-org-tools

    i got this :

    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-database 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).
    
    – sadok Abdelbasset Aug 23 '22 at 19:17
  • Try sudo apt remove mongo-tools mongodb-server-core – Nmath Aug 23 '22 at 19:19
  • @Nmath the same i'm getting :
    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-database : 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
    
    – sadok Abdelbasset Aug 23 '22 at 19:20
  • Hmmm do you remember exactly what mongodb packages you installed? Those are the ones I would try to remove. You may have success with sudo apt autoremove. Unfortunately things can get very messy when you try to install new software when your system is very outdated. Look up "dependency hell" -- that's the situation going on with your system at the moment – Nmath Aug 23 '22 at 19:23
  • @Nmath
    mongod --version
    db version v3.6.8
    git version: 8e540c0b6db93ce994cc548f000900bdc740f80a
    OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
    allocator: tcmalloc
    modules: none
    build environment:
        distarch: x86_64
        target_arch: x86_64
    
    – sadok Abdelbasset Aug 23 '22 at 19:26
  • @Nmath those one :

    mongodb-mongosh/focal 1.5.4 amd64 [upgradable from: 1.3.1]

    mongodb-org-database-tools-extra/focal 5.0.11 amd64 [upgradable from: 5.0.6]

    mongodb-org-database/focal 5.0.11 amd64 [upgradable from: 5.0.6]

    mongodb-org-shell/focal 5.0.11 amd64 [upgradable from: 5.0.6]

    mongodb-org-tools/focal 5.0.11 amd64 [upgradable from: 5.0.6]

    mongodb-org/focal 5.0.11 amd64 [upgradable from: 5.0.6]

    netplan.io/focal-updates 0.104-0ubuntu2~20.04.2 amd64 [upgradable from: 0.103-0ubuntu5~20.04.5]

    – sadok Abdelbasset Aug 23 '22 at 19:29
  • sudo apt remove whatever packages you indicated when you originally installed the software prior to updating your system – Nmath Aug 23 '22 at 19:36
  • @Nmath doesn't work :/ i need to delete the entire system and reinstall it – sadok Abdelbasset Aug 23 '22 at 19:42
  • Not necessarily, but that is an option if you just want a clean slate and don't want to waste any more time trying to untangle this particular issue – Nmath Aug 23 '22 at 19:46
  • 1
    Does this answer your question? dpkg error: "trying to overwrite file, which is also in...". This occurs most commonly when folks try multiple ways of installing without cleaning up between attempts. – user535733 Aug 23 '22 at 21:25
  • @user535733 thank you so much i really appreciate it thank you, it worked for me, you saved me – sadok Abdelbasset Aug 28 '22 at 13:16

0 Answers0