Installing and Maintaining Linux Software Packages

Each distribution of Linux has a package manager. On Debian and Ubuntu based system the package manager is apt. On Arch based systems the main package manager is pacman. There is also a user contributed package manager called the AUR Arch User Repository.

Debian

Debain packages are called .deb files. To install these packages there are three package managers, apt, aptitude, and dpkg.

dkpg
This is the base tool for handling packages. It can install, remove, and give information about .deb files.

  • Install package: sudo dpkg -i package.deb
  • Remove package: sudo dpkg -r package
  • List installed packages: dpkg -l

APT Advanced Package Tool
A higher level tool that allows for easy installation, configuration, and download of software.

  • Update package list: sudo apt update
  • Upgrade all packages: sudo apt upgrade
  • Install a package: sudo apt install package
  • Remove a package: sudo apt remove package
  • Search for a package: apt search package

Aptitude
Alternative to apt that allows for command and text based tools.

  • Install a package: sudo aptitude install package
  • Remove a package: sudo aptitude remove package
  • Update package list: sudo aptitude update
  • Upgrade all packages: sudo aptitude safe-upgrade

Arch Linux Package Managers

Arch linux has two main package managers, pacman and yay. Arch follows a rolling release model so you always have the latest versions of software. Pacman has the official repositories and yay gives access to the arch user repository of community projects.

Pacman
Pacman uses simple compressed files to install packages and uses a text based package database.

  • Update package list: sudo pacman -Sy
  • Upgrade all pacakges: sudo pacman -Syu
  • Install a package: sudo pacman -S package
  • Remove a package: sudo pacman -R package
  • Search for a package: pacman -Ss package
  • Get information about a package: pacman -Si package
  • List installed packages: pacman -Q

Arch User Repository

The AUR is a community that contains user submitted package descriptions PKGBUILDS. These allow you to compile a package from source or download precompiled packages.

Accessing the AUR
To access the AUR use the yay AUR helper. Pacman does not directly interact with packages installed through any AUR helper.

Yay (Yet Another Yogurt)

  • Install a package: yay -S package
  • Remove a package: yay -R package
  • Update all aur packages: yay -Syu
  • Search for a package in aur: yay -Ss package

Use a PKGBUILD Directly

Instead of using an aur helper it is possible to use the pkgbuild directly to download and compile a package.

Steps

  1. Download the pkgbuild and related files
  2. Navigate to the directory containing the pkgbuild
  3. Run makepkg -si to build and install

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *