Skip to content

Question: Why is pacman so fast?

One of the best things about Archlinux is the package manager pacman. I have used Arch for many years now and pacman is generally how I convince people it's worth looking into (if they don't already buy the Arch Way(TM)). How do explain how pacman was designed or built from a developer point of view as to why it feels so much more efficient than other package managers (is this even true or is it just perception)?

42 points47 comments
Open on Reddit
About this post
Posted
Archived
Score
42 · 100% up
Kind
Text
ID
1mo3kl

Author

3
posts
35
comments
0
media
View profile

51 comments

Quite frankly - I don't see pacman being much faster (I even think it's a bit slow on HDD with cold cache).

I've used apt/dpkg for a while, and found it just as capable as pacman. Some small things I like more in one than in the other (pacman's option names aren't all that discoverable, while apt requires knowing multiple tools).

The one thing I can say about pacman that blows every other package manager out of the water is actually makepkg - just a simple bash script, with a few variables and three functions, all rather self-explanatory.

Overall, though, I use arch for a variety of reasons, and pacman isn't all that high on the list.

40 points

Pacman isn't really high on your list really? Having an easy way to remove orphaned packages, or walk the dependency tree ranks pretty highly for me.

13 points

Having an easy way to remove orphaned packages

Looking at you there Yum.

Pacman is by far the best package manager I've ever used. One of my favorite things about Arch. That and they don't modify their packages from upstream all that much.

22 points

Some small things I like more in one than in the other (pacman's option names aren't all that discoverable, while apt requires knowing multiple tools).

apt-get does but aptitude doesn’t. aptitude install, aptitude search, same tool.

4 points

Because it does less than other package managers, and does the rest in a much simpler way.

APT runs a lot of checks and scripts for every package, especially the "triggers" that rebuilds [I have no idea what] all the time.

Yum is even worse in that case because it prepares a transaction, save everything, check the changes, apply. This is so it can revert everything exactly like if you didn't run it in case of errors.

And generally speaking, pacman also handles less packages. From my observations apt-get runs quite fast too, but what's a single package in Arch is like 50 packages in Debian so it ends up slower. That makes a huge dependency tree that takes long to calculate, same for reading the database to the point you can see it... 10%... 20%... 30%... when you run an apt command.

This is how I understand it.

29 points

This is a good point. Pacman tends to distribute packages piecewise instead of in little chunks.

3 points

I've read about yum transaction over btrfs, is it so for any FS ?

1 points

Because doing almost nothing takes almost no time at all. Other packages and package managers (like deb and apt) are way more complex and have tons more features.

9 points

I use deb apt and yum. Please elaborate on these features you speak of.

3 points

Pinning, automatic conflict resolution, forbidding versions, security vs version upgrade, unattended upgrades, more powerful search. These are a few examples of what I use. Then there's the other side of the problem, package maintaining automation, tools, features, etc. I packed just a few of both so I'm not really an expert but while pkgs are just an archive and a bash script debs are incredibly complex.

8 points

On my laptop, pacman is stupid slow the first time I run it. Takes about 20secs to respond first time it's run.

5 points

my guess is that's because packages are simple, and have simple and small metadata.

2 points

I would add that pacman was even faster 2-3 years ago. Much faster. I don't know what happened and why Arch became slower.

1 points

Before it used to not verify package signatures, which isn't a fast operation.

12 points

I can say that on my system (an Intel Atom netbook with a real but not fast hdd) pacman has gotten slower in one way: I used to have my pacman databases in file-as-a-filesystem's (a single file of 200mb that has a ext filesystem inside that then gets mounted as a loopfile, like a cd image iso). And that made it bloody fast. Now for a while pacman uses .db files for this, instead of individual files for each package it's now one file for the whole database. And the official recommendation has become that it is "no longer necessary to put the pacman db into a filesystem-in-a-file loopfile".

On my netbook this means that assuredly each time i first use pacman after a reboot it's gonna take half a minute of caching the whole db file. That would be ok, but coupled with only 1gig of RAM and ram hungry applications like Firefox i regularly run out of RAM and linux starts swapping things around, and that means that effectively most of the time i use pacman, even for just a dead simple "pacman -Qi linux", it's going to cache the whole damn db again.

5 points
unknown author7 hidden

I'm full time on my Samsung Netbook and I do not have these probelms after a reboot. It very well may be a misconfiguration of your system/pacman. If it really is lack of RAM then get one. They cost about 10-15 bucks for 2GB. Well worth it if you really run into troubles with your RAM. ;)

To each his own... My ranger installation slowed massively down on my netbook with each update and I have no idea why. :/ So morale of the story is sometimes weird stuff happens. :)

2 points
unknown author10 hidden

Deleted before we saved it.

-17 points

This seems like a good place to air irrational grievances against Arch Linux.

9 points
unknown author

Deleted before we saved it.

0 points

feel better?

re: my reply above: I was making an off the cuff snarky remark that pacman's args aren't super obvious and that their speeds are neglibly different (in my anecdotal usage, like I said I've used ubuntu for many years and Arch for about 11 months now, but whatever, I got fucking downvoted for... telling the truth about that in a different reply).

then I made an even bigger joke of it by saying it doesn't matter because a week in any distro will get you acquainted enough that it doesn't matter.

Jesus. I love Arch and have no complaints. Shit, it's not like I couldn't use a wrapper or aliases or something. I just saw the other day there were for zsh as I was adding a new plugin. Could've added it but didn't.

See buddy, maybe, if you don't go looking for "airing irrational grievances" you won't find them.

Good god. Now I'm back off to my Arch machine to figure out why my btrfs drives are still wonky (see btrfs, not the arch part of that sentence before you go looking for grievances). Good night. Christ

0 points
unknown author

Deleted before we saved it.

-2 points
unknown author

Deleted before we saved it.

-2 points

I'm a developer haha. I was interested in the internals, specifically what pacman was doing differently than other inferior package managers.

Speaking of which, I maintained ubuntu servers at my previous job and the way debian packages are constructed are complete shit. I ended up building everything from source to maintain my sanity. To each his own I suppose.

3 points

Lol, it wasn't meant as an attack on you. My posts never go over terribly well here, haha.

I guess I didn't see any reason to think of pacman as terribly performant, didn't mean to discourage learning more about it though, sorry!

2 points

I wouldn't say others are inferior, but coming from Gentoo and Debian, I also thought pacman is blazing fast.

Pacman seems a bit simpler, and perhaps more unsafe in it's approach to applying changes (new packages), but really, how often does your pc crash exactly when transactions in pacman happen? It seems to have gained quite a bit of speed for the sligthly simpler design/feature set.

I much prefer how pacman handles versioning compared to other package managers, at least as someone who often ends up outside official package tree.

2 points

Why do you say it is no faster than apt-get. From my experience, pacman is faster in every respect. Have you tried both before?

1 points

Well I ran Ubuntu since it's second release and switched to Arch a year ago, so I like to think I'm giving them a fair shake.

I really didn't mean to piss in anyone's Post Toasties. I obviously love Arch or I wouldn't run it. I would presume that pacman and apt-get are equally fast --- aka, whatever difference there is is insignificant to me.

0 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.