Faster Pacman Downloads
A common method of enabling faster pacman downlods is to use wget as the XferAgent. Although this is a good solution, there is another alternative to wget, aria2.
According to the aria2 website, aria2 is "aria2 is a download utility with resuming and segmented downloading. Supports HTTP/HTTPS/FTP/BitTorrent/Metalink."
What this means is, it allows you to make several http/ftp connections to an Arch mirror at the same time, which should result in twice the download speed for all packages.
Setting It Up
The first thing we will need to do is install aria2, which is available in the Extra repository.
pacman -S aria2
Next, we need to configure pacman to use aria2 instead of it's internal downloader. This is done by editing /etc/pacman.conf. Pop open your favorite editor and load it.
Look for the following line:
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
This is almost exactly what we want, except that it's for wget, not aria2, and it's commented out, so it's not even in use. Let's change it look like this:
XferCommand = /usr/bin/aria2c -s 2 -m 2 -o %o %u
Let's run over the options here:
- /usr/bin/aria2c - the location of the aria2 application
- -s 2 - use 2 concurrent connections (you can set this higher if you want, but it's not going to do a whole lot)
- -m 2 - make 2 attempts to download the package per mirror
- -o %o - output to the file pacman specifies
- %u - download the file pacman specifies
That's it! pacman will now use aria2 to download all packages, and it should be noticably faster.