Installing libudev1 on a new Jammy installation uninstalls many packages.

Bug #1974196 reported by nuclearsandwich
This bug affects 8 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Julian Andres Klode
Fix Released
Fix Released
Julian Andres Klode

Bug Description

On an Ubuntu 22.04 desktop system created using the current installation image without enabling package updates over the network, installing the package libudev1 results in a large number of critical packages being removed and rendering the system essentially unusable.

[Test plan]
Comprehensive regression test suite validating a full solver dump with the issue is run as autopkgtest.

[Where problems could occur]
We could break other things from resolving. The solver is a bit finicky. Hopefully this is isolated enough.

[Other info] is a Dockerfile which also demonstrates the issue.
Building the image, which will install udev 249.11-0ubuntu3 and init 1.62, and then running `apt install libudev1` in the generated image results in

The following packages will be REMOVED:
  libnss-systemd libpam-systemd systemd-timesyncd udev
The following packages will be upgraded:

This is completely prevented by ensuring that updates are installed from the jammy-updates repository before installing any additional packages and that is almost certainly the correct thing to do. But this is a punishing result for such a mistake.

I would expect the installation to either force the upgrade of the other systemd packages or refuse to install libudev1 at the incorrect version relative to the other systemd packages until the system is upgraded.

We found this out via a user report for ROS 2 Humble which is releasing on top of Ubuntu 22.04 next week:

tags: added: fr-2401
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Tully (tully.foote) wrote :

Not that the above short list of uninstalled packages is in the minimal example that I compiled to isolate the smallest footprint possible. Those packages are requirements for `ubuntu-standard` and on a standard system will remove most of `ubuntu-desktop` leaving the computer effectively nonoperational with systemd and all it's dependencies removed.

Revision history for this message
Jochen Sprickerhof (v-launchpad-jochen-sprickerhof-de) wrote :

Hi Tully,

in your minimal example libudev1 is already installed in the system (util-linux : PreDepends: libudev1 and util-linux is essential). On the other end, libnss-systemd, libpam-systemd, systemd-timesyncd and udev are not essential (you can get the list with apt list '~E', note that this does neither include systemd nor the kernel nor ubuntu-desktop because the system could be a container). With this, the apt install libudev1 action is the documented behavior (though maybe not intuitive):

           This is also the target to use if you want to upgrade one or more already-installed
           packages without upgrading every package you have on your system. Unlike the "upgrade"
           target, which installs the newest version of all currently installed packages,
           "install" will install the newest version of only the package(s) specified.

I.e. apt will try to fulfill the request to install the newest libudev1 without upgrading other packages and as this conflicts with other, non essential, packages it will remove those.

You can avoid this with apt install --trivial-only libudev1 or apt install --no-remove libudev1.

I was not able to reproduce the problem in ros2#1272 because of the added Conflicts: in ros-humble-ros-workspace (

Note that the Conflicts: libsystemd0 (<= 249.11-0ubuntu3), libudev1 (<= 249.11-0ubuntu3) are not really correct. The manual does not require jammy-updates so installing on a system without it is broken now. You probably want to add jammy-updates to the manual if the ROS build farm includes them. Also they are rather temporary because any future updates of src:systemd in jammy-updates could result in the same problem.

I would recommend to move the apt update && apt upgrade to the begin of your manual and after adding additional apt sources.

Revision history for this message
Tully (tully.foote) wrote :
Download full text (9.9 KiB)

I completely understand that moving the apt-get update && apt upgrade to the beginning of the manual would be better. The problem is that this can completely destroy an ubuntu system installation if done without following that best practice. We had user reports which is why we have made sure with the conflicts to not cause this.

The above reproduction is focused on isolating the minimum set. You can reproduce it with a larger system using one of the older tags

docker run -ti --rm tfoote/udevdebug:1 bash -c 'apt-get update && apt-get install libudev1'

And you'll get it removing a large fraction of essential ubuntu and make your system unusable.

