Install OpenDoas on Arch Linux (and get rid of Sudo)

This is a quick guide on banishing the SANDWICH from your system

by spitemim, 2022-11-11

How do you banish the SANDWICH from your system?

That’s the official Sudo logo. Do you trust this program with your life? How can you let the security of your Linux/Unix setup depend on an anthropomorphic sandwich with 3 front teeth?

Here’s how to banish this fucker from your system, and replace him with a based pufferfish.

1. Installing and configuring OpenDoas

On Arch Linux, doas is available in the community repo. Run as root:


pacman -S opendoas


The doas config file is /etc/doas.conf. More info on doas configuration can be found here, but here’s the rub on how to configure it for basic desktop use.

To allow members of the wheel group to run commands as root, enable persistent doas sessions so you don’t have to type in your password every single time, and have the environment variables XAUTHORITY, LANG, and LC_ALL persist, set /etc/doas.conf to this:

permit persist setenv { XAUTHORITY LANG LC_ALL } :wheel

You’ll want to make sure this file is owned by root with restrictive permissions:


chown root:root /etc/doas.conf

chmod 0400 /etc/doas.conf


You’re all set. Run

$ doas id

to verify that everything works.

2. Banishing the SANDWICH

Some programs, such as AUR managers, call sudo internally to elevate to higher permissions. You can substitute doas with a symbolic link:


ln -sf /usr/bin/doas /usr/bin/sudo


Also, some programs or groups depend on the sudo package. Add the following line to /etc/pacman.conf:

IgnorePkg = sudo

Now, when sudo is pulled as a dependency, pacman will ask you if you want to install the ignored package. Always reply no.


pacman -S base-devel

:: sudo is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n … “`

3. Flex

If all goes well, the sandwich has been successfully banished at this point. Your value as a human being is greater than the value of most other people you pass on the street. You’re also probably immortal.

While you’re waiting for your tendies at Mickey D’s, make sure to strike up a conversation with the most attractive woman in the store with the rock-solid line: “I use Arch Linux btw. Did you know Sudo is bloat? The logo is a sandwich! I use OpenDoas from the Open BaSeD project, and I also use vim and host my own website with nginx.” I did this once and the woman’s primal attraction was so great that she ran away screaming and had to call the police to prevent me from having the same effect on other women.