1

When I try to yum remove texlive it lists all the packages it will remove as dependencies 'only to texlive', but for example gcc is listed. But I want to leave it in the system. Can I somehow specify packages to leave? I tried the hint from Yum autoremove removing packages that are standalone of yum install gcc to 'fix it as user-installed', but this works only when the package is installed as standalone BEFORE it is installed as a dependency.

Does anyone has a solution to this?

1 Answer 1

2

On a dnf-managed system, run dnf mark install gcc as root to mark gcc as user-installed. Run dnf mark remove gcc as root to mark gcc as installed merely to satisfy other packages’ dependencies.

On a yum-managed system, run yumdb set reason user gcc as root to mark gcc as user-installed. Run yumdb set reason dep gcc as root to mark gcc as installed merely to satisfy other packages’ dependencies.

(Giving credit where credit is due, I learned the yum answer from David Haller’s answer to an equivalent question on Server Fault and a blog post by Christopher Smart, both of which led me to the yumdb man page discussion of the reason key. For dnf, Havner’s comment in a RedHat Bugzilla bug report led me to the dnf man page discussion of dnf mark.)

1
  • 1
    On amazonlinux 2 I get bash: yumdb: command not found so had to do the (non-obvious) yum install yum-utils first
    – sparrowt
    Commented May 24, 2023 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .