I am trying to upgrade ubuntu Unity 24.04 to ubuntu unity 26.04 for the second time.
Recap: I had problems with the upgrade that appeared to be related to a bad SSD. I have since replaced the culprit and re-instated my ubuntu unity 24.04.
I ran ‘Software Updater’ to bring in the latest updates, and then selected ‘Upgrade’ for ubuntu unity 26.04 for the second time.
As I discussed in my previous post, the ‘Upgrade’ completed and asked for my password. However, the system did not ‘listen’ to my keyboard, so I physically booted and was greeted with the same Kernel Panic as I had on my first attempt. I fixed this and booted again, right into busybox where I enterred: fsck -y /dev/sda2
and booted successfully into ubuntu unity 26.04.
Then in Konsole:
sudo dpkg --configure -a
dpkg: error: unable to open/create dpkg frontend lock for directory /var/lib/dpkg: Read-only file system
sudo mount -o remount,rw /
sudo dpkg --configure -a
dpkg: error: unable to open/create dpkg frontend lock for directory /var/lib/dpkg: Read-only file system
This is just like my previous attempt. Not sure what to do here??
and booted since I am missing the internet Icon. I have to reboot several times to get the icons, each time I have to do the fsck, and when the icons finally appear I am properly connected to ethernet, and I can see wifi availability.
So for now I have 2 problems:
I have to fsck in busy box every second boot
I have to boot several times until I get the 2 missing icons - internet and alacarte.
I see you decided to finish off that damn machine once and for all
The power-off while dpkg was writing locked your filesystem in read-only again.
Go back to post #37 in your old thread and do that same trick with tune2fs (or use Recovery mode from rEFInd) so fsck cleans the disk on reboot.
Then finish the broken packages with sudo dpkg --configure -a and sudo apt --fix-broken install.
That will clear the read-only lock, bring your Wi-Fi back, and get kernel 7.0 booting properly.
sudo tune2fs -C 999 -c 1 /dev/sda2 tune2fs 1.47.2 (1-Jan-2025) Setting maximal mount count to 1
Setting current mount count to 999
sudo reboot
sudo dpkg --configure -a Setting up refind (0.14.2-2.1)… Installing rEFInd to the ESP... dpkg: error processing package refind (--configure): old refind package postinst maintainer script subprocess failed with exit status 1 Errors were encountered while processing: refind
Not sure what ‘refind’ is doing here - I haven’t used it in years.
sudo apt --fix-broken install Reading package lists... Error!
Notice: Ignoring file 'surfshark.list.migrate' in directory '/etc/apt/sources.list.d/'
as it has an invalid filename extension Error: Unable to parse package
file /var/lib/apt/lists/esm.ubuntu.com_apps_ubuntu_dists_resolute-apps-security_InRelease (1)
Error: The package lists or status file could not be parsed or opened.
W: Ignoring file 'surfshark.list.migrate' in directory '/etc/apt/sources.list.d/'
as it has an invalid filename extension
Not sure why vpn ‘surfshark’ is having a problem - it worked fine in 24.04. Maybe I have to purge and re-install - but why?
The good news - it does boot without the need for fsck.
Here it comes…However: A Red Circle with a white vertical line within appears at the top RHS of the Desktop Menu bar. Right click on the Red Circle and it says ‘An error occurred please run Package Manager…’
So I run Synaptic and get this lovely message:
E: Unable to parse package file /var/lib/apt/lists/esm.ubuntu.com_apps_ubuntu_dists_resolute-apps-security_InRelease (1) E: The package lists or status file could not be parsed or opened. E: _cache->open() failed, cannot continue.
W: Ignoring file ‘surfshark.list.migrate’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
Interesting to note that when the Icons are missing from the Desktop Menu Bar, so is the Red Circle. But when I ‘sudo synaptic’ I get the same ‘E: Unable to parse…’ as above.
The hard reboot cut power while apt was writing, so your package list cache in /var/lib/apt/lists got corrupted. That is why Synaptic and apt choke on that InRelease file, and why the red warning icon appeared on the panel.
First - wipe the corrupted lists cache and refresh apt:
Second, rEFInd failed to install to the ESP because /boot/efi (usually /dev/sda1 ) is either not mounted or its FAT filesystem got dirty during the power loss:
sudo fsck.vfat -a /dev/sda1
sudo mount /boot/efi
sudo dpkg --configure refind
sudo apt --fix-broken install
sudo mount /boot/efi
mount: /boot/efi: can't find in /etc/fstab.
sudo dpkg --configure refind
dpkg: error: unable to open/create dpkg frontend lock for directory /var/lib/dpkg: Read-only file system
sudo apt --fix-broken install
dpkg: error: unable to open/create dpkg database lock file for directory /var/lib/dpkg: Read-only file system
touch: setting times of '/var/lib/update-notifier/dpkg-run-stamp': Read-only file system
Warning: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
Warning: Not using locking for read only lock file /var/lib/dpkg/lock
Warning: chown to _apt:root of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0700 of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chown to _apt:root of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0755 of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: Not using locking for read only lock file /var/cache/apt/archives/lock
Warning: Problem unlinking the file /var/log/apt/eipp.log.xz - FileFd::Open (30: Read-only file system)
Warning: Could not open file /var/log/apt/eipp.log.xz - open (17: File exists)
Warning: Could not open file '/var/log/apt/eipp.log.xz' - EIPP::OrderInstall (17: File exists)
Error: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (30: Read-only file system)
Error: Failed to write temporary StateFile /var/lib/apt/extended_states
Warning: Could not open file '/var/log/apt/term.log' - OpenLog (30: Read-only file system)
Error: Sub-process /usr/bin/dpkg returned an error code (2)
Warning: Problem unlinking the file /var/cache/apt/pkgcache.bin - pkgDPkgPM::Go (30: Read-only file system)
And I had to try this:
sudo synaptic
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp to /tmp/pulse-PKdhtXMmr18n: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp to /tmp/pulse-2L9K88eMlGn7: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp to /tmp/pulse-CcctT9RwKSB1: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp: Read-only file system
cannot open /etc/apt/apt.conf.d/99synaptic to write APT::Install-Recommends
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp to /tmp/pulse-FebW397VI5uG: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp to /tmp/pulse-1yhc3uavuaOb: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp: Read-only file system
Internal Error: error storing raptoptions
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp to /tmp/pulse-9vyJcXyHZzsR: Read-only file system
Failed to symlink /root/.config/pulse/9a822e4e6fd940629c562193b7fbef98-runtime.tmp: Read-only file system
and when synaptic started:
An Error Occurred. The following details are provided.
W: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
W: Not using locking for read only lock file /var/lib/dpkg/lock
And now, somehow, I’m back to having to fsck when I boot
Are you having fun yet ?
I don’t know why my system is so different ?
2- Reset the forced fsck counter so it stops checking on every boot:
sudo tune2fs -c 30 -C 0 /dev/sda2
3- Purge leftover rEFInd that fails on the missing ESP:
sudo dpkg --purge refind
4- Finish configuring packages:
sudo dpkg --configure -a
sudo apt --fix-broken install
If step 1 complains that it cannot remount because the journal is aborted, just do one clean reboot, let fsck finish at boot, log in, and run steps 2 to 4 above.
Okay, I’m really impressed . I’m actually writing this post using 26.04.
I think we finally have it. There are some issues that I have no doubt you can help me with.
System tray icons are usually not there. If I boot several times, they may appear. These are alacarte and wifi. And probably related, If I start some apps, their icons also do not appear (like flameshot). So I have to keep rebooting until the icons finally do appear, then all is good.
When I start Software Updater, I get ‘failed to load repository information’. Then the Updates come in, and then I got a ‘package operation failure’. Sadly, it doesn’t tell me which package. When I start Software Updater again, I do get the ‘failed to load repo info’, but since there are no updates, it completes without the ‘package operation failure’. Next time I will do it again in console and hopefully I can provide more info
sudo apt autoremove
...
...
update-initramfs: Generating /boot/initrd.img-7.0.0-34-generic
sync: error syncing '/boot/initrd.img-7.0.0-34-generic': Input/output error
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-7.0.0-34-generic (--configure):
old linux-image-7.0.0-34-generic package postinst maintainer script subprocess failed with exit status 1
Errors were encountered while processing:
linux-image-7.0.0-34-generic
Error: Sub-process /usr/bin/dpkg returned an error code (1)
What gives here ?
I mistakenly told you that I don’t use rEFInd. I lied. I was getting frustrated and mistook ‘rEFInd’ for something else. Now I will re-install rEFInd.
I will keep checking for any other problems, but I think we have it.
If you lived near me (1000 Islands, Ontario, Canada), I would take you and your significant other out to dinner. Thanks so much for your patience and help. You have yourself a nice day
M…
Hi again.
I’m not sure what is going on - I will try to reconstruct.
I did a Stacer ‘System Cleaner’ and booted.
Now I get 'A java script error occurred in the main process.
Error: EROFS: Read only file system, write
This time the system tray is there, and there is a red circle with a white horizontal line in it.
When I start Synaptic,
E: Could not create temporary file for /var/cache/apt/pkgcache.bin - mkstemp (30: Read-only file system)
E: The package lists or status file could not be parsed or opened.
E: _cache->open() failed, cannot continue.
W: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
W: Not using locking for read only lock file /var/lib/dpkg/lock
I booted, and this time I had to do another ‘fsck’ .
The system comes up with no java script error but the red circle is there (only when the system tray is there):
Synaptic starts clean with no errors. The only problem is the red circle which says:
Run Package Manager…Error: Opening the cache (E: unable to parse package file var/lib/apt/lists/security.com_ubuntu_dists-resolute-security_restricted_binary-AMD64_Packages(1))
Your cache file is corrupted - may be unmet dependencies
What have I done ?? Was it the ‘autoremove’ ?
So now I boot and have to do the fsck again, and the I’m blessed with the ‘java script error’. Yikes.
Mike, first rule of Linux club: ditch Stacer
Third-party “system cleaners” are a classic way to wreck apt and filesystem state. That JavaScript error was Stacer itself (it is an Electron app) crashing because the kernel remounted the root filesystem read-only to protect it from corrupted inodes.
The red circle on your panel is because Stacer left a broken duplicate file in your apt lists - notice that weird Packages(1) at the end of the filename.
Let’s clean up after Stacer’s “cleaning”:
First, get rid of Stacer so it stops breaking things:
sudo apt purge stacer
Wipe the corrupted apt list cache and regenerate it cleanly:
sudo rm -rf /var/lib/apt/lists/*
sudo apt clean
sudo apt update
Fix any half-broken packages if autoremove got interrupted:
sudo dpkg --configure -a
sudo apt --fix-broken install
The fronted read only file lock won’t allow me to execute your commands:
sudo apt purge stacer
Reading package lists... Error!
Warning: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
Warning: Not using locking for read only lock file /var/lib/dpkg/lock
Error: Could not create temporary file for /var/cache/apt/pkgcache.bin - mkstemp (30: Read-only file system)
Error: The package lists or status file could not be parsed or opened.
sudo rm -rf /var/lib/apt/lists/*
rm: cannot remove '/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_resolute-backports_InRelease': Read-only file system
rm: cannot remove '/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_resolute-backports_main_cnf_Commands-amd64': Read-only file system
..
..
rm: cannot remove '/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_resolute-security_universe_i18n_Translation-en': Read-only file system
sudo apt clean
Warning: chown to _apt:root of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0700 of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chown to _apt:root of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0755 of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: Not using locking for read only lock file /var/cache/apt/archives/lock
Warning: chown to _apt:root of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chown to _apt:root of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0755 of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: Not using locking for read only lock file /var/lib/apt/lists/lock
Warning: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (30: Read-only file system)
Warning: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (30: Read-only file system)
Warning: Problem unlinking the file /var/cache/apt/pkgcache.bin.fiuR3w - RemoveCaches (30: Read-only file system)
If it refuses, reboot with Recovery mode and let fsck repair it.
If your disk is brand new, check your SATA cable. A bad or loose SATA cable drops the link during heavy disk writes and forces ext4 into read-only mode:
sudo smartctl -a /dev/sda | grep -i -E "model|crc|realloc"
If UDMA_CRC_Error_Count is higher than 0 - dead SATA cable or port on the motherboard.
sudo rm -rf /var/lib/apt/lists/*
rm: cannot remove '/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_resolute-backports_InRelease': Read-only file system
rm: cannot remove '/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_resolute-backports_main_cnf_Commands-amd64': Read-only file system
rm: cannot remove '/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_resolute-backports_main_dep11_Components-amd64.yml.gz': Read-only file system
..
..
rm: cannot remove '/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_resolute-security_universe_dep11_icons-64x64.tar.gz': Read-only file system
rm: cannot remove '/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_resolute-security_universe_i18n_Translation-en': Read-only file system
I guess there was no point in continuing but I tried anyways:
sudo apt clean
Warning: chown to _apt:root of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
Warning: chmod 0700 of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
..
..
Warning: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (30: Read-only file system)
Warning: Problem unlinking the file /var/cache/apt/pkgcache.bin.7Ko8Er - RemoveCaches (30: Read-only file system)
Warning: Problem unlinking the file /var/cache/apt/srcpkgcache.bin.MBgwfx - RemoveCaches (30: Read-only file system)
sudo apt update
Ign:1 http://security.ubuntu.com/ubuntu resolute-security InRelease
Ign:2 https://dl.google.com/linux/chrome-stable/deb stable InRelease
..
..
Warning: Problem unlinking the file /var/cache/apt/pkgcache.bin.7Ko8Er - RemoveCaches (30: Read-only file system)
Warning: Problem unlinking the file /var/cache/apt/srcpkgcache.bin.MBgwfx - RemoveCaches (30: Read-only file system)
Error: Could not create temporary file for /var/cache/apt/pkgcache.bin - mkstemp (30: Read-only file system)
Error: The package lists or status file could not be parsed or opened.
sudo dpkg --configure -a
dpkg: error: unable to open/create dpkg frontend lock for directory /var/lib/dpkg: Read-only file system
sudo apt --fix-broken install
Reading package lists... Error!
Warning: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
Warning: Not using locking for read only lock file /var/lib/dpkg/lock
Error: Could not create temporary file for /var/cache/apt/pkgcache.bin - mkstemp (30: Read-only file system)
Error: The package lists or status file could not be parsed or opened.
I could not run ‘smartctl’ because I need synaptic to install it and synaptic gives me an error:
E: Could not create temporary file for /var/cache/apt/pkgcache.bin - mkstemp (30: Read-only file system)
But the SATA is brand new I reseated all the cables. IMHO this is not a hardware error.
Emask 0x60 (host bus error) ata1: hard resetting link ata1: SATA link up 1.5 Gbps ... configured for UDMA/33
That is a physical SATA problem, not software. The link is unstable, so the controller resets it and drops the speed down to 1.5 Gbps. The write failed with error -5 (-EIO), which is why ext4 panicked into read-only.
Just reseating won’t fix a bad wire. Replace the SATA cable, switch to another SATA port on the board, and try a different power plug from the PSU. And honestly, your old drive is most likely completely fine - it was probably just this cable the whole time.
Once the cable is swapped, reboot and run fsck on /dev/sda2 or use that tune2fs command from earlier to clean up the journal…
I moved the new SSD from SATA Port 1 to SATA Port 5 on my ASUS motherboard.
I figured best to go back to 24.04 and do the 26.04 upgrade again.
It completed, but as before, did not accept my Password - so I did a manual boot.
Sadly I got the Kernel Panic again - this time on 7.0.0-38 generic. I then booted using an older kernel 6.?
sudo tune2fs -c 30 -C 0 /dev/sda2
tune2fs 1.47.2 (1-Jan-2025)
Setting maximal mount count to 30
Setting current mount count to 0
sudo dpkg --configure -a
Setting up snapd (2.76.3+ubuntu26.04)…
Created symlink '/etc/systemd/user/sockets.target.wants/snapd.session-agent.socket' → '/usr/lib/systemd/user/snapd.session-agent.socket'.
...
...
update-initramfs: Generating /boot/initrd.img-7.0.0-38-generic
Processing triggers for sgml-base (1.31+nmu1build1)…
sudo apt --fix-broken install
..
..
Error: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt autoremove
..
..
Error: Sub-process /usr/bin/dpkg returned an error code (1)
sudo reboot
The kernel panic has been repaired but the system hangs on the first app (Calendar). The desktop appears to be fine, but Systray is missing as before.
I had to boot into 24.04 in order to do this post.
Hi Mike, of course I remember you, was wondering where you disappeared
Wait, did you swap the cable, or just moved the same bad cable to port 5?
If the wire is broken, moving ports does nothing - it will keep dropping writes and killing ext4 during heavy install.
Also, what package failed in apt? You cut out the lines right before “dpkg returned an error code (1)”. Run sudo apt --fix-broken install and paste the actual error text.
I had to do the ‘fsck -y /dev/sda2’
System came up and I got this:
JavaScript Error occurred in the main process
Uncaught: Exception
Error EROFS: Read only file system write
Successive reboots (had to do the fsck thing) did not yield this message - so it is not consistent.
I tried to invoke Firefox for the first time, and I got ‘Firefox is already running’.
Rebooting and Firefox and internet all worked fine.
No consistency here.
Some of the Thunderbird email boxes are empty. The main one is fine.
If I try to restart Thunderbird, I get ‘thunderbird is already running’
I rebooted and all the Thunderbird email boxes were fine.
No Systray - requires multiple boots to appear.
Most apps are running fine.
Reviewing past notes, I tried this:
sudo mount -o remount,rw /
sudo dpkg --configure -a
dpkg: error: unable to open/create dpkg frontend lock for directory /var/lib/dpkg: Read-only file system
sudo apt --fix-broken install
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 1
1 not fully installed or removed.
Space needed: 0 B / 119 GB available
Setting up refind (0.14.2-2.1)…
Installing rEFInd to the ESP...
dpkg: error processing package refind (--configure):
old refind package postinst maintainer script subprocess failed with exit status 1
Errors were encountered while processing:
refind
Notice: Ignoring file 'surfshark.list.migrate' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
Error: Sub-process /usr/bin/dpkg returned an error code (1)