# Understanding Package Manager

### [What is a package manager in Linux?](https://github.com/Sumitkatkar/90DaysOfDevOps/blob/master/2023/day07/README.md#what-is-a-package-manager-in-linux)

In simpler words, a package manager is a tool that allows users to install, remove, upgrade, configure and manage software packages on an operating system. The package manager can be a graphical application like a software center or a command lines tool like apt-get or Pacman.

You’ll often find me using the term ‘package’ in tutorials and articles, To understand package manager, you must understand what a package is.

### [What is a package?](https://github.com/Sumitkatkar/90DaysOfDevOps/blob/master/2023/day07/README.md#what-is-a-package)

A package is usually referred to an application but it could be a GUI application, command line tool or a software library (required by other software programs). A package is essentially an archive file containing the binary executable, configuration file and sometimes information about the dependencies.

### Different types:

1. **APT (Advanced Package Tool):** APT is a package manager commonly used in Debian-based Linux distributions. It simplifies software installation, upgrade, and removal by resolving dependencies automatically.
    
2. **npm (Node Package Manager):** Npm is specifically designed for JavaScript development. It is the default package manager for Node.js and is widely used for managing JavaScript libraries and tools.
    
3. **pip:** Pip is the package manager for Python. It simplifies the installation and management of Python packages, making it a crucial tool for Python developers.
    
4. **Docker:** Docker is a containerization platform that includes its own package manager for container images. It simplifies the packaging and distribution of applications, making them portable across different environments.
    

### **Package Manager Commands:**

1. **APT (Advanced Package Tool):**
    
    * Update package list: `sudo apt update`
        
    * Install a package: `sudo apt install package_name`
        
    * Remove a package: `sudo apt remove package_name`
        
    * Search for a package: `apt search package_name`
        
2. **npm (Node Package Manager):**
    
    * Install a package locally: `npm install package_name`
        
    * Install a package globally: `npm install -g package_name`
        
    * Update a package: `npm update package_name`
        
    * Search for a package: `npm search package_name`
        
3. **pip (Python Package Manager):**
    
    * Install a Python package: `pip install package_name`
        
    * Upgrade a Python package: `pip install --upgrade package_name`
        
    * Uninstall a Python package: `pip uninstall package_name`
        
    * Search for a package: `pip search package_name`
        
4. **Docker:**
    
    * Pull a Docker image: `docker pull image_name`
        
    * Run a Docker container: `docker run container_name`
        
    * Build a Docker image: `docker build -t image_name .`
        
    * List Docker containers: `docker ps`
