Score:0

Why does apt allow removal of a package that is a dependency of another package?

in flag

On Ubuntu Server 22 minimal, I install xinit:

sudo apt install xinit

and in the process apt auto-installs several other packages.

Let's take libjavascriptcoregtk-4.0-18 as an example. It gets auto-installed when I run the command above.

But if I purge the dependency:

sudo apt purge libjavascriptcoregtk-4.0-18

apt allows me to do so.

Why?

Is xinit dependent on libjavascriptcoregtk-4.0-18 or not?

If it's not, then why does apt auto-install libjavascriptcoregtk-4.0-18 when I install xinit?

It it is, then why does apt allow me to purge libjavascriptcoregtk-4.0-18?

Score:0
in flag

Try the --no-install-recommends option:

sudo apt install --no-install-recommends xinit
Score:0
gr flag

when you install a package in Linux, it will automatically install other packages as almost all app packages in Linux are interdependent. But not all these packages are direct dependent, dependencies can be direct dependent or recommended. direct dependent means the app you installs rely on these package to function. Recommended means that these packages are not required directly for the app to function, but it will give you extra functionality or better integration with your system. you can check these info by using the command

sudo apt show <package-name>

you can also use the following command for more details about the package dependencies

sudo apt depends <package-name>
I sit in a Tesla and translated this thread with Ai:

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.