Introduction
A package manager is a tool for managing software packages and their dependencies on a computer system. On HPC systems, package managers are commonly used to install, update, and remove software packages, as well as manage dependencies between packages.
The package manager maintains a database of available packages and their versions, as well as the dependencies between packages. When you install a package, the package manager automatically resolves any dependencies, downloading and installing any necessary packages. When you remove a package, the package manager ensures any dependent packages are also removed or updated to a version not requiring the removed package.
Many package managers like APT and YUM require superuser privileges to install new packages system-wide. In these cases, a regular users can NOT use a package manager to install new packages on HPC system. However, they can use all the packages already installed.
Access software using package manager
Check OS and package manager
Some of the most commonly used Linux-based operating systems in HPC include:
operating system | package manager | cluster example |
---|---|---|
Red Hat Enterprise Linux (RHEL) | YUM (Yellowdog Updater, Modified) | Nova [RHEL 7.6], Condo [RHEL 7.5] |
CentOS | YUM (Yellowdog Updater, Modified) | Atlas [CentOS 7.8], Ceres [AlmaLinux 9.3] |
Fedora | DNF (Dandified YUM); for older than Fedora22: YUM (Yellowdog Updater, Modified) | |
Ubuntu | APT (Advanced Package Tool) | |
OpenSUSE | ZYpp | |
Arch Linux | Pacman |
These operating systems have been optimized and tested for performance and reliability in HPC environments, and they typically include a wide range of tools and software packages that are commonly used in HPC. Different operating systems have different methods for installing software, for example, they may use different package managers (see table above). Some Linux distributions may use multiple package managers to support different use cases.
To find out what package manager is in use, first check what the operating sytem is on the HPC. Usually such information is displayed automatically as a welcome note when you log in to HPC.
ssh atlas-login ********** N O T I C E ********** Atlas is a cluster system running CentOS 7.8 configured as follows. 240 nodes, 480 processors, 11,520 processor cores
A. You can check at any time, which operating system (OS) is running on an HPC system using the commands:
lsb_release -a
lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.8.2003 (Core) Release: 7.8.2003 Codename: Core
In this example, the HPC system is running CentOS 7.8.2003.
B. If the lsb_release
command is not available on your HPC system, you can also check the OS by looking at the contents of the /etc/os-release
file:
cat /etc/os-release
cat /etc/os-release NAME="AlmaLinux" VERSION="9.3 (Shamrock Pampas Cat)" ID="almalinux" ID_LIKE="rhel centos fedora" VERSION_ID="9.3" PLATFORM_ID="platform:el9" PRETTY_NAME="AlmaLinux 9.3 (Shamrock Pampas Cat)" ANSI_COLOR="0;34" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos" HOME_URL="https://almalinux.org/" DOCUMENTATION_URL="https://wiki.almalinux.org/" BUG_REPORT_URL="https://bugs.almalinux.org/" ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9" ALMALINUX_MANTISBT_PROJECT_VERSION="9.3" REDHAT_SUPPORT_PRODUCT="AlmaLinux" REDHAT_SUPPORT_PRODUCT_VERSION="9.3"
In this example, the HPC system is running AlmaLinux 9.3.
Once you know what operating system you are working on, find the corresponding package manager in the table above. You can use the command line to confirm which package manager is installed on the HPC system. For example, you can use which
command followed by the name of the package manager:
APT | YUM | DNF | Pacman | ZYpp |
---|---|---|---|---|
which apt |
which yum |
which dnf |
which pacman |
which zypper |
which apt -bash: type: apt: not found which yum yum is /bin/yum
If the package manager is not installed, you will receive an error message indicating that the command is not found. If the package manager is installed, you will receive the path to the executable file for the package manager.
Search for packages
Some package managers, such as YUM or APT, do not have a specific option for installing packages for the current user only. By default, packages installed with YUM by a superuser are installed system-wide, which means that they are available for all users on the system.
The centralized package manager can be used to search for and list the available software packages.
YUM
for RHEL / Fedora / Rocky: .rpm packages managed by yum
(yum has been supplanted by dnf
)
# List installed and available packages:
yum list all
# List only available packages:
yum list available
# Search dnf list for a given package:
yum search <software_name>
APT
for Ubuntu / Debian: .deb packages managed by apt
and dpkg
# List installed and available packages:
apt list
# Search apt list for a given package:
apt search <software_name>
Use packages
Once a package is found using package manager, you can use the software provided by that package by simply executing the corresponding command in your terminal. The exact way to use the software may vary depending on the software itself, but typically you will be able to run the software by typing its name in the terminal and hitting enter.
For example, if you searched for the gcc
package, you can use the GCC compiler by simply typing gcc
followed by the name of the source code file you want to compile, and any necessary command line options.
If you don’t know how to use the program, you can always preview the available options and instructions for use by calling the name of the program along with the --help
flag.