DPKG error on Jetson Orin Nano prevents installing new files

Hi there,

I am currently unable to run any sort of sudo apt install [package] commands on my Nvidia Jetson Orin Nano.

When I try to install a package, I get the following error (full logs below):

dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'evince-common': cannot open /var/lib/dpkg/info/evince-common.list (Bad message)

I have verified that that file exists, however when I open it it is empty.

I have tried to rename and remove the file, however that doesn’t work:

fov@marvel-fov-7:/var/lib/dpkg/info$ sudo rm evince-common.list
rm: cannot remove 'evince-common.list': Bad message
fov@marvel-fov-7:/var/lib/dpkg/info$ sudo mv /var/lib/dpkg/info/evince-common.list /var/lib/dpkg/info/evince-common.list.bak
mv: cannot stat '/var/lib/dpkg/info/evince-common.list': Bad message

I have also tried to reinstall dpkg, however that doesn’t work either, resulting in the same error:

sudo apt-get install --reinstall dpkg
...
After this operation, 0 B of additional disk space will be used.
debconf: Delaying package configuration, since apt-utils is not installed.
dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'evince-common': cannot open /var/lib/dpkg/info/evince-common.list (Bad message)
E: Sub-process /usr/bin/dpkg returned an error code (2)

Running sudo reboot doesn’t change anything either.

Sample full logs:

fov@marvel-fov-7:~$ sudo apt install curl
[sudo] password for fov: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dctrl-tools dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common
  libdebian-installer4 libtimezonemap-data libtimezonemap1 os-prober python3-icu python3-pam rdate tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libcurl4
The following NEW packages will be installed
  curl
The following packages will be upgraded:
  libcurl4
1 to upgrade, 1 to newly install, 0 to remove and 361 not to upgrade.
Need to get 0 B/372 kB of archives.
After this operation, 396 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: Delaying package configuration, since apt-utils is not installed.
dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'evince-common': cannot open /var/lib/dpkg/info/evince-common.list (Bad message)
E: Sub-process /usr/bin/dpkg returned an error code (2)
fov@marvel-fov-7:~$ sudo rm /var/lib/dpkg/info/evince-common.list
rm: cannot remove '/var/lib/dpkg/info/evince-common.list': Bad message
fov@marvel-fov-7:~$ sudo apt-get install --reinstall dpkg
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dctrl-tools dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common
  libdebian-installer4 libtimezonemap-data libtimezonemap1 os-prober python3-icu python3-pam rdate tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 362 not to upgrade.
Need to get 1,112 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 dpkg arm64 1.19.7ubuntu3.2 [1,112 kB]
Fetched 1,112 kB in 6s (177 kB/s)                                                                                                                              
debconf: Delaying package configuration, since apt-utils is not installed.
dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'evince-common': cannot open /var/lib/dpkg/info/evince-common.list (Bad message)
E: Sub-process /usr/bin/dpkg returned an error code (2)

Update with more logs when I tried to reinstall evince-common two different ways:

fov@marvel-fov-7:~$ sudo apt-get install --reinstall evince-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 362 not to upgrade.
Need to get 129 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 evince-common all 3.36.10-0ubuntu1 [129 kB]
Fetched 129 kB in 2s (81.2 kB/s)        
debconf: Delaying package configuration, since apt-utils is not installed.
dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'evince-common': cannot open /var/lib/dpkg/info/evince-common.list (Bad message)
E: Sub-process /usr/bin/dpkg returned an error code (2)
fov@marvel-fov-7:~$ sudo apt install --reinstall evince-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 362 not to upgrade.
Need to get 0 B/129 kB of archives.
After this operation, 0 B of additional disk space will be used.
debconf: Delaying package configuration, since apt-utils is not installed.
dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'evince-common': cannot open /var/lib/dpkg/info/evince-common.list (Bad message)
E: Sub-process /usr/bin/dpkg returned an error code (2)

I have no idea how you got into this. It’s not even related to Jetson at all.
You should just re-flash the device.

Unfortunately our device is deployed remotely in a different country, so reflashing it isn’t an option. We are operating it via tailscale. And it’s not easily accessible (it’s installed in a very hard to get to area).

Do any other potential solutions come to mind?

NO.
As I said, I don’t think this is related to Jetson at all.

That doesn’t seem very helpful.

Where can I find help if not? Surely there must be some paths to a solution

Or are there any other Nvidia Moderators more who knows more about this sort of Linux based issue if this isn’t your expertise?

You should get more information on the Ubuntu forum.

