Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Bash + Awk + fzf to Manage Arch Packages

bash-awk-fzf-to-manage-arch-packages.jpg

Here's a small script to help install, list and remove packages for both Arch's main repos and the AUR with Paru.

Quick Jump:

Here’s the official pages to find packages for Arch’s main repo and the AUR:

But what if you want to get a similar experience on the command line?

That was the main use case I had, so I whipped together a script which lets you search for package names and descriptions while the results get narrowed down in real-time with fzf.

It also handles installing and removing packages, which uses the same fzf interface.

It’s available in my dotfiles but the script itself is standalone.

Here’s its current help menu:

pkg install          # Install / search new packages
pkg install --aur    # Install / search new AUR packages
pkg list             # List locally installed packages
pkg list --aur       # List locally installed AUR packages
pkg remove           # Remove installed packages
pkg remove --aur     # Remove installed AUR packages

The video below shows it in action.

# Demo Video

Timestamps

  • 0:11 – The Arch page for searching packages
  • 0:30 – Finding new packages to install
  • 1:29 – Listing packages
  • 1:48 – Removing packages
  • 2:41 – Combining bash, awk and fzf to write it

Do you think you’ll try this script? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments