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.
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.
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).
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
Last edited: