Installing and Managing Software
On Windows you download an installer from a website and run it. On Linux you almost never do that. Instead you use a package manager — and once you understand why, you will not want to go back.
Series: Learning Linux from Scratch
- 1. Learning Linux from Scratch — After a Full IT Apprenticeship
- 2. What is Linux?
- 3. The Filesystem
- 4. Users and Permissions
- 5. Installing and Managing Software
- 6. Text Editors
- 7. Shell Scripting Basics
- 8. Process Management
- 9. Networking Fundamentals
- 10. SSH
- 11. systemd and Services
- 12. Disk Management
- 13. Users and Groups — In Depth
- 14. Cron and Scheduled Tasks
- 15. Firewall — iptables and ufw
- 16. Environment Variables and the Shell
- 17. Log Management
- 18. Kernel Module Management
- 19. The /proc Filesystem — In Depth
- 20. The /sys Filesystem and udev
- 21. Kernel Parameters and sysctl
- 22. Compiling and Installing a Custom Kernel
On Windows you download an installer from a website and run it. On Linux you almost never do that. Instead you use a package manager — and once you understand why, you will not want to go back.
What is a package manager?
A package manager is a tool that installs, updates, and removes software on your system. It talks to a central repository — a server maintained by your distribution — that contains thousands of programs ready to install with a single command.
Instead of googling "download VLC", navigating to a website, clicking through an installer, and hoping it does not bundle unwanted software, you just type:
sudo apt install vlcThat is it. The package manager finds the software, downloads it, installs it, and handles any dependencies it needs to run.
Why this is better than downloading installers
A few reasons.
Every package in the official repository has been vetted by the distribution maintainers. You are not downloading executables from random websites and hoping they are safe.
Dependencies are handled automatically. If a program needs another library to run, the package manager installs that too. On Windows, dependency management is largely your problem.
Updating everything on your system is a single command. One line updates the entire OS and every installed program at once.
Removing software is clean. The package manager knows exactly what it installed and removes it properly, instead of leaving leftover files scattered across your system.
The main package managers
Different distribution families use different package managers. This is one of the most practical reasons the family tree from the second post matters.
apt — Debian and Ubuntu based systems
sudo apt update # refresh the list of available packages
sudo apt upgrade # install available updates
sudo apt install firefox # install a package
sudo apt remove firefox # remove a package
sudo apt search vlc # search for a package by nameAlways run apt update before installing something. Without it, apt is working from a cached list that may be outdated.
dnf — Red Hat, Fedora, and related systems
sudo dnf check-update # check for updates
sudo dnf upgrade # install updates
sudo dnf install firefox # install a package
sudo dnf remove firefox # remove a package
sudo dnf search vlc # search for a packagepacman — Arch and Arch-based systems
sudo pacman -Syu # update the system
sudo pacman -S firefox # install a package
sudo pacman -R firefox # remove a package
sudo pacman -Ss vlc # search for a packagePacman uses flags instead of subcommands. -S is sync (install), -R is remove, -Q is query your local package database.
A practical example
Here is a full workflow on a Debian-based system. You want to install htop, a terminal-based system monitor.
sudo apt update
sudo apt install htop
htopThree commands. The system is now updated and htop is running.
To remove it later:
sudo apt remove htopPackage managers are one of the things Linux gets genuinely right. Once you are used to installing software this way, going back to hunting for installers on websites feels like a step backwards.
Next up: text editors — how to edit files directly in the terminal without a GUI.