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

Mine Etherium With Ethminer on Ubuntu

Introduction Digital cryptocurrency is not a new topic in the technology world due to its widespread usage. For some time,...
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

Get Premier League and Soccer Scores with LiveScore-CLI on Ubuntu

Get up to date Premier League Live football scores right from the linux terminal with livescore-cli. Livescore is a small...
12/02/2020
Bài Viết

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

Mua proxy v4 chạy socks5 để chơi game an toàn, tốc độ cao ở đâu?
18/05/2024

Thuê mua proxy Telegram trọn gói, tốc độ cao, giá siêu hời
18/05/2024

Thuê mua proxy Viettel ở đâu uy tín, chất lượng và giá tốt? 
14/05/2024

Dịch vụ thuê mua proxy US UK uy tín, chất lượng số #1
13/05/2024

Thuê mua proxy Việt Nam: Báo giá & các thông tin MỚI NHẤT
13/05/2024