Improve pacman performance

From ArchWiki
Revision as of 08:04, 15 November 2006 by Jonathantan86 (talk | contribs) (initial writing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Pacman's speed in downloading packages can be improved by using a different application to download packages instead of Pacman's built-in file downloaded.

In all cases, make sure you have the latest Pacman before doing any modifications.

pacman -Syu

Using aria

According to the aria2 website, 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.

Install it with pacman -S aria2 and then edit /etc/pacman.conf by adding the following line to the [option] section:

XferCommand = /usr/bin/aria2c -s 2 -m 2 -o %o %u

See Faster Pacman Downloads for more information and a script which allows downloads from multiple locations.

Using wget

This is also very handy if you need more powerful proxy settings than pacman's built-in capabilities.

To use wget, first install it with pacman -S wget and then modify /etc/pacman.conf by adding the following line to the [option] section:

XferCommand = /usr/bin/wget -c --passive-ftp -c %u

Instead of putting wget parameters in /etc/pacman.conf, you can also modify the wget configuration file directly (the system-wide file is /etc/wgetrc, per user files are $HOME/.wgetrc).

Using snarf

Download by pacman -S snarf and then edit /etc/pacman.conf by adding the following line to the [option] section:

XferCommand = /usr/bin/snarf -N %u

Using lftp

Download by pacman -S lftp and then edit /etc/pacman.conf by adding the following line to the [option] section:

XferCommand = /usr/bin/lftp -c pget %u

With lftp downloads will be much faster and once the download finishes it removes the output, so it keeps everything clean.