Goal: Examine Package Manager, Focus on Command Line Interface
We have this ALPM, The Arch Linux Package Management,
as a base for pacman binary package frontend,
and source package tools such as the famous AUR,
and ASP (formerly ABS),
or even the lower level makepkg tool.
They are all under ALPM umbrella.
Using Arch Linux minimal install in Docker,
is a good way to learn ALPM.
ALPM is considered a basic knowledge
utilized by Arch’s based distribution
such as Manjaro, Antergos, Artix,
and some other cool Arch’s influenced distribution such as KaOS.
In short, any distribution using pacman
Personally I have been an Arch user since 2014,
I have used so many pacman command, but never really understand.
Reading pacman manual again makes me realize that I know nothing.
That is why I have a need to write down this blog article.
Test Bed
Container: Docker
Operating System: Artix (OpenRC )
Window Manager: Herbstluftwm
Since we are going to use docker again,
you can read a common overview here.
Of course you can use virtualization, the issue is distraction.
We need to avoid tendency to focus on GUI tools.
At the same time, limiting the scope to CLI tools.
Most of the time, CLI tools is considered lower level than the GUI one.
Must Read
You are encouraged to read the holy archwiki first,
before even starting to read this article.
Note that with minimal install in docker,
we do not have man-db and less yet.
Updating System
First Thing First
First thing to do is updating my system as usual.
OS Release
Make sure it is Arch that we are using.
There is /etc/os-release in Manjaro and KaOS,
But Arch utilized an empty file /etc/arch-release
to indicate that this is an arch distribution.
I guess since Arch is rolling release,
there is no need for release number.
Other Arch based may have different file,
such as /etc/artix-release .
The Riddle
What is pacman -Syu ?
And What is pacman -Syyuu anyway ?
Of course there is man pacman that explain it all.
After reading the manual we can have something like
pacman --sync --refresh --quiet --sysupgrade --force.
We can separate the pacman -Syu into few smaller steps.
Update
List Upgradable
Download
Upgrade
Common Form
Refresh Update
Equal to:
From the manual “ Passing two –refresh or -y flags will force a
refresh of all package databases, even if they appear to be up-to-date. “
List Upgradable
Equal to:
Download Upgrade
You may add --noconfirm if you wish.
this one not asking for PGP confirmation anymore.
Upgrade
This command will install package, and download if necessary.
This is a process with long verbose output,
I have to split out to three figures.
This is why the first figure output looks pretty similar
with the download command above since it works on the same upgradable packages.
But the next figure is different.
Equal to:
Common Form
Consider put all them command above together.
You can combine update dan upgrade in single command.
I usually only use this single command.
Package IRSIF
Install, Remove, Search, Info, File
Package Install
Installing in Arch is just --sync with target.
Consider our favorite example package below.
This will also have a verbose long output.
Or other favorites package.
You can also download, and install later, with color
And you can also combine with system upgrade.
Package Removal
We many cases to be shown here.
Consider this fish,
no package has any dependency to this friendly water creature.
Equal to:
We can also remove any its dependency as well
by using --recursive option.
Equal to:
Consider this groff case,
that is dependency of man-db.
Have a look at how ALPM manage dependency,
this command will send error notification message.
It can be solved by using --cascade option.
Equal to:
If you wish, you can have a cleaner removal.
It is just an example.
We do not realy need to delete it.
Package Query Search
In short, pacman -[Q|S]s.
There are two kind of pacman searches,
local query search
repository sync search
Local query search.
Equal to:
And repository search.
Equal to:
There are also some AUR search command that we will discuss later.
Package Show Info
In short, pacman -[Q|S][i|ii].
Pretty straightforward.
Equal to:
And repository search. With slightly different output,
the additional Repository field.
Equal to:
Change Log
I rarely use this feature.
Equal to:
List Files
Pretty straightforward using -Qi.
Note that -Si is totally different task.
Listing package files also can be achieved using pkgfile.
Verify
You can verify integrity of a package.
Equal to:
Package as File
You can examine downloaded package.
And gather information from the file directly
Equal To:
You can also query file
with list -Qpl or info -Qpi.
If you are a curious person, you can even extract the package.
What’s Next
pacman is a complete package management,
one command rule all, and it is also very fast.
So many commands that this topic deserve its own long article.
Consider finish reading [ Part Two ].