Ubuntu 25.04 - Can't run apt upgrade

Ubuntu Version:
25.04. Upgraded from 24.10 before that.

Desktop Environment (if applicable):
GNOME

Problem Description:
A few days ago I upgraded from Ubuntu 24.10 to 25.04, but the installation froze 80% of the way through. I left it for 24+ hours, and it was still stuck, so I was forced to reboot. On reboot, it successfully loaded into the GNOME desktop, and it shows I am running 25.04, but the kernel is still on 6.11 instead of 6.14. I ran sudo apt update && sudo apt upgrade, but it throws the error: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. Upon running that command, the terminal freezes after this output:

Sourcing file /etc/default/grub
Sourcing file /etc/default/grub.d/kdump-tools.cfg
Generating grub configuration file ...
Found linux image: vmlinuz-6.11.0-25-generic in rpool/ROOT/ubuntu_iis9yu
Found intitrd image: initrd.img-6.11.0-25-generic in rpool/ROOT/ubuntu-iis9yu

I left it for 24 hours hoping it would proceed, but it never resolves. If I try to open a new terminal window after the command has been run, it stays frozen. The terminal cannot be killed without restarting the computer.

Relevant System Information:
i5-4670k
Gigabyte mobo
16 GB DDR3
SSD
ZFS on root

Screenshots or Error Messages:

What I’ve Tried:
Commands I have tried to fix the issue include sudo apt-get clean, sudo apt install -f, and sudo update-initramfs -v -u. The latter command does work and presents no errors, but running sudo dpkg --configure -a after, the terminal window freezes again.

Welcome to Ubuntu Discourse :slight_smile:

Please run the following commands and show us the output if there are errors:
sudo apt update

If no errors, then:
sudo apt full-upgrade

Also, if not installed please install inxi
sudo apt install inxi

Then inxi -r and post the output.

Unfortunately I can’t run apt upgrade and install inxi.

sudo apt update

Hit:1 http://ca.archive.ubuntu.com/ubuntu plucky InRelease
Get:2 http://ca.archive.ubuntu.com/ubuntu plucky-updates InRelease [126 kB]
Get:3 http://security.ubuntu.com/ubuntu plucky-security InRelease [126 kB]
Get:4 http://ca.archive.ubuntu.com/ubuntu plucky-backports InRelease [126 kB]
Get:5 http://ca.archive.ubuntu.com/ubuntu plucky-updates/main amd64 Components [14.7 kB]
Get:6 http://ca.archive.ubuntu.com/ubuntu plucky-updates/restricted amd64 Components [212 B]
Get:7 http://ca.archive.ubuntu.com/ubuntu plucky-updates/universe amd64 Components [752 B]
Get:8 http://ca.archive.ubuntu.com/ubuntu plucky-updates/multiverse amd64 Components [212 B]
Get:9 http://ca.archive.ubuntu.com/ubuntu plucky-backports/main amd64 Components [212 B]
Get:10 http://ca.archive.ubuntu.com/ubuntu plucky-backports/restricted amd64 Components [216 B]
Get:11 http://ca.archive.ubuntu.com/ubuntu plucky-backports/universe amd64 Components [216 B]
Get:12 http://ca.archive.ubuntu.com/ubuntu plucky-backports/multiverse amd64 Components [216 B]
Get:13 http://security.ubuntu.com/ubuntu plucky-security/main amd64 Components [14.7 kB]
Get:14 http://security.ubuntu.com/ubuntu plucky-security/restricted amd64 Components [212 B]
Get:15 http://security.ubuntu.com/ubuntu plucky-security/universe amd64 Components [748 B]
Get:16 http://security.ubuntu.com/ubuntu plucky-security/multiverse amd64 Components [212 B]
Fetched 411 kB in 1s (352 kB/s)                                              
All packages are up to date.

sudo apt full-upgrade
Error: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Have you tried running this again after apt update?

Yes. It freezes the terminal, as I said in my OP. dpkg --configure -a never finishes and I am forced to restart the computer if I want to use the terminal for anything.

Try this, let’s switch to a different TTY, Ctrl + Alt + F3, login with your username and password.

Then run sudo dpkg --configure -a again.

Still freezes, any error messages that can help us narrow it down?

First, it’s important to check if any other process is locking dpkg filesYou can check for this by running:

ps aux | grep -i apt

This may help us as well.

This happens far too much! It just hangs there forever!

1 Like

Weird question that might not pertain to this, but could apt-get install --fix-broken fix anything that dpkg is tripping up on?

