Score:0

What are the possible consequences of removing the udisks2 package from an Ubuntu server?

in flag

What are the possible consequences of removing the package udisks2 from an Ubuntu server?

To me, this is safe as long as you do not need any particular mount-point, for example relying on GUI (involving D-bus) or encrypted filesystems with LUKS.

https://www.freedesktop.org/wiki/Software/udisks/

https://github.com/storaged-project/udisks

Simulation:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libatasmart4 libblockdev-crypto2 libblockdev-fs2 libblockdev-loop2 libblockdev-part-err2 libblockdev-part2 libblockdev-swap2 libblockdev-utils2 libblockdev2
  libnl-route-3-200 libparted-fs-resize0 libudisks2-0 libvolume-key1
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  udisks2
0 upgraded, 0 newly installed, 1 to remove and 88 not upgraded.
After this operation, 1204 kB disk space will be freed.
Do you want to continue? [Y/n]

Package info:

Package: udisks2
Version: 2.9.4-1ubuntu2
Priority: optional
Section: admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Utopia Maintenance Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1204 kB
Depends: dbus, libblockdev-fs2, libblockdev-loop2, libblockdev-part2, libblockdev-swap2, parted, udev, libacl1 (>= 2.2.23), libatasmart4 (>= 0.13), libblockdev-utils2 (>= 2.24), libblockdev2 (>= 2.25), libc6 (>= 2.34), libglib2.0-0 (>= 2.50), libgudev-1.0-0 (>= 165), libmount1 (>= 2.30), libpolkit-agent-1-0 (>= 0.102), libpolkit-gobject-1-0 (>= 0.102), libsystemd0 (>= 209), libudisks2-0 (>= 2.9.0), libuuid1 (>= 2.16)
Recommends: dosfstools, e2fsprogs, eject, libblockdev-crypto2, ntfs-3g, policykit-1, libpam-systemd
Suggests: btrfs-progs, f2fs-tools, libblockdev-mdraid2, mdadm, nilfs-tools, reiserfsprogs, udftools, udisks2-bcache, udisks2-btrfs, udisks2-lvm2, udisks2-zram, xfsprogs, exfatprogs
Homepage: https://www.freedesktop.org/wiki/Software/udisks
Task: ubuntu-desktop-minimal, ubuntu-desktop, cloud-image, ubuntu-desktop-raspi, server, ubuntu-server-raspi, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi
Download-Size: 285 kB
APT-Manual-Installed: no
APT-Sources: http://it.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
Description: D-Bus service to access and manipulate storage devices
 The udisks daemon serves as an interface to system block devices,
 implemented via D-Bus. It handles operations such as querying, mounting,
 unmounting, formatting, or detaching storage devices such as hard disks
 or USB thumb drives.
 .
 This package also provides the udisksctl utility, which can be used to
 trigger these operations from the command line (if permitted by
 PolicyKit).
 .
 Creating or modifying file systems such as XFS, RAID, or LUKS encryption
 requires that the corresponding mkfs.* and admin tools are installed, such as
 dosfstools for VFAT, xfsprogs for XFS, or cryptsetup for LUKS.

There are some good reasons to try to do that. For example, to reduce the entropy from an ITSec perspective. But also to save some KB of RAM. I have no particular use-case for this need, this is just my curiosity in Ubuntu. Usually I work in minimal Debian servers and I don't see that daemon running there.

I ask this, since I'm curious about the possible consequences. Also because sometime it's not possible to create a virtual machine to test this kind of things, especially if you are working on a legacy bare metal.

Thanks for your thoughts about this Ubuntu package.

in flag
I hope this question is in topic since I usually find a lot of "Can you remove xxxx" questions in AskUbuntu and I find them very useful. Not just for server hardening, but also for a KISS principle and to know your environment.
in flag
I'm welcomed with a -1 without any comment to improve this question :(
muru avatar
us flag
Why don't you try it and see? It's not too hard to setup a VM
in flag
Thanks muru. Clarified with: I ask this, since I'm curious about the possible consequences. Also because sometime it's not possible to create a virtual machine to test this kind of things, especially if you are working on a legacy bare metal.
muru avatar
us flag
I don't see how the actual system being bare metal shouldn prevent you from trying a VM. Unless you have some particular form of breakage in mind.
in flag
Sometime it's common to have legacy Ubuntus serving a legacy project. Having more awareness about what a package provides is useful. I don't know if there is some particular use-case that I should be aware. A blank new Ubuntu installation would not probably answer this with a reasonable margin of topic coverage.
muru avatar
us flag
Udisks is far from legacy, it's old yes, but not legacy. Ok, let's say I say that you can remove this. That I had a system running for a while with udisks disabled/removed that had no problems. Will that be a satisfactory answer?
Raffa avatar
jp flag
@muru On the contrary from an Ubuntu 22.04 desktop system, `apt-cache rdepends -i --installed udisks2` on an Ubuntu 22.04 server should return no packages depending on `udisks2` ... So, yes, I guess that should be a satisfactory or at least a very informative answer IMHO :-)
muru avatar
us flag
@Raffa it's not a necessity, but it is useful for desktop systems to handle mounting, say, an USB drive without forcing the user to authenticate administrative access. On servers, I've occasionally found udisksctl useful when I can't be arsed to use `mount`. It's not too hard to imagine somebody writing scripts using it, as the dbus interface is good for programmatic access. The package didn't install itself just for the sake of being there ;-)
in flag
Just to clarify that - in general - it's the company environment built over an Ubuntu distribution that can be "legacy" and I wanted to intend that - my intention was not to indicate the package itself as legacy. That is why knowing the features of this package can help in understanding what *might* have been used by other coworkers / legacy projects, and so what could explode in an Ubuntu system when this dependency does not provide anymore its features. You already provided very useful answers. Feel free to propose as answer.
in flag
Hoping to be useful I tried to clarify the background with a longer question title, in order to avoid confusion about "Can you remove xxx?". But feel free to say that it's a bad idea :( also feel free to edit.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.