Ok thanks, will copy it over to there.

But while here, is there any other mods who might have some relevant knowledge on this?

Frankly it’s quite a critical blocking issue for our startup. We don’t have a way of physically accessing the device, which is a critical component of infrastructure.

Any help would be greatly appreciated!

At least tell us how you bumped into this…
You must have messed up something with the repository.
I don’t even know what this evince-common is.

We only handle issues about debian packages that are released by NVIDIA.

Update: I thought I had ssh’d into the same device, but these are errors from a different device actually

I was trying to install PyTorch, but pressed CTRL+C during installation I believe.

Here are more updated logs matching the commands from above:

Running sudo apt install [package] we get:

fov@marvel-fov-5:/var/cache/apt/archives$ sudo apt install curl -y
[sudo] password for fov: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version (7.68.0-1ubuntu2.22).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
 libperl5.30 : Depends: perl-modules-5.30 (>= 5.30.0-9ubuntu0.5) but it is not going to be installed
 perl : Depends: perl-modules-5.30 (>= 5.30.0-9ubuntu0.5) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Trying to reinstall dpkg we get:

fov@marvel-fov-5:~/Desktop$ sudo apt-get install --reinstall dpkg
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.
 libperl5.30 : Depends: perl-modules-5.30 (>= 5.30.0-9ubuntu0.5) but it is not going to be installed
 perl : Depends: perl-modules-5.30 (>= 5.30.0-9ubuntu0.5) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Running sudo apt --fix-broken install we get:

fov@marvel-fov-5:~/Desktop$ 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:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dctrl-tools dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common
  libdebian-installer4 libtimezonemap-data libtimezonemap1 os-prober python3-icu python3-pam rdate tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  perl-modules-5.30
The following NEW packages will be installed
  perl-modules-5.30
0 to upgrade, 1 to newly install, 0 to remove and 246 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/2,739 kB of archives.
After this operation, 17.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: Delaying package configuration, since apt-utils is not installed.
(Reading database ... 157741 files and directories currently installed.)
Preparing to unpack .../perl-modules-5.30_5.30.0-9ubuntu0.5_all.deb ...
Unpacking perl-modules-5.30 (5.30.0-9ubuntu0.5) ...
dpkg: error processing archive /var/cache/apt/archives/perl-modules-5.30_5.30.0-9ubuntu0.5_all.deb (--unpack):
 unable to stat './usr/share/perl/5.30.0/ExtUtils/Typemaps/Type.pm' (which I was about to install): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/perl-modules-5.30_5.30.0-9ubuntu0.5_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

And some more info:

fov@marvel-fov-5:~/Desktop$ sudo apt clean
fov@marvel-fov-5:~/Desktop$ sudo apt install perl-modules-5.30 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dctrl-tools dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common
  libdebian-installer4 libtimezonemap-data libtimezonemap1 os-prober python3-icu python3-pam rdate tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed
  perl-modules-5.30
0 to upgrade, 1 to newly install, 0 to remove and 246 not to upgrade.
2 not fully installed or removed.
Need to get 2,739 kB of archives.
After this operation, 17.6 MB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 perl-modules-5.30 all 5.30.0-9ubuntu0.5 [2,739 kB]
Fetched 2,739 kB in 13s (206 kB/s)                                                                                                                       
debconf: Delaying package configuration, since apt-utils is not installed.
(Reading database ... 157741 files and directories currently installed.)
Preparing to unpack .../perl-modules-5.30_5.30.0-9ubuntu0.5_all.deb ...
Unpacking perl-modules-5.30 (5.30.0-9ubuntu0.5) ...
dpkg: error processing archive /var/cache/apt/archives/perl-modules-5.30_5.30.0-9ubuntu0.5_all.deb (--unpack):
 unable to stat './usr/share/perl/5.30.0/ExtUtils/Typemaps/Type.pm' (which I was about to install): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/perl-modules-5.30_5.30.0-9ubuntu0.5_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems to be stuck in a bit of a catch 22 where it says I need to install a newer version of perl-modules-5.30, however it won’t let me install it…

If even this command is unable to fix it, then you should really consider re-flashing your device.

This is very dangerous especially when you install a package with lots of dependencies.
Don’t ever do it again.

Or maybe stuff like this:

As I mentioned, we are unfortunately unable to reflash either device as they are deployed remotely.

Did you get any update on Ubuntu forum?

No but a friend who’s a linux expert was able to help patch a fix. Mv the erring directory to backup (i.e. .bck) and then proceed as normal

Can be closed, thanks