Raspberry Pi apt install curl dpkg fatal error
17:28 13 Feb 2026

I'm installing Immich but my docker version was incorrect so I followed the docker install instructions. I already have curl installed but rather than apt skipping the install I get a fatal error when I ran $ sudo apt install curl. Can anyone explain how to fix the fatal error or why it happened? This is the first time I've seen apt fail in this way.

$ sudo apt install curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libbasicusageenvironment1 libgroupsock8 liblivemedia77 libxcb-cursor0 python3-v4l2
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libcurl3-gnutls libcurl4
The following packages will be upgraded:
  curl libcurl3-gnutls libcurl4
3 upgraded, 0 newly installed, 0 to remove and 307 not upgraded.
Need to get 0 B/1,039 kB of archives.
After this operation, 65.5 kB disk space will be freed.
Do you want to continue? [Y/n] y
Reading changelogs... Done
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 72.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 252.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 253.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 272.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 274.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 278.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 281.
dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'libnftables1:arm64': cannot open /var/lib/dpkg/info/libnftables1:arm64.list (Structure needs cleaning)
E: Sub-process /usr/bin/dpkg returned an error code (2)

Investigating these files further I'm don't know why LS can't even access the errored file correctly.

$ ls -l /var/lib/dpkg/info/libnftables1*
ls: cannot access '/var/lib/dpkg/info/libnftables1:arm64.list': Structure needs cleaning
ls: cannot access '/var/lib/dpkg/info/libnftables1:arm64.md5sums': Bad message
ls: cannot access '/var/lib/dpkg/info/libnftables1:arm64.shlibs': Bad message
ls: cannot access '/var/lib/dpkg/info/libnftables1:arm64.symbols': Bad message
ls: cannot access '/var/lib/dpkg/info/libnftables1:arm64.triggers': Bad message

Additional Info:

I already have CURL installed so no idea why apt is struggling, but here's my curl version in case it matters.

$ curl --version
curl 7.88.1 (aarch64-unknown-linux-gnu) libcurl/7.88.1 OpenSSL/3.0.17 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.3 libpsl/0.21.2 (+libidn2/2.3.3) libssh2/1.10.0 nghttp2/1.52.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2023-02-20, security patched: 7.88.1-10+deb12u12
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

apt update is still working fine.

$ sudo apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease                                                                                                                               
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease                                                                                                                                         
Hit:4 https://download.docker.com/linux/debian bookworm InRelease                                                                                                                                     
Hit:5 http://archive.raspberrypi.com/debian bookworm InRelease                                                                                                                                        
Hit:6 https://downloads.plex.tv/repo/deb public InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
310 packages can be upgraded. Run 'apt list --upgradable' to see them.
docker curl raspberry-pi apt dpkg