Replace sudo with doas

sudo, doas, void linux

I’ve been using doas, or OpenDoas as the fork is called, for about a year or so instead of sudo.

It is very easy to install and configure this on Void Linux.

First we need to install the package

xbps-install -S opendoas

Configure

The configuration doesn’t need to be more than one line and the file is not created by default.

The file is in /etc/doas.conf and we just need to permit something, either your user or the wheel group, or something else. I’ve permitted my user since I’m the only user on my computers.

permit <user>

If we want to permit the wheel group

permit :wheel

Uninstall sudo

sudo is a part of the base-system in Void and that means that we can’t just uninstall it like any other package. We need to make a ignore rule to tell the package manager to ignore this specific package when looking for dependencies.

We need to add ignorepks=sudo to /etc/xbps.d/10-ignore.conf. To make this easier this line below will do it for us:

echo "ignorepkg=sudo" | sudo tee -a /etc/xbps.d/10-ignore.conf

Now we can uninstall sudo

xbps-remove -R sudo

Fun fact

The only thing I’ve ever needed from sudo is the posibility to run commands as the root user so when you check the configuration files of sudo and doas, and then look at the size of the installed package of each of them - it’s very obvious which to chose.. At least for me.

sudo installed size

installed_size:           4248KB

doas installed size

Size freed on disk:             51KB