Find Package Name of Installed Ubuntu Package

28/12/2020

The user can install and uninstall any software in Ubuntu by using Ubuntu Software Center or command line. Many commands and programs are installed by default in Ubuntu. Sometimes the user needs to know the name of the package name of any installed program or command. This task can be done very easily by executing some commands from the terminal. How the user can find out the package name of any installed program or command using command line is shown in this tutorial.

Using app-file command

app-file is a useful command line tool that can be used to search the package name of any installed program of the Ubuntu operating system. This program keeps index of all the packages that are available in system repositories and allows the users to find out the package name by using name of the installed command or programs with  keyword that defines the location of the command or program. app-file command is not installed on Ubuntu by default. So you have to install this command first to use it. Press Att+Ctrl+T to open the terminal and write the following command to install it.

$ sudo apt-get install apt-file

After installation, execute the following command to update apt-file.

$ sudo apt-file update

Suppose, you have to find the package lists of calendar program, type the following command to find the package name list associated with this program.

$ sudo apt-file search calendar

Using dpkg command

Another most useful command of Ubuntu operating system is dpkg command. It is a low level tool that is mainly used to install, uninstall or provide information of any debian package file. Without these operations, the user can apply this command for many other purposes. This command can be used as the alternative to app-file command to find the package name of installed program or command. dpkg is installed by default in the Ubuntu operating system. So you don’t need to install it. To find the package name using dpkg command you have to write the command like the given format below. Here, the option –S indicates that command is used for searching.

dpkg –S <path/filename>

Suppose, you want to know the package name of the mostly used `cat` command. We know `cat` command is stored in ‘/bin’ folder. So you have to run the following command using dpkg to find the package name of ‘cat’ command. It is shown in the output that coreutils is the package name of the ‘cat’ command.

$ dpkg -S /bin/cat

There are many others use of dpkg command related to the package that are shown below. You can check these commands to get many others information about the packages. If you want to know the status information of any package then run dpkg command with – -s and package name.

$ dpkg –s coreutils

The output shows the details status information of the status, such as size, version, priority, status, pre-depends package name, commands list under this package etc.

Run the following command if you want to know the list of all installed packages of the system.

$ dpkg -l

Installed package list will be shown as output.

Run the following command if you want to count the total number of installed packages. Here, wc command is used to count the total package number.

$ dpkg -l|wc –l

You can also use dpkg command to check any package is installed or not. If the particular package is installed then it will show the list of all files related to the package with location. You an use the next command of dpkg to check C shell package is installed or not. The output indicates that C shell is not installed on the system.

$ dpkg -L csh

Use the following command to check PERL package is installed or not.

$ dpkg -L perl

By default PERL package is installed on Ubuntu. So the following output will appear after the execution of the command.

Using dpkg-query command

dpkg-query command can also search package name of any installed program or command from dpkg database. You can use –S or –search with this command to search any package based on keyword. Suppose if you want to know the package name of the ‘nano’ command then run the following command.

$ dpkg-query -Snano

If the nano program is installed on the system then the following output will appear.

The use of – -search option is shown in the following command where the package name of cp command is searched.

$ dpkg-query –search ‘/bin/cp

So, you can find out the package name of any installed program and details information about installed packages from command line by using above commands very easily.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Check for and Patch Spectre and Meltdown on Ubuntu

How to Check for and Patch Spectre and Meltdown Vulnerability on Ubuntu 17.10 Artful Aardvark Before I show you how to check...
12/02/2020

Install PgAdmin4 on Ubuntu

PgAdmin is a popular open source management and development tool which is released under PostgreSQL/Artistic license. Different...
12/02/2020

How to install Kodi 17.3 on Ubuntu 17.04, Ubuntu 16.04 & Linux Mint

Kodi 17.3 (Krypton) recently released, is a free open source media center for playing videos, music, pictures, games, and...
12/02/2020
Bài Viết

Bài Viết Mới Cập Nhật

Tìm Hiểu Về Thuê Proxy US – Lợi Ích và Cách Sử Dụng Hiệu Quả
11/12/2024

Mua Proxy V6 Nuôi Facebook Spam Hiệu Quả Tại Onetcomvn
03/06/2024

Hướng dẫn cách sử dụng ProxyDroid để duyệt web ẩn danh
03/06/2024

Mua proxy Onet uy tín tại Onet.com.vn
03/06/2024

Thuê mua IPv4 giá rẻ, tốc độ nhanh, uy tín #1
28/05/2024