Package Management In Debian(.deb) Based Linux Distributions

Package Management In Debian(.deb) Based Linux Distributions

Software Package

A software package is an archive file of compiled and built source code with necessary metadata for its deployment. The metadata of the package consist of dependencies, package version, and about the software. For example – the .deb packaging is used for Debian based Linux Distributions while .rpm packaging is used in Red Hat, Fedora, and other related distributions.


Package Manager

A package manager is a collection of software tools that automate the process of installation, configuration, up-gradation and removal of software packages in an operating system. It keeps the information about dependencies and software version to avoid the inconsistency and version mismatch. These are designed to increase the user-friendliness of the system as it removes the need for manual installation, update and removal of a software package.


Advanced Packaging Tools(apt)

The apt provides a command-line interface to interact with core libraries of OS for the installation, up-gradation, and removal of a package. It can be considered as the front end to dpkg which is used in Debian, Ubuntu, and its derived Linux distributions. A .deb packaged software is used in these systems. Some important commands related to apt are given below:

apt-get Commands-

apt-get install package_name – This command is used to install package(s) along with dependencies
apt-get remove package_name – Used to remove the installed packages
apt-get autoremove – Remove the dependencies that are no longer needed
apt-get clean – Remove the downloaded software files that are already installed
apt-get purge package_name – This will remove the software and clean modified user configuration files that were left after the removal of software.
apt-get update– Used to download the package information from the all configured sources.
apt-get upgrade – Used to install available upgrades of all packages currently installed on the system form the source configured via source.list which resides in /etc/apt directory it should run after update.

apt-cache Commands-

apt-cache search package_name – Search performs a full-text search on all available package lists and shows a list of related packages and their description
apt-cache show package_name – Shows description of dependencies, version, size, origin, etc.
apt-cache pkgnames – Shows the complete list of installed software on the system
apt-cache depends package_name – Shows the listing of each dependency a package has and all the possible other packages that can fulfill that dependency
apt-cache rdepends package_name – Shows a listing of each reverse dependency a package has.

Difference between apt and apt-get commands-

The first version of apt binary was introduced in Debian Jessie(version 8), the functionality of apt-get and apt-cache get merged into the new apt tool which has fancier colored output and is more pleasant for the end-users. That means some popular commands like apt-get update, apt-get install, apt-cache search or apt-get remove now can also be simply called as apt update, apt install, apt search or apt remove. The following is an overview of the old and their equivalent new commands:

 

OLD COMMANDS NEW COMMANDS
apt-get update apt update
apt-get upgrade apt upgrade
apt-get dist-upgrade apt full-upgrade
apt-get install package_name apt install package_name
apt-get remove package_name apt remove package_name
apt-get autoremove apt autoremove
apt-cache search string apt search string
apt-cache policy package_name apt list -a package_name
apt-cache show package_name apt show package_name
apt-cache showpkg package_name apt show -a package_name

Please note that for usage in scripts or advanced use cases, apt-get is still preferable or needed. It is the preferred program for package management from console to perform system installation and major system upgrades.


Debian Package(dpkg)

It is also used to install, remove and perform such other operations on .deb file. The dpkg is a low-level tool it works with downloaded files unlike apt which can fetch the packages from a remote location and can resolve dependencies.

dpkg Commands-

dpkg -i downloaded_package_name.deb – Install a .deb file that is stored in systems memory.
dpkg --list string_to_search – list the related packages that are installed on a system
dpkg --unpack package_file_name – Unpack the downloaded file but not configure it
dpkg --configure package_name – Configure a package which has been unpacked but not yet configured
dpkg --reconfigure package_name – It will reconfigure the installed package.

For more such command you can access the dpkg manual page in your terminal by using $man dpkg command.


Aptitude

Aptitude is a high-level interface to the package manager. It provides a terminal menu interface that is not provided by apt. It is a transaction based package management service. If you consider only command-line interfaces apt and aptitude are quite similar to each other. Installation, removal, up-gradation of a package can be performed with a single key command. To access the aptitudes terminal menu type the command $sudo aptitude into your terminal and press the enter.

Now the terminal menu will look something like this-

To install updates select from the menu and press u, to quit from the aptitude menu press q and select yes it will bring you to the command prompt.

Previous Process Management In Linux/Unix
Next Package Management In RPM(.rpm) Based Linux Distributions

About author

You might also like

Uncategorized 0 Comments

Virtualization In Linux With Xen

0.0 00 Virtualization Technology Virtualization means creating a virtual version of something like computer hardware, storage devices, and network resources, etc. It allows you to create multiple simulated environments from

Uncategorized 0 Comments

How to Fix Windows And Linux Showing Different Time In A Dual Boot System

0.0 00 There are many users who use a dual boot computer. Dual-booting Linux with Windows operating system has various advantages like both the operating systems have full access to

Uncategorized 0 Comments

How To Change Default Settings Of Grub Bootloader?

0.0 00 Grub Grub is a bootloader that is used to manage the multiple operating systems installed on a computer. A boot loader is the first program that runs when

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply