Pacman: Another Package Management System

Are Ebuilds and similar systems better than package systems like DEB, RPM, and others?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%
  • It depends

    Votes: 0 0.0%

  • Total voters
    0
D

DevynCJohnson

Guest
Many Linux distros have a specific package manager and a package installation format that they use. For instance, RedHat-based distros use the RPM installation file format and they use a package manager that can manage those files (such as Yum). Many people may be familiar with RPM and DEB, but does the same amount of people understand the package management system used by Arch Linux?

Arch Linux is the main distro that uses the Pacman package manager (Pacman = PACkage MANager). Pacman is a package manager meaning it is used to install, remove, reinstall, update, etc. software on the system using source code ports. Arch uses a ports-like system as seen in FreeBSD. This means the user does not need to worry about accidentally getting the wrong package for some other CPU. The source code is compiled on the local system and then installed.

The ports tree is a database that contains PKGBuild files sorted into directories by category. A PKGBuild file is a shell script that is used to obtain and build (compile) the software before installation. A PKGBuild file lacks a hashpling and is a relatively small script. PKGBuild files and Ebuild files used in Gentoo's Portage package management system have many similarities. A template is below. Notice that glibc is a dependency; glibc is the GNU C Library which provides the headers for system calls (commands to communicate with the kernel).

NOTE: Pacman does not build or compile packages.

Code:
pkgname=PACKAGE_NAME
pkgver=VERSION
pkgrel=RELEASE
pkgdesc="DESCRIPTION"
arch=('i686' 'x86_64' 'ppc')
url="http://www.SITE.XYZ"
license=('LICENSE')
groups=('CATEGORY')
depends=('glibc' 'ANOTHER_DEP')
source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz)
md5sums=('ee5ae84d115f051d87fcaaef3b4ae782')
build() {
  cd "$srcdir"/$pkgname-$pkgver
  ./configure --prefix=/usr
  make
}
package() {
  cd "$srcdir"/$pkgname-$pkgver
  make prefix="$pkgdir"/usr install
}

The ABS (Arch Build System) provides binary applications for Arch Linux and are packaged as .pkg.tar.xz files. ABS is separate from Pacman.

NOTE: Some Arch/Pacman-based systems include Larch, Archie, and others.

Commands

To install software and its dependencies using Pacman, use this command - "pacman -S PACKAGE". To install multiple packages at once, list all of the packages separating them with a space. To ensure the system has all of the libraries needed for compiling the packages, use this command - "pacman -S base-devel".

NOTE: Root privileges are required to install software.

Packages are removed by using "pacman -R PACKAGE". If the administrator wishes to also remove the unneeded dependencies, then this command is used - "pacman -Rs PACKAGE". Include a lowercase "n" as a parameter to prevent Pacman from making a backup of the configuration files of the software to be uninstalled.

To refresh the database for binary files and update the installed software, use this command - "pacman -Syu". To just update the software, use the "-Su" parameter. Using the "-y" parameter refreshes the database for binary files. To update a single or group of packages, use this command - "pacman -Su PACKAGES".

WARNING: Arch Linux is a rolling release meaning the system keeps improving with each update. There are no versions/milestones. So, an update may contain bug(s) that can ruin the system. Use caution when updating a rolling release distro.

Each time a package-file is downloaded to be installed, Arch Linux keeps a copy of the package-file in cache. To remove files belonging to software no longer on the system, use the "pacman -Sc" command.

To find software in the repositories, type "pacman -s REGEX" where "REGEX" is a string to be found and this string allows regex (wildcards).

To list the package that a file belongs to, execute "pacman -Qo FILEPATH". (Thanks @ZZs )

Many other parameters and features belong to Pacman, but these are the important ones people should learn and know.


GUIs

Pacman is a command-line based application. Some people do not like the command-line. Thankfully, such people have an alternative. Some frontends exist for Pacman. This means users can get a GUI that they interact with which will communicate with Pacman. Users can use GTKPacman, Wakka, Octopi, PacmanXG4, tkPacman, Pcurses, or PackageKit (highly recommended). Others exist, but these are just some examples.


Notification Applets

Some users want notification concerning the release of new updates. Software that performs such a task is called "update notification applets". Some examples include Pacupdate, Zenman, Kalu, Aarchup (fork of Archup), Yapan, and Pacmon. Others exist, but these are just some examples.


Package Browsers

Package browsers allow users to view installed packages and/or packages in the repos depending on the browser. Users can see the package details, get screenshots, installation date, etc. Some examples include Pacinfo and Pkgbrowser. Package browsers cannot install, remove, or manage packages in any way. The sole purpose of package browsers is to get information on packages.


Building/Compiling Packages

When Pacman prepares the software for installation, it has the "makepkg" script prepare the compilation process. This script resides in /etc/makepkg.conf. The script contains parameters needed by make, G++, and GCC to compile the source code correctly for the architecture of the system. This is why the script is in the /etc/ directory which is for configuration files. The contents of /etc/makepkg.conf looks more like a configuration file than a script.

Repositories

