3

How to check if a package is essential / part of base Ubuntu (v18.04.5) install?

Eg. I keep seeing Ceph and RADOS updates in my weekly software updater GUI, ie...

➜  ~ apt list --upgradable
Listing... Done
libcephfs2/bionic-updates 12.2.13-0ubuntu0.18.04.8 amd64 [upgradable from: 12.2.13-0ubuntu0.18.04.7]
librados2/bionic-updates 12.2.13-0ubuntu0.18.04.8 amd64 [upgradable from: 12.2.13-0ubuntu0.18.04.7]
ubuntu-drivers-common/bionic-updates 1:0.8.6.3~0.18.04.1 amd64 [upgradable from: 1:0.5.2.5]

I don't remember if I installed these myself as some experiment some time ago or if they are part of the base / essential Ubuntu install. If they are not part of the base install or essential "normal" Ubuntu systems, then I'd like to remove these packages. Is there any way to tell (esp. re. how to tell what else would be affected by its deletion)?

  • The libcephfs2 and librados2 packages were not installed with your Ubuntu system. You installed them later; you can remove them whenever you wish. The ubuntu-drivers-common package was part of your original install. – user535733 Aug 21 '21 at 22:13
  • 1
    I'm not actually sure what you're after; you've got an answer so I won't write one, but you've not said what ISO you used to install the system; you can easily look at .list or .manifest files to see what packages are included on a specific ISO (they're always available where the ISO is downloaded from); the .list shows what's on ISO itself, .manifest what's inside the squashfs on the ISO (what I'd look inside), though not all packages included on ISO maybe installed depending on options used to install (and hardware you have if ISO contains OEM drivers etc). I'd also use apt-cache rdepends – guiverc Aug 21 '21 at 22:39
  • 3
    Does this answer your question? Can I see why a package is installed? – muru Aug 22 '21 at 08:08
  • Library packages are typically not Essential themselves, but will be pulled in by other Essential packages. As long as they are marked "automatically installed", they will be automatically removed as soon as they become unnecessary. – Simon Richter Aug 22 '21 at 17:07

1 Answers1

13

Yes, easily: Simulate a removal and see what happens.

  • Example: apt remove libcephfs2 --simulate
    (No need for sudo since you don't really want any changes)

Read the output carefully: If the list of removals is long, and/or includes critical packages like gnome-shell or gdm or ubuntu-desktop or ubuntu-standard, or applications that you use, then you know that removing it may be more trouble than is conveniently worthwhile.


Here's an edited example of simulating the removal of ubuntu-drivers-common on a test system.

  • Note the lack of sudo and the prominent --simulate flag. Safety!
  • Note that one of the impacted packages is ubuntu-desktop. That means ubuntu-drivers-common was part of the original base install.
$ apt remove ubuntu-drivers-common --simulate
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
[...edit...]
The following packages were automatically installed and are no longer required:
  apturl-common gir1.2-goa-1.0 gir1.2-snapd-1 python3-click python3-colorama
  python3-dateutil python3-debconf python3-software-properties python3-xkit
  software-properties-common unattended-upgrades update-notifier-common
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  apturl nautilus-share software-properties-gtk ubuntu-desktop
  ubuntu-desktop-minimal ubuntu-drivers-common ubuntu-release-upgrader-gtk
  update-manager update-notifier
0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded.
[...edit...]
user535733
  • 62,253
  • How is --simulate different from --dry-run? – VHS Aug 22 '21 at 19:42
  • 2
    @VHS Consult the apt-get manpage for the difference: -s, --simulate, --just-print, --dry-run, --recon, --no-act are all synonyms. They do exactly the same thing. --simulate is uniformly used in this answer for clarity. – user535733 Aug 22 '21 at 19:54
  • @VHS It is easier for non-native English speakers to understand. – Michael Hampton Aug 23 '21 at 01:15