docker run -ti --rm tfoote/udevdebug:1 bash -c 'apt-get update && apt-get install libudev1'
Get:1 jammy-security InRelease [110 kB]
Hit:2 jammy InRelease
Get:3 jammy-updates InRelease [109 kB]
Get:4 jammy-security/main amd64 Packages [198 kB]
Get:5 jammy-security/main amd64 DEP-11 Metadata [12.7 kB]
Get:6 jammy-security/main DEP-11 48x48 Icons [5952 B]
Get:7 jammy-security/main DEP-11 64x64 Icons [8219 B]
Get:8 jammy-security/main amd64 c-n-f Metadata [2600 B]
Get:9 jammy-security/restricted amd64 Packages [188 kB]
Get:10 jammy-security/restricted amd64 c-n-f Metadata [464 B]
Get:11 jammy-security/universe amd64 Packages [81.0 kB]
Get:12 jammy-security/universe amd64 c-n-f Metadata [1076 B]
Get:13 jammy-security/multiverse amd64 c-n-f Metadata [228 B]
Get:14 jammy-backports InRelease [99.8 kB]
Get:15 jammy/main amd64 c-n-f Metadata [30.3 kB]
Get:16 jammy/restricted amd64 c-n-f Metadata [488 B]
Get:17 jammy/universe amd64 c-n-f Metadata [286 kB]
Get:18 jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:19 jammy-updates/main amd64 Packages [348 kB]
Get:20 jammy-updates/main amd64 DEP-11 Metadata [91.0 kB]
Get:21 jammy-updates/main DEP-11 48x48 Icons [25.0 kB]
Get:22 jammy-updates/main DEP-11 64x64 Icons [37.1 kB]
Get:23 jammy-updates/main DEP-11 64x64@2 Icons [29 B]
Get:24 jammy-updates/main amd64 c-n-f Metadata [4840 B]
Get:25 jammy-updates/restricted amd64 Packages [209 kB]
Get:26 jammy-updates/restricted amd64 c-n-f Metadata [460 B]
Get:27 jammy-up...

Revision history for this message
user781291271852187 (user781291271852187) wrote (last edit ):

Hello everyone,

I also encountered this bug yesterday during an update procedure of my packages (sudo apt update && sudo apt full-upgrade -y) on my VPS running Ubuntu Server 22.04, removing almost all the dependencies of the "ubuntu-server" package as well as of systemd.

Here is the list of packages that could be removed during the libudev1 update:
cloud-initramfs-dyn-netconf initramfs-tools-core udev open-iscsi packagekit-tools dbus-user-session modemmanager libtss2-tcti-cmd0 systemd-timesyncd polkitd libpam-systemd libtss2-tcti-device0 libtss2-tcti-swtpm0 software-properties-common udisks2 libnss- systemd plymouth-theme-ubuntu-text libtss2-mu0 overlayroot packagekit flash-kernel cloud-init sg3-utils-udev plymouth mdadm friendly-recovery cryptsetup-initramfs snapd libtss2-tcti-mssim0 multipath-tools libtss2-sys1 ubuntu-standard pkexec initramfs-tools ubuntu-server tpm-udev libtss2-esys-3.0.2-0 cloud-initramfs-copymods kpartx policykit-1 fwupd ubuntu-minimal libpolkit-agent-1-0 u-boot-tools libfdt1 libmm-glib0 libqmi-proxy libblockdev-part2 libglib2. 0-bin libblockdev-swap2 libunwind8 libgusb2 libmbim-glib4 usb-modeswitch-data libubootenv-tool device-tree-compiler libarchive13 libxmlb2 tcl sg3-utils libgcab-1.0-0 libfwupd2 initramfs-tools-bin libblockdev-fs2 libtcl8. 6 libatasmart4 python3-software-properties squashfs-tools gir1.2-packagekitglib-1.0 libgpgme11 libstemmer0d libappstream4 libvolume-key1 libgudev-1.0-0 libsgutils2-2 libjson-glib-1. 0-common libudisks2-0 klibc-utils fwupd-signed libblockdev-loop2 libblockdev2 libblockdev-part-err2 libklibc usb-modeswitch libmbim-proxy busybox-initramfs libnss3 libblockdev-utils2 libpolkit-gobject-1-0 devio tcl8.6 bolt libpackagekit-glib2-18 finalrd libopeniscsiusr libgstreamer1. 0-0 libftdi1-2 libqmi-glib5 cryptsetup libjson-glib-1.0-0 libubootenv0.1 libparted-fs-resize0 mtd-utils libisns0 libflashrom1 libjcat1 libdw1 libfwupdplugin5 libplymouth5 libiniparser1 libblockdev-crypto2 libnetplan0 liburcu8 libnspr4. (You can find in attachment the apt logs associated to this update).

Revision history for this message
Julian Andres Klode (juliank) wrote :
affects: systemd (Ubuntu) → apt (Ubuntu)
Changed in apt (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Julian Andres Klode (juliank)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu Jammy):
status: New → Confirmed
Changed in apt (Ubuntu Jammy):
status: Confirmed → In Progress
description: updated
Changed in apt (Ubuntu Jammy):
milestone: none → ubuntu-22.04.1
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello nuclearsandwich, or anyone else affected,

