Pamac install command defaults to cancel transaction

when trying to install something using pamac for an example lets say flameshot
it asks which dependencies i want to install and then asks for my user password.

And then it asks if i want to apply transaction and the default is No why?

Apply transaction ? [y/N] 

Because asking for your explicit consent before installing anything is safer.

It prevents you from inadvertently installing something that you do not want. You have to consciously look at what’s being offered and confirm that you do, indeed, want to install it.

8 Likes

If it is an AUR package then what you are saying would make sense but for repo packages there are no safety issues right?

I find it a little annoying that it asks me for another input when the command i gave is install.
Even pacman defaults to Yes.

Not with the packages themselves, no. But that biological unit between the keyboard and the chair is known to exhibit a few bugs from time to time. And that’s what it’s about.

4 Likes
1 Like

Thanks .I looked for something like this on gitlab but couldnt find it

You can use the --no-confirm flag to bypass confirmation messages in both pacman and pamac.

If you want to skip the question you can use --no-confirm

That’s a lot of typing to do everytime :frowning_face:

It shouldn’t be easy as it’s potentially dangerous (and will lead to desaster eventually). That what was meant by the “safe default” answers you were given.
Idiots People complaining about typing could define some alias or script a function…

Found this (should work for pamac too):

yes | sudo pacman -S firefox

May be the Team means that AUR package installation is not safe actions.
Then may be to do updating, installing repo packages, updating AUR packages could be with [Y/n], but installing a new AUR packages could be with [y/N]?

1 Like

This all sounds good in theory.

I guarantee you, however, that if it’s done, there’ll be someone, possibly multiple someones, complaining about the difference. The lack of uniformity. Because, people complain. That’s what they do. Users even more so…

1 Like

Can you explain what a possible disaster would be?

Definately not me :laughing:

Would surely do so

I think an editable text configuration file would be helpful to edit the default value.
I wouldn’t like someone else blocking me saying it is for my safety i would rather face the issues at least in this situation.

Unwanted package replacements and/or removals, possibly with all depending packages.
This could be as worse as uninstalling essential parts of the DE, audio system (pulse or pipewire) or proprietary graphics drivers leading to potentially unusable and/or unbootable system.

1 Like

To see if you can install the program from the AUR using the GUI version of Pamac (Add/Remove Software), you must first enable AUR support in its settings.

@Aragorn has made a bash script/function that enables you to use -y as a command-line argument that removes the need to answer every time, AFAIK.

1 Like

Indeed, I have. The following is to be added to one’s ~/.bashrc if one uses bash as one’s shell. :arrow_down:

pamac ()
{
  case $1 in
     "install" | "reinstall" | "remove" )
         if [ "$2" == "-y" ]
         then 
             action="$1 --no-confirm"
             shift 2
         fi
         ;;
  esac
  command pamac "${action}" "$@"
  [[ "${action}" ]] && unset action
}
export pamac

It won’t work with zsh because of the different way zsh handles functions.

1 Like

I’m thinking, yes it hurts, this will work for update and/or upgrade as well with only a little modification:

pamac ()
{
  case $1 in
     "install" | "reinstall" | "remove" | "update" | "upgrade" )
         if [ "$2" == "-y" ]
         then 
             action="$1 --no-confirm"
             shift 2
         fi
         ;;
  esac
  command pamac "${action}" "$@"
  [[ "${action}" ]] && unset action
}
export pamac

But that case is getting a bit long, so I don’t know how efficient this is.

:man_shrugging:

Wouldn’t something like this work in zsh?

aliasname() {
pamac install $1 --no-confirm
}

I don’t use zsh so someone can correct if it doesn’t work. I believe you would then just have to type in
aliasname package-name