introduction to linux linux installation linux filesystem structure user and group management file permission command line interface package manager bash scripting conclusion
list



Package Manager

Linux, as an open-source operating system, offers a diverse ecosystem of distributions tailored to meet various user needs and preferences. Each Linux distribution, or distro for short, comes with its unique set of features, pre-installed software, and default package manager.

What is a package manager ?

A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner.

Why is Package Manager Important?

Package manager has many benefits:

  1. make the installation of packages and software easy, users can easily search for packages, choose and install them, this eliminates the need to install these packages manually.
  2. When installing a package or a software they need dependency to run, these dependencies can be a library, a framework or another package. When installing a software manually you also need to install his dependency and sometimes, you forget them. But when installing with a package manager it will automatically install the package dependency which saves time and effort.
  3. With a package manager you can update your system with one or two commands or a few clicks.
  4. uninstalling packages becomes easy with a package manager, instead of searching how to uninstall a package you just tell the package manager to do that.

Linux distro and package manager

There are many package manager, some of common used package manager are:

How to use package manager to search, install, uninstall packages

Before installing or updating packages, it's a good idea to update the package database first.Updating packages refers to synchronizing the local package database with the latest versions available in the repositories. It allows you to see what updates are available for installed packages but doesn't install those updates on your system. On the other hand, upgrading packages involves actually installing the latest versions of the installed packages. It goes beyond updating the package database and replaces the older versions with the newer ones, ensuring your system has the most up-to-date software.

NOTE: Most package managers need root privileges.

APT package manager:


Search:

To search for a package in apt, open a terminal and run: (be the root or use sudo)

apt search expression


you can also use regular expression

Install:

To install a package run

apt install package_name

package name is the name before “/” in this case there are two: dirsearch and erlang-mimerl You can also specify the name of the repository so, for example to install the dirsearch package you can use:

apt install dirsearch

or

apt install dirsearch/kali-rolling

Both of them work.

Uninstall:

To uninstall a package run

apt remove package_name

show package details:

apt show package_name

list packages based on package names:

apt list package_name

reinstall packages:

apt reinstall package_name

automatically remove all unused packages:

apt autoremove

Update the package lists for available software packages:

When you run

apt update

The package management system retrieves the latest information about available packages from the software repositories configured on your system. It downloads the updated lists of packages and their versions without actually installing or upgrading any packages.

Upgrade installed packages to their latest versions:

apt upgrade

The package management system checks for newer versions of the installed packages available in the repositories. It then downloads and installs the updated packages, effectively upgrading them to the latest versions.

Pacman package manager


Search:

To search for a package in pacman run:

pacman -Ss search_term

Install or reinstall:

To install or reinstall a package run:

pacman -S package_name

Uninstall:

pacman -R package_name

Show package details:

pacman -Qi package_name

Update package repo:

pacman -Syy

Upgrade packages:

pacman -Syu

Dnf package manager


Search:

dnf search package_name

Install:

dnf install package_name

Reinstall:

dnf reinstall package_name

Uninstall:

dnf remove package_name

Show package details:

dnf info package_name

Upgrade:

When you run this command

dnf upgrade

dnf will automatically update its repo before upgrading.

Yum package manager


Search:

yum search package_name

Install:

yum install package_name

Reinstall:

yum reinstall package_name

Uninstall:

yum remove package_name

Show package details:

yum info package_name

automatically remove all unused packages:

yum autoremove

Update all your packages:

yum update






DMCA.com Protection Status

© 2023 Aimed Guendouz