In this tutorial, we’ll be covering packages, package managers and how to find, install and remove software for most popular Linux distributions.
Typically when you install software in a Linux system you do so with a package. A package is just a collection of files that make up an application. Additionally, a package contains data about the application as well as any steps required to successfully install and remove that application.
The data or metadata that is contained within a package can include such information as the description of the application, the version and the list of dependencies or other packages that this particular application needs in order to function.
A package manager is used to install, upgrade and remove packages. The package manager uses a package’s metadata to automatically install any required dependencies. Package managers keep track of what files belong to what packages, what packages are installed and what versions of those packages are installed.
Here’s a list of distributions that are based on the RPM package format. RPM stands for RedHat Package Manager.
The yum command-line utility is a package management program for those Linux distributions that use rpm packages.
Note: Installing or removing software requires root or superuser privileges.
yum search stringyum info [package]yum install [package]yum will typically ask you to review your request and say yes or no. If you want to continue to automatically answer yes to yum’s question use:
yum install [-y] [package]yum remove [package]In addition to the yum command, you can also use the rpm command to interact with the package manager.
rpm -qarpm -qf with path to a file will tell you what file a package belongs to.
rpm -qf /path/to/fileList all the files that belong to that particular package
rpm -ql [package]rpm -ivh package.rpmrpm -e [package]Another popular package format is the Debian package format. In addition to Debian, distributions like Mint and Ubuntu use deb packages.
The Debian-based distributions use a package manager called apt (advanced packaging tool). apt is comprised of a few small utilities with the two most commonly used being apt-cache and apt-get.
apt-cache search stringapt-get install [-y] [package]apt-get remove [package]apt-get purge [package]apt-cache show [package]In addition to the app utilities, you can use the dpkg command to interact with the package manager.
dpkg -ldpkg -S /path/to/filedpkg -L [package]dpkg -i package.debWatch the video for live examples of searching, installing and removing some actual software like Dropbox using the above mentioned methods.
Packages are used to install software on Linux system. You can manipulate packages with a package manager. Two of the most popular package formats are RPM and Debian. For RPM-based distributions use the yum and rpm commands to manage packages. For Debian-based distributions use apt and dpkg to manage packages.
Also see: Install deb file from command line
Help us improve this content by editing this page on GitHub