Tuesday, October 20, 2015

archlinux pacman - an introduction

Packages in arch repositories are constantly upgraded. When a package is upgraded, its old version is removed from the repository. There are no major arch releases. Each package is upgraded as new versions become available from upstream sources. The repository is always coherent. (The packages in the repository always have compatible versions.) This type of repository is called a rolling repository. Before packages are upgraded in the core, extra and community repositories, they are tested in the testing repository, to ensure that the distribution is stable.

pacman saves to disk a list of packages available in the repository. This list is not automatically updated (refreshed). (The list is a.k.a. repository databases and the update of the list is a.k.a. synchronizing those databases.) The list can be refreshed using pacman -Sy. pacman -Syy refreshes the list even if it appears to be up to date. I don't know the effect of pacman -Syy when the pacman list is newer than that of the mirror, for example as a result of falling back to a different not yet updated mirror.

When the list is outdated it is possible that packages to be installed with pacman -S package are not available.

When pacman installs one package with pacman -S package it takes care that all its correct version dependencies are installed but it does not verify that dependencies of other packages are not broken by such updates. If the list has been updated but packages not, then this command could make the system unusable. That is why the list should only be updated together with all packages in the system with pacman -Syu and you should never run pacman -Sy or pacman -Sy package.