Install and Update Linux Software: A Beginner Guide
Before you begin
- Applies to:Distribution packages on Ubuntu, Debian, RHEL 9, or Fedora. Arch is covered in an optional section.
- Where to start:Use a Linux lab machine. Check /etc/os-release, then follow only the section for your distribution.
- What you need:Have an internet connection, approved repositories, and an account allowed to use sudo.
Guide tools
A package is software prepared for your Linux distribution. A package manager downloads it from a repository, installs the files, and tracks updates and dependencies. You usually do not need to download an installer from a website.
You will find, install, test, update, and optionally remove one small program. Use an Ubuntu/Debian or RHEL 9/Fedora lab machine, an internet connection, and an account allowed to use sudo. This guide covers distribution packages; desktop app stores, Flatpak, and Snap use separate workflows.
Choose APT or DNF → Inspect its source → Read each prompt → Update or remove.
Identify Your Linux Distribution
Start HereA distribution is a version of Linux packaged with its own software tools. cat displays a text file. Read PRETTY_NAME in this file to choose your package manager.
cat /etc/os-release❯ What to expect
Example line on an Ubuntu machine:PRETTY_NAME="Ubuntu 24.04.3 LTS"Your release name and version may differ.Refresh the List of Available Software
Choose Your DistributionA repository is a software source. Refreshing its list lets your package manager see available versions; it does not upgrade installed applications. DNF calls this list metadata, and —refresh requests a fresh check. Stop if the refresh reports a repository or signature error.
sudo apt updatesudo dnf makecache --refresh❯ What to expect
APT: repository download lines, followed by a package-list summary.DNF: repository metadata progress and a cache summary.There should be no failed repository or signature checks.Find One Package and Inspect Its Source
Choose Your DistributionWe will use tree, a small tool that displays folders as a tree. search finds packages by name or description. Read the description before installing. APT policy shows the candidate version and repository URL; DNF info shows package information and its repository. Check whether the tool already exists with command -v tree; if it does, keep it installed during the optional removal step.
apt search treeapt policy treecommand -v treednf search treednf info treecommand -v tree❯ What to expect
Look for the package named tree and its approved repository.command -v tree prints a path if installed, such as /usr/bin/tree.If absent, command -v prints nothing and returns status 1; this is expected.Install tree and Read the Confirmation Prompt
Choose Your DistributionThe package manager may propose supporting packages called dependencies. Read the complete list and download size. Confirm only if these changes fit your lab. APT normally accepts Y or n; DNF normally asks y/N. These commands deliberately leave the confirmation prompt enabled.
sudo apt install treesudo dnf install tree❯ What to expect
The package manager proposes an installation or reports it is already installed.After you approve, it downloads and installs the package.Version numbers, dependencies, and prompt wording vary.Check That the Program Works
Verify—version displays the installed program version. tree -L 1 lists only one level of your home folder; -L limits the depth. $HOME means your home directory. Quotes keep a path together if it contains spaces.
tree --versiontree -L 1 "$HOME"❯ What to expect
First: a tree version line.Then: your home directory and its immediate visible files and folders.Review and Apply Available Updates
Choose Your DistributionFirst list available updates. Then, when you are ready to update this lab, run the upgrade command and review its proposal. APT list —upgradable and DNF list —upgrades list candidates; the following upgrade command installs updates after confirmation. This updates packages within the current release, rather than upgrading to a new Linux release.
apt list --upgradablesudo apt upgradednf list --upgradessudo dnf upgrade❯ What to expect
Either a list of newer package versions or a message that nothing needs updating.Read any confirmation prompts and service or configuration notices.Optionally Remove Only the Practice Package
Choose Your DistributionSkip removal if tree was installed before this exercise or you want to keep it. Otherwise, request removal and read the proposed package list. Cancel if it includes anything you need. APT remove normally retains package configuration; purge also removes package-managed configuration and is not needed for this exercise.
sudo apt remove treesudo dnf remove tree❯ What to expect
A removal proposal naming tree and possibly unused dependencies.After removal, command -v tree normally prints nothing if no other copy exists.Optional: the same tasks on Arch Linux with Pacman
Arch uses a rolling release model. Start with a full system upgrade; read Arch news and its upgrade guidance first. -Syu refreshes repositories and upgrades the system together. Never use pacman -Sy followed by a package install to perform a partial upgrade.
sudo pacman -Syupacman -Ss '^tree$'pacman -Si treesudo pacman -S --needed treetree --version-Ss searches repositories, -Si displays package details, and --needed skips reinstalling an up-to-date package. To remove only the practice tool later, run sudo pacman -R tree and review the prompt. Stop if Pacman reports that other packages require it. Do not add dependency-override flags.
References and next steps
Your feedback keeps these production procedures accurate and battle-tested.