- what is Linux ?
- Advantages of using Linux
- Disadvantages of using Linux
- Is linux for me?
- Who uses Linux and where
- what is virtualbox
- install virtualbox in Windows
- install virtualbox in MacOS
- install ubuntu in virtualbox
- install ubuntu on a computer
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:
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 |