How to fix dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/updates/ in APT

APTBEGINNERMEDIUMUpdated Dec 29, 2025ยท 139 views

This error occurs when using the gdebi-gtk GUI to install .deb packages on Ubuntu. The issue is caused by a bug in how gdebi-gtk handles file descriptors passed to dpkg. Switching to command-line installation methods resolves the problem immediately.

Quick fix

Fixes dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/updates/

sudo dpkg -i /path/to/package.deb
  1. Use dpkg from the command line instead of gdebi-gtk
  2. Update your system to get the latest gdebi fixes
  3. Verify the /var/lib/dpkg/updates directory is clean
apt โ€” error
sudo dpkg -i /path/to/package.deb
dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/updates/

What this error means

The "unable to read filedescriptor flags" error indicates that dpkg cannot access a file descriptor used for managing package status and installation progress. This happens because gdebi-gtk does not properly inherit or configure file descriptors when spawning the dpkg process. The error message typically includes a path to /var/lib/dpkg/updates/, which is where dpkg stores temporary installation state. The underlying cause is that in Python 3.4+, file descriptors are not inherited by child processes by default, and gdebi-gtk did not use os.set_inheritable() to work around this limitation.

Typical symptoms

  • Installation fails when using gdebi-gtk to install .deb packages
  • Error message appears in the gdebi-gtk window during package installation
  • The same .deb package installs successfully using command-line tools (dpkg or gdebi)
  • Error includes "Bad file descriptor" message

Common causes

  1. gdebi-gtk does not properly handle file descriptor inheritance when spawning dpkg processes
  2. Python 3.4+ changed default file descriptor inheritance behavior, breaking gdebi-gtk compatibility
  3. The VTE library patch that previously worked around this issue (91_keep_fds.patch) was dropped in some Ubuntu versions
  4. Older versions of gdebi and gdebi-gtk lack the fix needed for newer Python and system libraries

How to fix "dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/updates/"

1Use dpkg from the command line instead of gdebi-gtk

The most reliable immediate fix is to avoid the gdebi-gtk GUI entirely. Open a terminal and install your .deb package directly:

bash
sudo dpkg -i /path/to/package.deb

If there are dependency issues, use apt to resolve them after:

bash
sudo apt install -f

Alternatively, you can also use gdebi from the command line, which works without this bug:

bash
sudo gdebi /path/to/package.deb
2Update your system to get the latest gdebi fixes

Ubuntu has released fixes for gdebi and gdebi-gtk that address this file descriptor handling issue. Update your system to install the patched version:

bash
sudo apt update
sudo apt upgrade

If gdebi or gdebi-gtk is not installed, you can install it:

bash
sudo apt install gdebi

After updating, try using gdebi-gtk again to see if the issue is resolved.

3Verify the /var/lib/dpkg/updates directory is clean

The /var/lib/dpkg/updates/ directory should be empty when no dpkg operations are running. If it contains leftover files from a failed installation, clean it up:

bash
sudo rm -f /var/lib/dpkg/updates/*

Then attempt your installation again. This ensures dpkg starts fresh without corrupted state from previous attempts.

Advanced notes

This bug has been tracked in Ubuntu as Bug #1756238 (Ubuntu 18.04) and Bug #1946499 (Ubuntu 21.10+). The root cause is in the interaction between gdebi-gtk, Python 3.4+, and the VTE library. The gdebi project has patched this issue upstream, but the fix requires updating to a newer version of gdebi/gdebi-gtk. If you are on a very old Ubuntu release, the patch may not be available, making command-line installation the permanent workaround. For developers maintaining packages, note that gdebi-gtk is optional for package installation; dpkg and apt are the standard tools.

Frequently asked questions

What does "dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/upd" mean?
The "unable to read filedescriptor flags" error indicates that dpkg cannot access a file descriptor used for managing package status and installation progress. This happens because gdebi-gtk does not properly inherit or configure file descriptors when spawning the dpkg process. The error message typically includes a path to /var/lib/dpkg/updates/, which is where dpkg stores temporary installation state.
How do I fix "dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/upd"?
This error occurs when using the gdebi-gtk GUI to install .deb packages on Ubuntu. The issue is caused by a bug in how gdebi-gtk handles file descriptors passed to dpkg. Switching to command-line installation methods resolves the problem immediately.
What causes "dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/upd"?
gdebi-gtk does not properly handle file descriptor inheritance when spawning dpkg processes Python 3.4+ changed default file descriptor inheritance behavior, breaking gdebi-gtk compatibility The VTE library patch that previously worked around this issue (91_keep_fds.patch) was dropped in some Ubuntu versions
Is the "dpkg: error: unable to read filedescriptor flags for /var/lib/dpkg/upd" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading