How Beginners Can Install Packages and Applications on Linux
Linux can feel intimidating at first, but learning to install applications is a foundational skill that can quickly make the operating system feel more approachable. Here’s a simple guide for beginners to install packages on Debian-based (like Ubuntu) and Red Hat-based (like Fedora and CentOS) Linux distributions.
1. Installing Packages on Debian-Based Systems (Ubuntu, Linux Mint)
Debian-based distributions use APT
(Advanced Package Tool), a powerful package manager. With APT
, you can easily search, install, and remove packages.
Basic Commands for APT
- Update Package List: Before installing any package, it’s a good practice to update the package list. This ensures you get the latest versions:
sudo apt update
- Upgrade Installed Packages: To upgrade all the installed packages to their latest versions:
sudo apt upgrade
- Install a Package: To install a package (e.g., VLC media player):
sudo apt install vlc
- Remove a Package: To uninstall a package:
sudo apt remove vlc
- Search for a Package: If you’re unsure of the exact package name, you can search for it:
apt search package-name
APT handles dependencies automatically, so it will install any additional packages your chosen software needs to run.
2. Installing Packages on Red Hat-Based Systems (Fedora, CentOS, RHEL)
Red Hat-based distributions use DNF
or YUM
, depending on the version. For instance, CentOS 8 and Fedora use DNF
, which is a more modern package manager. Here are some key commands:
Basic Commands for DNF (or YUM for older versions)
- Update Package List: On Red Hat-based systems, this command checks for any updates to your installed packages:
sudo dnf check-update
- Install a Package: To install a package with
DNF
(e.g., GIMP image editor):
sudo dnf install gimp
For older systems using YUM
, the command would be:
sudo yum install gimp
- Remove a Package: To uninstall a package:
sudo dnf remove gimp
- Search for a Package: To search for available packages:
dnf search package-name
3. Installing Software from External Repositories
Some applications aren’t available in your distribution’s default repositories. In that case, you might need to add an external repository or download a .deb
(for Debian) or .rpm
(for Red Hat) file directly from the software provider.
For Debian-based distributions:
sudo dpkg -i package-name.deb
For Red Hat-based distributions:
sudo rpm -i package-name.rpm
After manually installing, you may need to resolve dependencies with:
sudo apt --fix-broken install
or
sudo dnf install -y
4. Using Flatpak and Snap
For apps not found in traditional repositories, both Debian and Red Hat-based systems can use Flatpak and Snap. These tools provide sandboxed, universal packages that work across different Linux distributions.
- Install Snap on Ubuntu (Debian-based):
sudo apt install snapd
Then, install a package (e.g., VLC) with:
sudo snap install vlc
- Install Flatpak (Both Debian and Red Hat-based):
sudo apt install flatpak # Debian-based
sudo dnf install flatpak # Red Hat-based
- Once installed, search and install apps from Flathub, the main Flatpak repository.
5. Graphical Package Managers
For those who prefer a graphical interface, most distributions come with a package manager like GNOME Software or Discover (KDE). These tools make it easy to search, install, and manage applications without needing to use the terminal.
Conclusion
Installing software on Linux might seem complex at first, but with a few simple commands, you’ll be able to get any application you need. Whether using APT, DNF, or a package from Flatpak or Snap, these tools make Linux systems adaptable and powerful.