Score:0

Remove a list of manually marked packages skipping those on which a package outside of this list depends

US flag
user1652368

I've a file called installs.txt which is a list of package names one-per-line. I would like to remove as many of those packages as possible without removing any package that's not mentioned in that file.

If I do,

apt remove `cat installs.txt`

APT tells me that a bunch of other packages will be removed as well since they depend on some of the packages requested for removal.

apt autoremove will not work since all the packages in installs.txt are manually installed.

user535733 avatar
cn flag
Test removals (or dependencies) one-at-a-time instead of trying to remove the entire list at once. If your list contains packages `foo`, `bar`, and `baz`, then `apt remove foo --simulate`, then `apt remove bar --simulate`, then `apt remove baz --simulate`
user535733 avatar
cn flag
Correct. This seems like an [XY Problem](https://en.wikipedia.org/wiki/XY_problem). We don't know what problem you are trying to solve for which a list of packages seems a great solution. Unless the list is quite short, it's not a great solution. Apt is not designed for that kind of use, so your cleverness is rewarded by doing the clerical work yourself.
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.