Ok, something new. So after 10 minutes of nothing, some new messages appeared in the tty. I can’t copy and paste it all, but the messages are mostly the same.

[72254. 736505] INFO: task ls:28095 blocked fore more than 122 seconds.
[72254. 736564] Tainted: P            W IO     6.11.0-25 generic #25-Ubuntu
[72254. 736601] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[72254. 738506] INFO: task mount.zfs:28097 blocked fore more than 122 seconds.

So it’s something with the kernel andZFS,S which doesn’t surprise me. When upgrading to 25.04, the package manager removed ZSys, because apparently it is deprecated. It handled all the ZFS related things on Ubuntu.

I know all my drives are in good health, so that is not the problem.

EDIT: Just want to add that after an hour, nothing has progressed. Also, going back to the GNOME desktop and opening terminal, it is frozen, so I have to reboot if I want to use the terminal again.

I’m having exactly the same issue. ZFS with encryption and MacBook Pro 2015.

This smells like a low memory issue now!

I haven’t used ZSys for few years now, Nor do I miss it. :wink:

How are you snapshot-ing? Do you have enough head room?

zfs list -t snapshot 
NAME                                                    USED  AVAIL  REFER  MOUNTPOINT
bpool@5-16                                                0B      -    96K  -
bpool/BOOT@5-16                                           0B      -    96K  -
bpool/BOOT/ubuntu_8a3toy@5-16                          81.6M      -   235M  -
rpool@5-16                                                0B      -   192K  -
rpool/ROOT@5-16                                           0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy@5-16                           954M      -  8.29G  -
rpool/ROOT/ubuntu_8a3toy/srv@5-16                         0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy/usr@5-16                         0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy/usr/local@5-16                 112K      -   496K  -
rpool/ROOT/ubuntu_8a3toy/var@5-16                         0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy/var/games@5-16                   0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy/var/lib@5-16                   102M      -  1.68G  -
rpool/ROOT/ubuntu_8a3toy/var/lib/AccountsService@5-16   112K      -   340K  -
rpool/ROOT/ubuntu_8a3toy/var/lib/NetworkManager@5-16    312K      -   360K  -
rpool/ROOT/ubuntu_8a3toy/var/lib/apt@5-16              60.7M      -  62.6M  -
rpool/ROOT/ubuntu_8a3toy/var/lib/dpkg@5-16             39.7M      -   108M  -
rpool/ROOT/ubuntu_8a3toy/var/log@5-16                  1.10M      -  85.8M  -
rpool/ROOT/ubuntu_8a3toy/var/mail@5-16                    0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy/var/snap@5-16                    0B      -   192K  -
rpool/ROOT/ubuntu_8a3toy/var/spool@5-16                 192K      -   312K  -
rpool/ROOT/ubuntu_8a3toy/var/www@5-16                     0B      -   192K  -
rpool/USERDATA@5-16                                       0B      -   192K  -
rpool/USERDATA/home_jo790q@5-16                        1.04G      -  9.70G  -
rpool/USERDATA/root_jo790q@5-16                        1.03M      -  2.11M  -

df -HT /boot
Filesystem               Type  Size  Used Avail Use% Mounted on
bpool/BOOT/ubuntu_8a3toy zfs   1.8G  247M  1.6G  14% /boot

I just can’t seem to break mine currently. And my Memory is fairly constant @ 30%. Total Memory is

 inxi -m
Memory:
  System RAM: total: 16 GiB available: 13.5 GiB used: 4.06 GiB (30.1%)
  Array-1: capacity: 32 GiB slots: 2 modules: 2 EC: None
  Device-1: Channel-A DIMM 0 type: DDR4 size: 8 GiB speed: 3200 MT/s
  Device-2: Channel-B DIMM 0 type: DDR4 size: 8 GiB speed: 3200 MT/s

Still not enough for a educated guess to help though!

Also Please show us this:

sudo sysctl -a | grep dirty

ZFS snapshots could be part of the issue… Before and after I updated to 24.10, I remember checking to make sure I had enough space, and I did. When updating to 25.04 I only checked bpool.

bpool has 37 snapshots total, which it did not before upgrading.

