apt upgrade exits with error: package pkgname contains empty filename

Written by - 0 comments

Published on - Listed in Linux


A Debian Jessie server couldn't run apt-get upgrade anymore and exited with the following error message:

root@debian ~ # apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  apache2 apache2-bin apache2-data apache2-mpm-event apache2-mpm-prefork [...]
131 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/57.6 MB of archives.
After this operation, 196 kB disk space will be freed.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
 files list file for package `psmisc' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)

From this error alone, it's not very clear what failed. It requires some additional knowledge about the apt package manager. Apt retrieves information about the files of a package from the /var/lib/dkpg/info directory. Inside this path there are several files for each package. For the example for psmisc:

root@debian ~ # ls /var/lib/dpkg/info/psmisc*
psmisc.list      psmisc.md5sums   psmisc.postinst  psmisc.postrm   

psmisc.list is the above mentioned "files list file" for the package psmisc. Let's check this out:

root@debian ~ # cat /var/lib/dpkg/info/psmisc.list
????d?0bi
              ?@4
                  ??
0`??D?????????????????????????????????X<X<Zb??b|?
[...]

Woah... this can't be right! So this file is definitely corrupt. I verified with another Debian Jessie installation and the file looks different, of course:

root@jessie ~ # cat /var/lib/dpkg/info/psmisc.list
/.
/usr
/usr/share
/usr/share/menu
/usr/share/menu/psmisc
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/prtstat.1.gz
/usr/share/man/man1/peekfd.1.gz
/usr/share/man/man1/pstree.1.gz
/usr/share/man/man1/killall.1.gz
/usr/share/man/man1/fuser.1.gz
/usr/share/locale
/usr/share/locale/hr
/usr/share/locale/hr/LC_MESSAGES
/usr/share/locale/hr/LC_MESSAGES/psmisc.mo
/usr/share/locale/el
/usr/share/locale/el/LC_MESSAGES
/usr/share/locale/el/LC_MESSAGES/psmisc.mo
/usr/share/locale/fr
/usr/share/locale/fr/LC_MESSAGES
/usr/share/locale/fr/LC_MESSAGES/psmisc.mo
/usr/share/locale/ca
/usr/share/locale/ca/LC_MESSAGES
/usr/share/locale/ca/LC_MESSAGES/psmisc.mo
/usr/share/locale/sv
/usr/share/locale/sv/LC_MESSAGES
/usr/share/locale/sv/LC_MESSAGES/psmisc.mo
/usr/share/locale/eo
/usr/share/locale/eo/LC_MESSAGES
/usr/share/locale/eo/LC_MESSAGES/psmisc.mo
/usr/share/locale/ja
/usr/share/locale/ja/LC_MESSAGES
/usr/share/locale/ja/LC_MESSAGES/psmisc.mo
/usr/share/locale/nb
/usr/share/locale/nb/LC_MESSAGES
/usr/share/locale/nb/LC_MESSAGES/psmisc.mo
/usr/share/locale/cs
/usr/share/locale/cs/LC_MESSAGES
/usr/share/locale/cs/LC_MESSAGES/psmisc.mo
/usr/share/locale/id
/usr/share/locale/id/LC_MESSAGES
/usr/share/locale/id/LC_MESSAGES/psmisc.mo
/usr/share/locale/zh_TW
/usr/share/locale/zh_TW/LC_MESSAGES
/usr/share/locale/zh_TW/LC_MESSAGES/psmisc.mo
/usr/share/locale/ru
/usr/share/locale/ru/LC_MESSAGES
/usr/share/locale/ru/LC_MESSAGES/psmisc.mo
/usr/share/locale/vi
/usr/share/locale/vi/LC_MESSAGES
/usr/share/locale/vi/LC_MESSAGES/psmisc.mo
/usr/share/locale/uk
/usr/share/locale/uk/LC_MESSAGES
/usr/share/locale/uk/LC_MESSAGES/psmisc.mo
/usr/share/locale/sr
/usr/share/locale/sr/LC_MESSAGES
/usr/share/locale/sr/LC_MESSAGES/psmisc.mo
/usr/share/locale/da
/usr/share/locale/da/LC_MESSAGES
/usr/share/locale/da/LC_MESSAGES/psmisc.mo
/usr/share/locale/pt
/usr/share/locale/pt/LC_MESSAGES
/usr/share/locale/pt/LC_MESSAGES/psmisc.mo
/usr/share/locale/fi
/usr/share/locale/fi/LC_MESSAGES
/usr/share/locale/fi/LC_MESSAGES/psmisc.mo
/usr/share/locale/ro
/usr/share/locale/ro/LC_MESSAGES
/usr/share/locale/ro/LC_MESSAGES/psmisc.mo
/usr/share/locale/eu
/usr/share/locale/eu/LC_MESSAGES
/usr/share/locale/eu/LC_MESSAGES/psmisc.mo
/usr/share/locale/hu
/usr/share/locale/hu/LC_MESSAGES
/usr/share/locale/hu/LC_MESSAGES/psmisc.mo
/usr/share/locale/de
/usr/share/locale/de/LC_MESSAGES
/usr/share/locale/de/LC_MESSAGES/psmisc.mo
/usr/share/locale/zh_CN
/usr/share/locale/zh_CN/LC_MESSAGES
/usr/share/locale/zh_CN/LC_MESSAGES/psmisc.mo
/usr/share/locale/pt_BR
/usr/share/locale/pt_BR/LC_MESSAGES
/usr/share/locale/pt_BR/LC_MESSAGES/psmisc.mo
/usr/share/locale/pl
/usr/share/locale/pl/LC_MESSAGES
/usr/share/locale/pl/LC_MESSAGES/psmisc.mo
/usr/share/locale/nl
/usr/share/locale/nl/LC_MESSAGES
/usr/share/locale/nl/LC_MESSAGES/psmisc.mo
/usr/share/locale/it
/usr/share/locale/it/LC_MESSAGES
/usr/share/locale/it/LC_MESSAGES/psmisc.mo
/usr/share/locale/bg
/usr/share/locale/bg/LC_MESSAGES
/usr/share/locale/bg/LC_MESSAGES/psmisc.mo
/usr/share/pixmaps
/usr/share/pixmaps/pstree16.xpm
/usr/share/pixmaps/pstree32.xpm
/usr/share/doc
/usr/share/doc/psmisc
/usr/share/doc/psmisc/README
/usr/share/doc/psmisc/README.Debian
/usr/share/doc/psmisc/changelog.Debian.gz
/usr/share/doc/psmisc/changelog.gz
/usr/share/doc/psmisc/copyright
/usr/bin
/usr/bin/pstree
/usr/bin/prtstat
/usr/bin/peekfd
/usr/bin/killall
/bin
/bin/fuser
/usr/share/man/man1/pstree.x11.1.gz
/usr/bin/pstree.x11

Once I replaced the corrupt file on host "debian" with the correct file from host "jessie", apt-get upgrade ran like a charm again.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   OpenSearch   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder