Skip to content

Software/Package Management

image.png

A Software Package is a compressed archive containing the application and its instructions. A Package Manager is the tool that automates installing, configuring, and removing these archives.

Linux distributions generally fall into two camps based on their package format:

FamilyPackage ExtensionLow-level ToolHigh-level Tool (Automated)
Debian Based (Ubuntu, Mint).debdpkgapt / apt-get
Red Hat Based (Fedora, CentOS).rpmrpmyum / dnf

Used in Debian-based systems. It handles “dependencies”—if App A needs App B to run, apt finds and installs both automatically.

  • update: Refreshes the list of available software from the internet. Run this first.
  • upgrade: Installs the newest versions of all your currently installed packages.
  • install [pkg]: Downloads and installs a specific program (e.g., apt-get install vim).
  • remove: Uninstalls the program but keeps your settings files.
  • purge: Deletes the program and all its configuration files.
  • search [keyword]: Finds programs related to your keyword.
  • show [pkg]: Displays details like the version, size, and description of a package.
  • depends [pkg]: Lists every other piece of software required for this package to work.

Your computer doesn’t just “know” where to find software. It looks at specific text files to find the URL of “Repositories” (App Stores for Linux).

  • File Path: /etc/apt/sources.list and files inside /etc/apt/sources.list.d/.
  • Daily Use: If you need to install specialized software like Docker or Kubernetes, you usually have to add their “source” URL to these files first so apt knows where to look.

  • Setting up a new system: sudo apt update && sudo apt upgrade ensures everything is fresh.
  • Fixing errors: Use sudo apt-get check to find broken installations.
  • Cleaning space: Use sudo apt-get purge for apps you never want to see again, including their leftover settings.

yum list installed → to see all the installed packages

yum install package

yum remove package

yum check-update - lists new versions ALL Pakcages

yum check-update <package> → specific update

yum update <package> → if package is not cpeified updates all

yum search httpd → search installed pack in repo

info → used to get info about specific pack

image.png

gpgcheck - 0/1 specifies key check for integrity of downloaded packages

installonly… → max no.of verions of same package installed in system

clean_req… →

best → only latest version of package if error install prev. version

skip_.. →

The alternatives system (often used as update-alternatives on Debian/Ubuntu) allows you to have multiple versions of the same software (like Java 8, 11, and 17) installed at once and choose which one is the “active” default.

  • *alternatives [options] --install link name path priority [--slave link name path]... [--initscript service]*
  • *alternatives [options] --remove name path*
  • *alternatives [options] --set name path*
  • *alternatives [options] --auto name*
  • *alternatives [options] --display name*
  • *alternatives [options] --config name*
  • What it does: It uses symbolic links (shortcuts) to point a generic command (like /usr/bin/java) to a specific versioned folder.
  • Key Command: alternatives --config <name> (e.g., alternatives --config java).
  • How it works: 1. It shows a numbered list of all installed versions.
  1. The current version is marked with a or +.
  2. You type the number of the version you want to use and hit Enter.

Java is a programming platform that requires specific environments to run or build applications.

  • JDK (Java Development Kit): The full toolkit for developers. It includes the JVM (Java Virtual Machine) to run code and tools to compile/build Java apps.
  • OpenJDK: The free, open-source implementation of the Java platform (GPL licensed). Most Linux users use OpenJDK instead of the Oracle proprietary version.
  • Installation: In modern Linux, you install it just like any other package:
    • sudo apt install openjdk-11-jdk (For Java 11).

  • Fixing Version Conflicts: If a project requires Java 8 but your system has Java 17, use sudo update-alternatives --config java to swap back and forth in seconds.
  • Adding New Manual Installs: If you download a specific version of a tool (like a custom Python build), use -install to register it into the alternatives system so you can manage it easily.
  • Development Setup: Always install the openjdk-X-jdk package if you are writing code, or just the jre (Java Runtime Environment) if you only need to run a Java program.