Dnf install confirmation default choice change

please make default installation enter key behaviour to Y, instead of N, i think installation is safe process comapared to removal and it better to just click enter key, instead of have to type y many times.

my idea is: for installation Y is default and for removal N is default so user not delete accidentally

Not necessarily. The post-install scripts of a package could perform irreversible actions, so you can’t rely on being able to safely roll back an install action.

If you want to change the default on your own system, you can do so by modifying /etc/dnf/dnf.conf and adding a line:

defaultyes=True

(Source: this post)

2 Likes

Some other ways to do the same thing
sudo dnf config-manager setopt defaultyes=True
or
sudo dnf config-manager setopt defaultyes=1

Accomplishes the same thing.

It can be unset with
sudo dnf config-manager unsetopt defaultyes

2 Likes

You will have file this as an issue or RFE in the upstream dnf5 repo so devs can discuss it.

I personally wouldn’t like to have different defaults for update/install/removal of packages.