Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 780  / 1 Year ago, sat, april 22, 2023, 5:59:17

OS: Ubuntu Server 22.04


Friend has been setting up a server and he does not need snap so he wanted to remove it, but once he tried removing it it showed ubuntu-server-minimal as a dependency.


user@server:~$ sudo apt remove snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
squashfs-tools
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
snapd ubuntu-server-minimal
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 89.6 MB disk space will be freed.
Do you want to continue? [Y/n]

Is there a way to NOT remove the meta package? And if he successfully removes snapd without the meta package will it be re-added when the meta package upgrades (if that's a thing)? (Will blocking it from apt (like linux mint does) fix that?)


More From » apt

 Answers
4

A meta package is a "shopping list" that has a number of packages as dependencies, so it allows to install a certain configuration, e.g. minimal server, ubuntu desktop, etc., by installing a single package. A package can only remain on the system if all its dependencies are on the system. For ubuntu-server-minimal, snapd is a hard depencency, in contrast to the meta packages for the desktop, where snapd is a recommended package, not a dependency.


Remove one of dependencies will remove the metapackage: that is how the APT system is defined by its core. You only remove the metapackage - you will not remove other dependencies or recommended packages that were installed with that metapackage. Since these dependencies or recommended packages are are marked as "manually installed", they also will not be removed by a sudo apt autoremove after the metapackage is removed.



Is there a way to NOT remove the meta package?



No, because snapd is a dependency. One would need to build a custom metapackage, that does not contain that specific dependency for having an equivalent metapackage without snapd. IF snapd were a recommended package, you could remove it without removing the metapackage.



And if he successfully removes snapd without the meta package will it be re-added when the meta package upgrades (if that's a thing)? (Will blocking it from apt (like linux mint does) fix that?)



As explained, this can/will not happen with the ubuntu-server-minimal package. It will be removed. If snapd installation is blocked, you will not be able to reinstall ubuntu-server-minimal: there will be an error because one of the dependencies cannot be installed.


[#370] Monday, April 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uccase

Total Points: 473
Total Questions: 100
Total Answers: 110

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
uccase questions
;