NAME                                       USED  AVAIL  REFER  MOUNTPOINT
bpool/BOOT/ubuntu_iis9yu@autozsys_l39jlr  94.5M      -   289M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_sxuuvq    72K      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_9bjm7j    64K      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_vj3sdc    64K      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_ui01mk    64K      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_hkhlyp     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_p1knbn     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_j31jkr     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_0icnww     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_7uo7wo     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_87d1d1     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_3poxfi     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_zlmmnf     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_jhl5hn     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_mx38f5     0B      -   194M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_mi9mm3     0B      -   195M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_8q4h93     0B      -   195M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_2b05oy    88K      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_tuqphm    72K      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_nb08ka    64K      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_7waywy     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_a92jxr     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_km9kgd     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_vhhc0q     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_1zqmsw     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_mg6pzg     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_va7scn     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_fkb7os     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_hwvmke     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_k0tguj     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_jh37sx     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_wpp7xq     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_7v9d1i     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_z97czi     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_oatp8x     0B      -  98.6M  -
bpool/BOOT/ubuntu_iis9yu@autozsys_w2yoge     0B      -  98.6M  -

I ran both df and zfs list

Filesystem               Type  Size  Used Avail Use% Mounted on
bpool/BOOT/ubuntu_iis9yu zfs   1.2G  129M  1.1G  12% /boot
NAME                       USED  AVAIL  REFER  MOUNTPOINT
bpool                      814M   977M    96K  /boot
bpool/BOOT                 811M   977M    96K  none
bpool/BOOT/ubuntu_iis9yu   811M   977M   122M  /boot

I can’t run inxi but memory seems fine. GNOME System Monitor shows 5.2 GB of 16 GB used with 2.6 in cache on a fresh boot. There are some background services running.

vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 10
vm.dirty_bytes = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_ratio = 20
vm.dirty_writeback_centisecs = 500
vm.dirtytime_expire_seconds = 43200

Ahha!
Please give this try, before your terminal locks up:

sudo su -c "echo 10000000 > /proc/sys/vm/dirty_bytes"

Then run to avoid a reboot:

sudo sysctl -p

I did this about 2 years ago and it works very well for me>>>(YMMV)
Mine currently is:

sudo sysctl -a | grep dirty
[sudo] password for me: 
vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 10
vm.dirty_bytes = 10000000
vm.dirty_expire_centisecs = 3000
vm.dirty_ratio = 0
vm.dirty_writeback_centisecs = 500
vm.dirtytime_expire_seconds = 43200

I was just showing we had the same memory 16Gigs is all.
Let us know how this works out for you! :wink:

I ran the first command without issue. The second fails because sysctl.conf does not exist.

After running the first command, I ran dpkg --configure -a and left it for 15 minutes. The terminal is still frozen.

Should I try nuking some snapshots? I’m not out of space, but there is an abnormal amount of them, so maybe it is worth a try.

I would yes. :slight_smile:

 sudo cat /proc/sys/vm/dirty_bytes
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────
       β”‚ File: /proc/sys/vm/dirty_bytes
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
   1   β”‚ 10000000
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────
/etc/sysctl.dπŸ”’ 
└─> kate README.sysctl


Files located in this directory can set kernel parameters using the
sysctl(8) or systemd-sysctl(8) tool which is typically run with a
unit/init file started during the boot sequence.

For details regarding the configuration files refer to
sysctl.d(5) or sysctl.conf(5)

I removed 19 snapshots (94 MB) from bpool and 362 snapshots (3 GB) from rpool, then restarted. Ran dpkg --configure -a again, and it made no progress after another 25 minutes.

Dang might have to wipe this one from a bad Version-Upgrade!
If you have good back-ups, a clean install would be good suggestion. (I know I already feel the grimness)
It happens to the best of us. :frowning:

Appreciate your help!

Unfortunately, I can’t do a fresh install at this time, as I don’t have a big enough spare drive to off-load all this data. The computer still works, as long as I don’t run the above command or refresh any snaps.

Maybe someone else will have an idea, but it is not looking good…

Is everything on one drive, really??? Please say it’s not so.

└─> zpool status
  pool: bpool
 state: ONLINE
config:

        NAME                                          STATE     READ WRITE CKSUM
        bpool                                         ONLINE       0     0     0
          ata-WD_Blue_SN570_500GB_22393Z808123-part2  ONLINE       0     0     0

errors: No known data errors

  pool: rpool
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
        The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
config:

        NAME                                          STATE     READ WRITE CKSUM
        rpool                                         ONLINE       0     0     0
          usb-Sabrent_Sabrent_012345678930-0:0-part4  ONLINE       0     0     0

errors: No known data errors

  pool: tank
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          sda1      ONLINE       0     0     0

errors: No known data errors

Yes let’s hope someone can help you now. :pray:

I found this post on GitHub, and it looks like people are having a similar issue with dpkg --configure -a freezing. There doesn’t seem to be a solution yet, and it looks to involve both Ubuntu and ZFS.