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

How to install LibreOffice 5.4.0 Released on Ubuntu

LibreOffice 5.4.0 had just been released as the last major release of the LibreOffice 5.x family, and its available for install...
12/02/2020

How to Install Life is Strange Episode 1 on Ubuntu

What’s so special about Life Is Strange? Life is Strange – Episode 1 was one of the most sought-after story-telling...
29/12/2020

How to install PhpStorm 2017.1.4 on Ubuntu Linux OS

PhpStorm 2017.1.4 recently released, delivers bug fixes and improvements for PHP and the web platform, with improvements...
12/02/2020
Bài Viết

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

Lý do tại sao bạn nên sử dụng proxy khi truy cập web đen
27/02/2023

Các lỗi thường gặp khi sử dụng proxy và cách khắc phục chúng.
27/02/2023

Tác động của việc sử dụng proxy đến tốc độ kết nối internet của bạn.
27/02/2023

Các tiện ích và công cụ để quản lý proxy.
27/02/2023

Các cách để kiểm tra tốc độ và độ ổn định của proxy.
27/02/2023