How to install silversearcher-ag (ack-grep/ag) on Fedora CoreOS

Problem

When trying to install silversearcher-ag (also known as ag or ack-grep) on Fedora CoreOS, you might run into the following error:

error: Packages not found: silversearcher-ag

Solution

While on Ubuntu, the package is called silversearcher-ag, on Fedora CoreOS, it’s called the_silver_searcher. So, to install it, run:

sudo rpm-ostree install the_silver_searcher

After that, either systemctl reboot or rpm-ostree ex apply-live (somewhat dangerous as it might also apply other updates)! After that, you should be able to use ag as usual.