Hi all,
using Raspberry PI Imager i flash from zero the last Octoprint 1.11.3 (stable) on a Raspberry PI 3.
Everything works fine and octoprint starts and works well.
The problem is that i can't run "sudo apt upgrade" ("sudo apt update" works). it give me errors correlated to dpkg.
For this problem i can't install other things like Octodash.
I'm not used to linux, so i asked to AI to solve some problem, without a results.
I tryed to flash a previous version using Imager and it gives me no problem.
"dpkg: unrecoverable fatal error, aborting: too-long line or missing newline in '/var/lib/dpkg/diversions' E: Sub-process /usr/bin/dpkg returned an error code (2)"
It's strange that from a fresh new install i got an error at the first upgrade.
Then i follow some hints from ChectGPT to solve this by reparing the configuration and then i got:
"Preparing to unpack .../00-openssh-sftp-server_1%3a9.2p1-2+deb12u7_armhf.deb ... Unpacking openssh-sftp-server (1:9.2p1-2+deb12u7) over (1:9.2p1-2+deb12u3) ... Preparing to unpack .../01-openssh-server_1%3a9.2p1-2+deb12u7_armhf.deb ... Unpacking openssh-server (1:9.2p1-2+deb12u7) over (1:9.2p1-2+deb12u3) ... Preparing to unpack .../02-openssh-client_1%3a9.2p1-2+deb12u7_armhf.deb ... Unpacking openssh-client (1:9.2p1-2+deb12u7) over (1:9.2p1-2+deb12u3) ... Preparing to unpack .../03-libexpat1-dev_2.5.0-1+deb12u2_armhf.deb ... Unpacking libexpat1-dev:armhf (2.5.0-1+deb12u2) over (2.5.0-1+deb12u1) ... Preparing to unpack .../04-libexpat1_2.5.0-1+deb12u2_armhf.deb ... Unpacking libexpat1:armhf (2.5.0-1+deb12u2) over (2.5.0-1+deb12u1) ... Preparing to unpack .../05-python3.11-dev_3.11.2-6+deb12u6_armhf.deb ... Unpacking python3.11-dev (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../06-libpython3.11-dev_3.11.2-6+deb12u6_armhf.deb ... Unpacking libpython3.11-dev:armhf (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../07-libpython3.11_3.11.2-6+deb12u6_armhf.deb ... Unpacking libpython3.11:armhf (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../08-python3.11-venv_3.11.2-6+deb12u6_armhf.deb ... Unpacking python3.11-venv (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../09-python3.11_3.11.2-6+deb12u6_armhf.deb ... Unpacking python3.11 (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../10-libpython3.11-stdlib_3.11.2-6+deb12u6_armhf.deb ... Unpacking libpython3.11-stdlib:armhf (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... dpkg: error processing archive /tmp/apt-dpkg-install-dCTIs9/10-libpython3.11-stdlib_3.11.2-6+deb12u6_armhf.deb (--unpack): trying to overwrite '/usr/lib/python3.11/EXTERNALLY-MANAGED', which is also in package raspberrypi-sys-mods 20241111 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Preparing to unpack .../11-python3.11-minimal_3.11.2-6+deb12u6_armhf.deb ... Unpacking python3.11-minimal (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../12-libpython3.11-minimal_3.11.2-6+deb12u6_armhf.deb ... Unpacking libpython3.11-minimal:armhf (3.11.2-6+deb12u6) over (3.11.2-6+deb12u5) ... Preparing to unpack .../13-libsqlite3-0_3.40.1-2+deb12u2_armhf.deb ... Unpacking libsqlite3-0:armhf (3.40.1-2+deb12u2) over (3.40.1-2+deb12u1) ... Errors were encountered while processing: /tmp/apt-dpkg-install-dCTIs9/10-libpython3.11-stdlib_3.11.2-6+deb12u6_armhf.deb E: Sub-process /usr/bin/dpkg returned an error code (1) "
I then execute several commands (like "sudo apt -o Dpkg::Options::="--force-overwrite" -f install") to force overwrite or fix broken install but without success.
Flash the image again. It's a complete mystery what you did based on the "advice" by ChatGPT, it probably hallucinated some stuff that made things worse.
Flash again, see if the issue still persists, if so do not consult any genAI but instead share the exact errors that you see here.
i flash it several times...you can also try using a Rasp3B and the last version proposed into Imager. Unce Octoprint is running, try the update and upgrade command...no other command given...every time i got the same error (it's systematic):
"dpkg: unrecoverable fatal error, aborting: too-long line or missing newline in '/var/lib/dpkg/diversions' E: Sub-process /usr/bin/dpkg returned an error code (2)"
since a few days ago on the Imager there was also a previous version, not only the 1.11.3 (i can't remember the exact version). That version give me no problem. Upgrade works, and also octodash.
In the next days, at least on monday i can reflash the SD. I will send you some screenshot and a complete log.
I just flashed OctoPi-UpToDate 1.1.0-1.11.3- 2025.09.09.113029 (which is what's currently shown as stable on the imager, and has been since September 9th), did an apt update and then an apt upgrade and everything ran through without errors. Whatever this is, I cannot reproduce it currently.
Maybe some package was broken temporarily on the repository?
i reinstall everything this morning and it works. all the upgrade and also the Octodash install goes well.
The only thing i have changed is the SD.
Maybe the SD or maybe the repository i don't know.
Sorry if i have borrow you and thanks for the feedbacks.