Fixing package download performance problems in Manjaro Linux

My adventures with Manjaro Linux continue and I’ve even moved my “craptop” – a somewhat ancient Lenovo X240 that I use as a semi-disposable travel laptop – from XUbuntu to Manjaro Linux. But that’s a subject for another blog post. Today, I wanted to write about package download performance issues I started encountering on my desktop recently and how I managed to fix them.

I was trying to install terminator this morning and kept getting errors from Pamac that the downloads timed out. Looking at the detailed output, I noticed it was trying to download the packages from a server in South Africa, which isn’t exactly in my neighbourhood. Pamac doesn’t appear to have an obvious way to update the mirror list like the Ubuntu flavours do, but a quick dive into the command line helped me fix the issue.

First, update and rank the mirror list:

sudo pacman-mirrors -g

Inspecting /etc/pacman.d/mirrorlist after running the above commands showed that the top ranked mirrors now are listed in the US with very short response times.

After updating the mirrors, it’s time to re-sync the package databases:

sudo pacman -Syy

Now with the new, faster mirrors ranked accordingly, I suddenly get my Manjaro packages and package updates at the full speed of my Internet connection rather than having hit and miss updates that take forever to install.

MELPA has a new URL

MELPA has recently got its own domain (melpa.org) so it’s time to update your list of package repositories with the new URL.

Speaking of MELPA, I recently switched to their stable repository instead of their “regular” nightly build/snapshot repository after I accidentally ended up with a cider build that didn’t want to playing ball. This is not a complaint – if you use nightly builds etc you know what you’re getting yourself into – but it prompted me to switch over to using the stable package repository instead on those machines that I consider production machines. This of course require me to uninstall and reinstall a bunch of packages but that only took a few minutes.

Anyway, got update your ELPA/package.el configuration settings. And if you don’t use ELPA, spend the ten minutes or so to switch from manual package management to ELPA. Of course, if you are using a different package manager, feel free to ignore all my ramblings and keep using that one instead.

I finally started using ELPA

My normal development workflow doesn’t use that many different Emacs packages. With a few exceptions I’ve mainly worked with a “stock” Emacs distribution and augmented that with a few select Emacs packages that I downloaded manually. It worked for me for a decade or so, and it made it reasonable easy to move configurations between machines – zip & copy was my friend for that, although I’ve since changed that to using dropbox.

As we recently switched to git at work, I started looking into Emacs git clients and came across magit. At that point I figured a pre-built package would be nice and started looking into ELPA. I use Emacs 24 pretty much wherever I have an Emacs install so having ELPA in place everywhere came in really handy.

Didn’t take very long for me to switch away from the manual package “management” to get the few minor modes and other helper messages via ELPA. I don’t think I’ll go back to manual management.

Guess I should check if the weblogger package – which I am using to write this blog post – is also available in one of the repositories.

So if you’re still using manual package management, I would recommend looking at ELPA together with the marmalade repository. The default ELPA repo didn’t include several of the packages I needed, but combining ELPA and marmalade covered everything I’ve needed so far.