Accepted apt into jammy-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in apt (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
vishnunaini (visred) wrote (last edit ):
Download full text (6.7 KiB)

We have tested the proposed patched version 2.4.7 against the current release version 2.4.5 posted at the above launchpad link via bug reproduction and general package installation process via standard cli and via python bindings and have no adverse observations.

We have also tested against a package we built from the accepted source and the upstream source

Test environment:
root@test100:/home/sre# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy

Test Cases for both versions 2.4.5 and 2.4.7:
1. Manual APT Bash CLI
2. SaltStack 3004.2 via APT Python bindings

Current release version 2.4.5:

root@test100:/home/user# apt --version
apt 2.4.5 (amd64)
root@test100:/home/user# dpkg -l | grep apt
ii apt 2.4.5 amd64 commandline package manager
ii apt-utils 2.4.5 amd64 package management related utility programs
ii libapt-pkg6.0:amd64 2.4.5 amd64 package management runtime library
ii libpcap0.8:amd64 1.10.1-4build1 amd64 system interface for user-level packet capture
ii python-apt-common 2.3.0ubuntu2 all Python interface to libapt-pkg (locales)
ii python3-apt 2.3.0ubuntu2 amd64 Python 3 interface to libapt-pkg

root@test100:/home/user# apt install libudev1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  busybox-initramfs cryptsetup finalrd gir1.2-packagekitglib-1.0 initramfs-tools-bin klibc-utils libappstream4 libdw1 libglib2.0-bin libgstreamer1.0-0 libisns0 libklibc libnetplan0 libopeniscsiusr libpackagekit-glib2-18 libplymouth5
  libpolkit-agent-1-0 libpolkit-gobject-1-0 libsgutils2-2 libstemmer0d liburcu8 libxmlb2 python3-software-properties sg3-utils
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
The following packages will be REMOVED:
  cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf cryptsetup-initramfs dbus-user-session friendly-recovery initramfs-tools initramfs-tools-core kpartx libnss-systemd libpam-systemd mdadm multipath-tools open-iscsi
  overlayroot packagekit packagekit-tools pkexec plymouth plymouth-theme-ubuntu-text policykit-1 polkitd sg3-utils-udev software-properties-common ubuntu-minimal ubuntu-server ubuntu-standard udev
The following packages will be upgraded:
  libnetplan0 libudev1
2 upgraded, 0 newly installed, 29 to remove and 35 not upgraded.
Need to get 166 kB of archives.
After this operation, 22.4 MB disk space will be freed.
Do you want to continue? [Y/n]

Proposed release version 2.4.7:
root@test101:/home/user/apt# apt install ./apt_2.4.7_amd64.deb ./libapt-pkg6.0_2.4.7_amd64.deb ./apt-utils_2.4.7_amd64.deb

root@test101:/home/user/apt# apt --versi...


tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Julian Andres Klode (juliank) wrote :

Please note that this is not the test plan documented in the bug. But glad this worked for you, I was not sure it was still reproducible, hence why there's a solver dump based test case in the regression test suite.

But your test is valid too, the test suite still needs to pass, but failure to pass would block SRU either way, so I'll keep the tags as done.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.5.2

apt (2.5.2) unstable; urgency=medium

  [ Julian Andres Klode ]
  * Mark broken reverse depends for upgrade (LP: #1974196)
  * Upgrade all binaries in a source package

  [ Michael Vogt ]
  * apt-pkg: (re)export pkgTagSection::Key to fix FTBFS in python-apt
    (Closes: #1011678)

 -- Julian Andres Klode <email address hidden> Sun, 24 Jul 2022 17:57:24 +0200

Changed in apt (Ubuntu Kinetic):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 2.4.7

apt (2.4.7) jammy; urgency=medium

  * Mark broken reverse depends for upgrade (LP: #1974196)

 -- Julian Andres Klode <email address hidden> Thu, 28 Jul 2022 09:26:24 +0200

Changed in apt (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for apt has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
bamwu (bamwu) wrote (last edit ):

Glad this got fixed. Just looked at the diff. Seems like it should work as advertised. What about those of use who got leveled by this bug? Is there a recommended way to get a 1974196-horked installation working again without a full reinstall? ... keeping in mind that networking is somehow screwed up too, so even though I can log in (sans-gui) and see all of my files, I can't run apt or download anything with curl.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Adding a focal task as bug 1973830 seems to be caused by the same issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.