Debian/Ubuntu (APT – Advanced Package Tool)
Install software:
sudo apt install vim
Update package lists:
sudo apt update
Upgrade installed packages:
sudo apt upgrade
Remove software:
sudo apt remove vim
Remove with configuration files:
sudo apt purge vim
Red Hat/CentOS/Fedora (YUM or DNF)
Install software:
sudo dnf install vim
(or yum on older systems)
Update installed packages:
sudo dnf update
Remove software:
sudo dnf remove vim
Other Package Systems
- Arch Linux (pacman):
sudo pacman -S vim # install
sudo pacman -R vim # remove
sudo pacman -Syu # full update
- openSUSE (zypper):
sudo zypper install vim
sudo zypper remove vim
sudo zypper update
Installing from Source
Some software is not available in repositories and must be compiled from source.
./configure
make
sudo make install
More complex and harder to maintain — use package managers when possible.
Repositories and Dependencies
Linux software installation relies on repositories (central storage locations of packages) and dependencies (other packages required for a program to run). Together, they make package management smooth and reliable.
What is a Repository?
- A repository is a collection of software packages available for installation.
- Maintained by the distribution (Ubuntu, Fedora, Arch, etc.) or by third-party developers.
- Package managers (like
apt,dnf, orpacman) fetch software directly from these repositories.
Types of repositories:
- Official repos → maintained by the Linux distro team (stable & secure).
- Universe/Community repos → community-maintained (Ubuntu:
universe, Arch: AUR). - Third-party repos → external vendors (e.g., Docker, Google Chrome).
What are Dependencies?
- A dependency is another package that a program needs to function.
- Example: Installing a video player might also install codecs and libraries.
- Without dependency management, you’d have to install these manually.
How package managers help:
- Automatically detect missing dependencies.
- Install them alongside the main package.
- Keep them updated as needed.
Examples
Ubuntu/Debian (APT)
Add a repository:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
Install software (dependencies are handled automatically):
sudo apt install vlc
Fedora (DNF)
Enable a repository:
sudo dnf config-manager --add-repo=https://download.docker.com/linux/fedora/docker-ce.repo
Install with dependencies:
sudo dnf install docker-ce
Arch (pacman + AUR)
Install from official repo:
sudo pacman -S firefox
From AUR (community repo, needs helper like yay):
yay -S google-chrome
Archiving & Compression (tar, gzip, zip, unzip)
Linux provides powerful tools to archive (bundle multiple files into one) and compress (reduce file size) data. These tools are essential for backups, sharing, and packaging software.
`tar` – Archiving Files
The tar command creates and extracts archives (commonly .tar files).
- Create an archive:
c→ createv→ verbose (show progress)f→ file name
tar -cvf archive.tar file1 file2 folder/
- Extract an archive:
tar -xvf archive.tar
- Create compressed archive (with gzip):
tar -czvf archive.tar.gz file1 folder/
- Extract compressed archive:
tar -xzvf archive.tar.gz
`gzip` – Compression
- Compress a file:
gzip file.txt # produces file.txt.gz
- Decompress a file:
gunzip file.txt.gz
`zip` and `unzip` – Windows-Compatible Archives
While tar is common on Linux, zip and unzip are widely used for cross-platform sharing.
- Create a zip archive:
zip archive.zip file1 file2 folder/
- Extract a zip archive:
unzip archive.zip