Identify the operating system
Packages are installed through your distribution's package manager. Ubuntu 24.04 LTS uses APT; AlmaLinux 9 uses DNF. Run the operating system check first and use only the matching command blocks below. An apt command will not manage packages on AlmaLinux.
You need working network access, free disk space, and a root account or sudo privileges. sudo -v checks whether your login can authenticate for administrative commands. If you are already root, omit sudo from later commands. Make a current backup before updating a server that holds important data.
cat /etc/os-release
df -h /
sudo -vFind a package before installing
A repository provides packages built and signed for your distribution. Start with the official configured repositories. Package names can differ between distributions, so inspect the description rather than assuming a similar name is the same program.
These examples use curl, a command-line HTTP client. On Ubuntu, apt update refreshes the local package index; it does not install updates. DNF refreshes repository metadata as needed, and --refresh requests a fresh check for the package query.
sudo apt update
apt show curldnf --refresh info curlInstall and confirm the result
Run the appropriate install command. Review the proposed packages, download size, and dependencies, then accept the transaction if they match your intention. Avoid adding -y while learning: the confirmation screen is useful context.
After installation, curl --version should display the program version and supported features. This verifies that the command is available to your shell. If the package was already installed, the package manager reports that state rather than creating a duplicate installation.
sudo apt install curlsudo dnf install curlcurl --versionReview and apply available updates
Use the review command first. On AlmaLinux, dnf check-update returns status 100 when updates exist; that is an expected result, not a failed package transaction. The upgrade step updates installed packages within the configured release repositories.
Read the transaction summary and any configuration-file questions carefully. A package update can restart services or require a reboot. Schedule work when an interruption is acceptable, and keep access to your provider's console available.
sudo apt update
apt list --upgradable
sudo apt upgradednf check-update
sudo dnf upgradeCheck completion before leaving
Expect a successful completion message and no unresolved dependency errors. On Ubuntu, the presence of /var/run/reboot-required indicates a requested reboot. Kernel updates on AlmaLinux normally require a reboot to run the new kernel. Arrange that restart deliberately, then reconnect and check application services. Routine package upgrades do not perform an Ubuntu or AlmaLinux major-version migration.
Official documentation
These upstream references provide more detail on the commands and workflows in this guide.