Understanding Linux Package Management: A Beginner's Guide

Basic Working Linux CLI Commands.

  • clear - Clear the Screen

  • hostname - To get the Host Name

  • sudo -i - To Elevate the access to root user.

  • apt update - To update the default system and security packages

Install a package

  • Installing GIT - Open Source Version Control System

    • sudo -i

    • apt install git -y

    • git --version

Guide to install a package

  • Package :

    • Can be executed as a Service - e.g., Tomcat/Nginx/Jenkins

    • Can be Executed as a Tool - e.g., Maven

  • We can run Start/Stop/Restart/Enable/Disable/Status in a service.

Let’s take example of Nginx

  • Enter the command apt install nginx -y to install Nginx.

  • Enter the command nginx -version to check if Nginx is installed and to see its version.

  • systemctl - Is a command line utility to manage the services running on Linux Machine

    • systemctl status nginx

    • systemctl stop nginx

    • systemctl start nginx

    • systemctl enable nginx - To make Nginx as a Startup Task

    • systemctl disable nginx - TO Remove from startup task list

  • Update the Package :

    • apt update nginx -y

    • apt upgrade nginx -y

  • which nginx - To get the installation path.

  • Manual Installation :

    • Download the Package :

      • wget # used to download the package

      • Extract using tar command in the specific directory.

  • Un-Installation of any Package :

    • apt remove nginx -y

      • apt remove nginx -y