Pamac wants to reinstall once removed "sudo"

So just for run I removed sudo and replaced it with doas as it’s always nice to have OS that’s more “ours”. I removed sudo with pacman (pacman -Rs sudo).

I have bear package installed from AUR. There is newer version and pamac wants to upgrade it. Running pamac upgrade bear yields:

To install (1):
  sudo  1.9.8.p2-3              core                             1,6 MB
To build (1):
  bear  3.0.18-1    (3.0.17-1)  Arch users repository

I don’t want to install sudo and I didn’t ask for it. I can edit the build file but it is bear’s build file and it doesn’t mention sudo as dependency. The dependecies are: [grpc, fmt, spdlog, nlohmann-json]. Are there some implicit recursive dependencies? If so how to view them? Also upgrading with pacman -Syu doesn’t reinstall sudo, it’s only pamac thing.

Does it find sudo somewhere in cache and thinks the previous installation failed? Maybe pamac automatically installs all core packages? How can I make pamac forget about sudo and move on?

The package is bear from AUR repository and it’s pkgbuild file can be viewed there. Unfortunetely I can’t provide links, sorry. I don’t understand it and it seems silly tbh especially given the present hyperlink option in the editor.

that package (bear) is not the reason why pamac wants to install sudo
pacman -Sii sudo
or
pacman -Qii sudo
might tell you more

pacman/Rosetta - ArchWiki

1 Like

pacman -Qii sudo doesn’t find anything. Also neither pacman nor pamac find installed any of the packages that sudo lists as dependent on sudo.

Indeed.
I do not know pamac well enough to investigate
but it seems to be specific to it.

Other AUR helpers do not insist on having sudo installed.
makepkg also does not require it

once you have edited /etc/makepkg.conf - the last line
PACMAN_AUTH=(doas)

without that it will build, but not install

See (Not a big issue) pamac installs sudo automatically (#975) · Issues · Applications / pamac · GitLab

1 Like

That completely normal, this is how Discourse works, new account have restrictions. Once you become a member of the forum and participate, restrictions will be lifted automatically, until then, you’re restricted in what you can do.

It may not be a big issue, but that’s not a real explanation - just the statement that this is so.
It’s intransparent.
There are no obvious dependencies of pamac-gtk or pamac-cli or anything that is installed or about to be installed from the AUR
saying that sudo is required
but pamac insists on (re)installing it anyway for any AUR package.

It checks for base-devel group which is needed to build any AUR package as per

https://wiki.archlinux.org/title/Arch_User_Repository#Getting_started

Looks like an explanation to me.

2 Likes

Pamac installs any packages needed to build AUR packages. sudo is one of those packages, as it’s in the base-devel group, as LordTermor said above.

1 Like

Yep - it does that.
And sudo is part of the base-devel package group.
Even though it is not strictly needed, as it can be replaced by doas.

It’s a convenience feature of pamac, I guess.

But one cannot find that out by looking at the dependencies of pamac. Or that of sudo.
Only once pamac is used to install something from the AUR this becomes apparent - and gets in the way by insisting on the complete base-devel group being present
without telling that this is the reason for wanting to have sudo present.

So far, there are probably not many users who decided to use doas instead of sudo
and who use pamac as AUR helper as well.

It doesn’t bother me much - I’ll just have to use a different AUR helper or makepkg instead
as I already do, most of the time.