A repository (repo) is a set of software packages on a server. The main unofficial repo for Arch Linux is referred to as the Arch User Repository (AUR). Here is a list of unofficial repos - (https://wiki.archlinux.org/index.php/Unofficial_User_Repositories). To add a repository to your system, add the repo information to /etc/pacman.conf. The repository information looks something like below.

Code:
[xyne-any] #Repo name
SigLevel = Required #If this line is missing, that means no signatures are needed
Server = http://REPO.XYZ/ADDRESS #Address


AUR Forums, Bug Reporting, etc.

To report bugs concerning AUR (not the software being installed) or ask questions regarding AUR, use this site - https://aur.archlinux.org/


Now that we understand Pacman, in your opinion, is it better or more efficient than other package management systems (like DEB, RPM, yum, dpkg, etc.)? I am not just talking about Pacman (the manager), but also the installation file (PKGBuild).
 

Attachments

  • slide.JPG
    slide.JPG
    64.8 KB · Views: 92,958
Last edited:


There's two main things I dislike about Pacman:

1. The switches aren't easily documented (i.e.: do completely purge a package you do "pacman -Rns <package>", which you wouldn't know if you didn't Google it).
2. You have to update the cache to do installs (i.e.: if you're connected to the Internet, but get a bunch of "can't find package on host ...", its because you need to resynch the package cache).

Its a great package manager, and when you plop in something like pacaur for extra package discovery (and sometimes easier management), it just makes life in general easier.
 
Hm, pacman -Syu updates your system using the latest versions from binary packages. No need to compile anything here.

You are right, that the ABS is used to compile packages, but this is not needed for a "usual" user of ArchLinux. To use the ABS the tool of choice to compile packages is "makepkg" and not pacman.

Most probably you have mis-understood some of the stuff AL is doing in their distro. AL is a rolling-release but still based on binary packages, unlike gentoo and/or the BSD ports stuff.
 
There's two main things I dislike about Pacman:

1. The switches aren't easily documented (i.e.: do completely purge a package you do "pacman -Rns <package>", which you wouldn't know if you didn't Google it).
2. You have to update the cache to do installs (i.e.: if you're connected to the Internet, but get a bunch of "can't find package on host ...", its because you need to resynch the package cache).

Its a great package manager, and when you plop in something like pacaur for extra package discovery (and sometimes easier management), it just makes life in general easier.

Yeah, I sort of agree with Eric on #1. The directions are there though you just need to drill down a level in the help for the process you want ie: pacman --help vs pacman -R --help. I've never google'd anything on pacman before I just had to stop and read a second.

#2 I really have not had this issue, but I keep my system in tune actively.

Yes it is a great package manager! I run 5 different Linux distros on 3 systems. If I could install pacman on to the other distros I would. It makes my life simple, and I do use a package manager more then most with all my evaluation testing.

As far as the article goes you mentioned many extra tools and GUI's I've never used and probably never will. It's nice to know these tools exist though. You failed to mention the built in CLI command "checkupdates". You can write your own notification script using checkupdates. Checkupdates I use quite often as its more important for me to see the updatable packages verses the number of packages. The main tools I use in Arch is pacman, checkupdates, and makepkg.
 
Hm, pacman -Syu updates your system using the latest versions from binary packages. No need to compile anything here.

You are right, that the ABS is used to compile packages, but this is not needed for a "usual" user of ArchLinux. To use the ABS the tool of choice to compile packages is "makepkg" and not pacman.

Most probably you have mis-understood some of the stuff AL is doing in their distro. AL is a rolling-release but still based on binary packages, unlike gentoo and/or the BSD ports stuff.

Thanks. I made corrections.
 
Thanks. I made corrections.
Erm... you still got it wrong.

pacman always works with binary packages, pacman doesn't download PKBUILDS nor compiles a thing, so for instance when you do "pacman -Syu" you are not refreshing the "ports system", you are actually refreshing the database of binary packages and updating the ones you have installed. Pacman and binary packages in tar.xz format are the main and default way of installing packages in Arch, similar to APT with .DEB packages or YUM and RPM packages.

The ABS doesn't provide Arch with binary packages, pacman does. The ABS is mostly optional and not installed by default, and this is what allows the user to download the PKGBUILDs scripts that are used by Arch developers to build binary tar.xz packages to be consumed by pacman. This is the ports-like system. Then a tool called makepkg reads one of the PKGBUILDs previously downloaded by ABS (or any other PKGBUILD really) and uses it to download the whole package's source code from upstream and compile it to a .tar.xz package.
 
In some cases, I see Pac man -Syyu mentioned for updating. I wasn't sure what the major difference was from just pacman -Syu.
 
In some cases, I see Pac man -Syyu mentioned for updating. I wasn't sure what the major difference was from just pacman -Syu.
The double y will remove the old software list before downloading the new one. This can help to make sure the list is not corrupt.

It also forces the download of the list, even if you just downloaded it.
 
Hmm.... I've also seen pacman -Syy. Is that about the same as apt-get update?
 
Erm... you still got it wrong.

pacman always works with binary packages, pacman doesn't download PKBUILDS nor compiles a thing, so for instance when you do "pacman -Syu" you are not refreshing the "ports system", you are actually refreshing the database of binary packages and updating the ones you have installed. Pacman and binary packages in tar.xz format are the main and default way of installing packages in Arch, similar to APT with .DEB packages or YUM and RPM packages.

The ABS doesn't provide Arch with binary packages, pacman does. The ABS is mostly optional and not installed by default, and this is what allows the user to download the PKGBUILDs scripts that are used by Arch developers to build binary tar.xz packages to be consumed by pacman. This is the ports-like system. Then a tool called makepkg reads one of the PKGBUILDs previously downloaded by ABS (or any other PKGBUILD really) and uses it to download the whole package's source code from upstream and compile it to a .tar.xz package.


Thanks for the correct info and sorry for the incorrect/misleading information.
 

Members online


Top