The 'pacman' package manager is one of the major distinguishing features of Arch Linux, but it does have issues on occasion, such as becoming really slow when installing software or updating the system. But these issues are easily fixed.
Your support is very much appreciated. Thanks, guys!
AI Generated·May contain errors
If you use Arch Linux or an Arch Linux based distribution such as Cache, Endeavor, Geruda,
ZeroLinux, any of that stuff, sometimes the package manager, Pacman, sometimes it gets
really slow. So today I wanted to share with you some common causes why the Pacman package manager
slows down on you and ways that you can fix these problems. The first problem is probably
the most common one you're going to experience on an Arch based system and that is Pacman just
stops working all together and it's because of an outdated key ring. So you try to do your
sudo pacman-syu and you're going to get an error message. Typically it's going to error out. It's
going to say package corrupted. This file is corrupted. PGP signature corrupted. You're
going to get a whole bunch of error messages about pretty much any package you try to install from
the repositories. How do you fix this? Well, you need to install the latest archlinux-keyring.
You install that package and then once the key ring, the new key ring with the new PGP signatures,
all of that is installed, then you can rerun your syu and update the system. So that is a very common
and simple fix. But one area where Pacman will sometimes slow down on you, and this is not
all that common, but it will happen on occasion. I've run into this recently actually because I
run archlinux-based distributions both on my office computer here that I'm making this recording on
as well as my home computer. And I noticed recently that every time I do an update on my
machine here at the office, it's really fast. It downloads the packages and installs them very fast.
A total system update a lot of times can take just a few seconds. It's so fast. But at home,
sometimes the updates seem like they would take 15, 20 minutes, 30 minutes. They're just crazy
slow. And I couldn't figure out what was the problem with my home machine versus the office
because we got the same speed internet here as what I've got at home. So it wasn't really a
networking issue. Well, the problem was Pacman when it's downloading all of your packages on
an update, it's hitting all of these servers and these mirrors and the mirrors that my home
computer was trying to download packages from were really slow. The download speeds on those
particular mirrors were really slow. And you can actually solve this problem by using the
reflector command. So if you feel like your Pacman mirrors are really slow, run this command here,
sudo reflector. You have to use sudo privileges and reflector will go and find the fastest mirrors
for you. And in my case, I gave it dash dash country, United States, because I only want
mirrors that are in the U.S. Anything outside the U.S. is going to be computers too far away
for me to download packages from at any reasonable speed. And then dash dash age 12 dash dash protocol
HTTPS dash dash sort by rate. So I want the fastest speeds and then dash dash save saves all
of this to a file. So the reflector command is going to find me the 10 fastest mirrors based on
this information that I gave it. And it's going to save it. It has to save this to this file slash
mirror list. You run that command and it'll take a few minutes because it's going to ping a bunch
of mirrors to find the fastest ones. And then once it gets the 10 fastest ones for you, it will
automatically save it to that mirror list file. And now when you do your Pacman SYU, you will
notice that your download speeds are much faster because it's using mirrors that are much faster.
Another thing that can cause really slow download speeds using Pacman is that you don't have
parallel downloads enabled. So make sure you have parallel downloads enabled. If you sudo
VM slash Etsy slash Pacman dot com your Pacman config file and then do a search for parallel.
I can spell parallel. There it is. Parallel downloads. Make sure that is set to five or
eight or 10. You know, give it some number. Right. Because if this is turned off or a lot of times
this line may be just commented out. If it's commented out, you don't have parallel downloads
enabled. So it's only downloading one package at a time. But if you have parallel downloads
equals five, it's downloading five packages at a time or in my case here, 10 packages at a time.
Have that set to some reasonable number and that will make your updates quite a bit faster.
Another thing that you may want to do if you find Pacman slowing down on you, sometimes it's good
to get rid of cache files. You know, go ahead and delete all that old cache package data. And you
can do this by using a sudo Pacman dash capital S lowercase C and lowercase C. Right. And that
will get rid of a lot of that cache data. Or you could also use the command Paccache dash R if
that's installed on your system. Paccache is one of the scripts that's part of the Pacman dash
contrib package. But this command or the Pacman dash capital S CC command, well, they basically
do the same thing. Another thing is if you do any of these changes, if you do a reflector command
or you edit your pacman.com or you clean the cache and then you go and try to do a Pacman SYU,
sometimes things are still be slow. It's because you still need to refresh the database. So after
making any kind of major changes like that to any kind of configs, go ahead and actually force a
refresh of the entire database by doing a Pacman dash capital SYYU rather than just a dash SYU.
So there you have it. Just a very quick video today. Just a couple of little tips. I know so
many of us are using Arch Linux or Arch based distros, and you will run into some of these
Pacman issues on occasion. They're usually very simple to solve if you know the commands to
enter. Peace guys.