OS: Linux Package Management

Linux software is usually managed through package managers, which handle installing, updating, and removing programs. Instead of downloading .exe files (like in Windows), you install from official repositories maintained by your distribution.

Debian/Ubuntu (APT – Advanced Package Tool)

Install software:

bash
sudo apt install vim

Update package lists:

bash
sudo apt update

Upgrade installed packages:

bash
sudo apt upgrade

Remove software:

bash
sudo apt remove vim

Remove with configuration files:

bash
sudo apt purge vim


Red Hat/CentOS/Fedora (YUM or DNF)

Install software:

bash
sudo dnf install vim

(or yum on older systems)

Update installed packages:

bash
sudo dnf update

Remove software:

bash
sudo dnf remove vim


Other Package Systems

  • Arch Linux (pacman):
  • bash
    sudo pacman -S vim      # install
    sudo pacman -R vim      # remove
    sudo pacman -Syu        # full update

  • openSUSE (zypper):
  • bash
    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.

bash
./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?

  • 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 aptdnf, or pacman) 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?

  • 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:

bash
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Install software (dependencies are handled automatically):

bash
sudo apt install vlc

Fedora (DNF)

Enable a repository:

bash
sudo dnf config-manager --add-repo=https://download.docker.com/linux/fedora/docker-ce.repo

Install with dependencies:

bash
sudo dnf install docker-ce

Arch (pacman + AUR)

Install from official repo:

bash
sudo pacman -S firefox

From AUR (community repo, needs helper like yay):

bash
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:
  • bash
    tar -cvf archive.tar file1 file2 folder/

  • c → create
  • v → verbose (show progress)
  • f → file name
  • Extract an archive:
  • bash
    tar -xvf archive.tar

  • Create compressed archive (with gzip):
  • bash
    tar -czvf archive.tar.gz file1 folder/

  • Extract compressed archive:
  • bash
    tar -xzvf archive.tar.gz


`gzip` – Compression

  • Compress a file:
  • bash
    gzip file.txt   # produces file.txt.gz

  • Decompress a file:
  • bash
    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:
  • bash
    zip archive.zip file1 file2 folder/

  • Extract a zip archive:
  • bash
    unzip archive.zip