@Madchatthew still a great catch.
Mongo Completely Broken.
-
Hi All,
I have been running a Gaming Server and Site from home for many years. I have not really touched it in a while and switched on again today for some nostalgia and basically take a look.
My site uses mongo to store the information and i had one db on there. I updated my system and all seems completely broken. I can no longer see the site. Sorry for the long code text but you can see from when I use sudo apt update then upgrade that it suggests to fix. But I get this.
I am happy for someone to take dive in and take a look for the price of a coffee or two of course I guess it may be something simple but I am far from the level of most of the guys here. I am wondering if my db and data is lost Any help much appreciated. Thank you in advance.
smiley@fmjcod4:~$ sudo apt update Hit:1 http://fi.archive.ubuntu.com/ubuntu focal InRelease Hit:2 http://fi.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease Hit:4 http://fi.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:5 http://fi.archive.ubuntu.com/ubuntu focal-security InRelease Hit:6 http://ppa.launchpad.net/maxmind/ppa/ubuntu focal InRelease Hit:7 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease Hit:8 https://downloads.sourceforge.net/project/d-apt d-apt InRelease Reading package lists... Done Building dependency tree Reading state information... Done 22 packages can be upgraded. Run 'apt list --upgradable' to see them. smiley@fmjcod4:~$ sudo apt upgrade 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). smiley@fmjcod4:~$ 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 libphobos2-108 libphobos2-108:i386 libsnappy1v5 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 22 not upgraded. 6 not fully installed or removed. Need to get 0 B/114 MB of archives. After this operation, 386 MB of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 198688 files and directories currently installed.) Preparing to unpack .../mongodb-org-server_8.0.4_amd64.deb ... Unpacking mongodb-org-server (8.0.4) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_8.0.4_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_8.0.4_amd64.deb ... Unpacking mongodb-org-mongos (8.0.4) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_8.0.4_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.10.0_amd64.deb ... Unpacking mongodb-database-tools (100.10.0) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.10.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_8.0.4_amd64.deb /var/cache/apt/archives/mongodb-org-mongos_8.0.4_amd64.deb /var/cache/apt/archives/mongodb-database-tools_100.10.0_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
-
@Sampo2910 can you try stopping the mongodb service then try the update process again? Either use
Upstart:
sudo service mongod stop
Or
Sysvinit:
sudo /etc/init.d/mongod stop
-
Just for the record after I reboot server I can see my page again. But same errors are there.
I use the method for it form a friend. Its a bit old but still works.
-
smiley@fmjcod4:~$ sudo service mongod stop Failed to stop mongod.service: Unit mongod.service not loaded. smiley@fmjcod4:~$ sudo /etc/init.d/mongod stop sudo: /etc/init.d/mongod: command not found
smiley@fmjcod4:~$ sudo service mongod stop Failed to stop mongod.service: Unit mongod.service not loaded. smiley@fmjcod4:~$ sudo service mongodb stop smiley@fmjcod4:~$ sudo service mongodb start smiley@fmjcod4:~$ mongo Command 'mongo' not found, but can be installed with: sudo apt install mongodb-clients smiley@fmjcod4:~$ sudo apt install mongodb-clients 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: libssl-dev : Depends: libssl1.1 (= 1.1.1f-1ubuntu2.23) but 1.1.1f-1ubuntu2 is to be installed libssl1.1 : Breaks: libssl1.1:i386 (!= 1.1.1f-1ubuntu2) but 1.1.1f-1ubuntu2.23 is to be installed libssl1.1:i386 : Breaks: libssl1.1 (!= 1.1.1f-1ubuntu2.23) but 1.1.1f-1ubuntu2 is to be installed mongodb-org : Conflicts: mongodb-clients but 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 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 Conflicts: mongodb-clients but 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 is to be installed mongodb-org-database-tools-extra : Conflicts: mongodb-clients but 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 is to be installed mongodb-org-shell : Conflicts: mongodb-clients but 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 is to be installed mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed Conflicts: mongodb-clients but 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 is to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
-
@Sampo2910 sorry. Try with
mongodb
instead ofmongo
-
I stopped the mongodb ok. The update goes ok but then to upgrade get the following.
smiley@fmjcod4:~$ sudo apt upgrade 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: libssl-dev : Depends: libssl1.1 (= 1.1.1f-1ubuntu2.23) but 1.1.1f-1ubuntu2 is installed libssl1.1 : Breaks: libssl1.1:i386 (!= 1.1.1f-1ubuntu2) but 1.1.1f-1ubuntu2.23 is installed libssl1.1:i386 : Breaks: libssl1.1 (!= 1.1.1f-1ubuntu2.23) but 1.1.1f-1ubuntu2 is installed 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). smiley@fmjcod4:~$
Trying to fix broken install does not work and gives this.
smiley@fmjcod4:~$ 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 libphobos2-108 libphobos2-108:i386 libsnappy1v5 libtcmalloc-minimal4 libyaml-cpp0.6 mongo-tools mongodb-server-core Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libssl1.1 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 The following packages will be upgraded: libssl1.1 1 upgraded, 3 newly installed, 0 to remove and 22 not upgraded. 8 not fully installed or removed. Need to get 116 MB of archives. After this operation, 386 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://fi.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.23 [1,323 kB] Get:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0/multiverse amd64 mongodb-org-server amd64 8.0.4 [38.6 MB] Get:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0/multiverse amd64 mongodb-org-mongos amd64 8.0.4 [29.3 MB] Get:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0/multiverse amd64 mongodb-database-tools amd64 100.10.0 [46.5 MB] Fetched 116 MB in 3s (43.1 MB/s) Preconfiguring packages ... (Reading database ... 198688 files and directories currently installed.) Preparing to unpack .../libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb ... Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.23) over (1.1.1f-1ubuntu2) ... dpkg: error processing archive /var/cache/apt/archives/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb (--unpack): trying to overwrite shared '/usr/share/doc/libssl1.1/changelog.Debian.gz', which is different from other instances of package libssl1.1:amd64 Preparing to unpack .../mongodb-org-server_8.0.4_amd64.deb ... Unpacking mongodb-org-server (8.0.4) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_8.0.4_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_8.0.4_amd64.deb ... Unpacking mongodb-org-mongos (8.0.4) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_8.0.4_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.10.0_amd64.deb ... Unpacking mongodb-database-tools (100.10.0) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.10.0_amd64.deb (--unpack): trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1 No apport report written because MaxReports is reached already dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb /var/cache/apt/archives/mongodb-org-server_8.0.4_amd64.deb /var/cache/apt/archives/mongodb-org-mongos_8.0.4_amd64.deb /var/cache/apt/archives/mongodb-database-tools_100.10.0_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
This is the same output with mongodb started or stopped.
-
@Sampo2910 can you switch to
root
and try again? Seems like a permissions issue. -
Same output
Is it possible that there are two mongo instances installed. I think it tried to update. I was using an old version ( 3 something ) which was fine for my needs.
-
@Sampo2910 quite possible, yes. What is the output of
sudo dpkg -l | grep mongodb
or
sudo apt list --installed | grep mongodb
-
@phenomlab Here is the output for both.
smiley@fmjcod4:~$ sudo dpkg -l | grep mongodb [sudo] password for smiley: iU mongodb-mongosh 2.3.7 amd64 MongoDB Shell CLI REPL Package iU mongodb-org 8.0.4 amd64 MongoDB open source document-oriented database system (metapackage) iU mongodb-org-database 8.0.4 amd64 MongoDB open source document-oriented database system (metapackage) iU mongodb-org-database-tools-extra 8.0.4 amd64 Extra MongoDB database tools iU mongodb-org-shell 8.0.4 amd64 MongoDB shell client iU mongodb-org-tools 8.0.4 amd64 MongoDB tools rc mongodb-server 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 all object/document-oriented database (managed server package) ii mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 amd64 object/document-oriented database (server binaries package) smiley@fmjcod4:~$ ^C smiley@fmjcod4:~$ sudo apt list --installed | grep mongodb WARNING: apt does not have a stable CLI interface. Use with caution in scripts. mongodb-mongosh/focal/mongodb-org/8.0,now 2.3.7 amd64 [installed,automatic] mongodb-org-database-tools-extra/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic] mongodb-org-database/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic] mongodb-org-shell/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic] mongodb-org-tools/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed,automatic] mongodb-org/focal/mongodb-org/8.0,now 8.0.4 amd64 [installed] mongodb-server-core/focal-updates,focal-security,now 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 amd64 [installed,auto-removable]
-
It is running but I still cannot do any updates as mentioned.
smiley@fmjcod4:~$ sudo service mongodb status ● mongodb.service - LSB: An object/document-oriented database Loaded: loaded (/etc/init.d/mongodb; generated) Active: active (running) since Tue 2024-12-31 02:13:22 EET; 1h 8min ago Docs: man:systemd-sysv-generator(8) Process: 14698 ExecStart=/etc/init.d/mongodb start (code=exited, status=0/SUCCESS) Tasks: 34 (limit: 16594) Memory: 149.6M CGroup: /system.slice/mongodb.service └─14716 /usr/bin/mongod --config /etc/mongodb.conf Dec 31 02:13:21 fmjcod4 systemd[1]: Starting LSB: An object/document-oriented database... Dec 31 02:13:21 fmjcod4 mongodb[14698]: * Starting database mongodb Dec 31 02:13:22 fmjcod4 mongodb[14698]: ...done. Dec 31 02:13:22 fmjcod4 systemd[1]: Started LSB: An object/document-oriented database.
-
@Sampo2910 I can take a look at this today at some point. Can you PM me the login details?
-
Repo problem
-
@phenomlab I will PM you .Thank you.
-
@DownPW Seems not
Hit:10 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease
Related Topics
-
-
-
-
-
-
Mongodb Authorisation.
Solved General -
-