Linux find package path

How to find out if package is installed in Linux

Debian / Ubuntu Linux

Use dpkg command. It is a package manager for Debian/Ubuntu Linux. Suppose you want to find out package apache-perl or sudo is installed or not, type command:
$ dpkg -s apache-perl
Sample outputs:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Another example:
$ dpkg -s sudo
Sample outputs:

Use file /var/lib/dpkg/available to find out all package names available to you. Or you can use following command (list all packages in /var/lib/dpkg/status):
$ dpkg-query -l
You can also try to match package name using wild cards:
$ dpkg-query -l ‘libc6*’
Once you’ve found package name, use the following command to get exact status (whether it is installed or not):
$ dpkg-query -W -f=’$ $\n’ apache-perl
Sample outputs:

Red Hat Enterprise / Fedora Linux / Suse Linux / Cent OS

Under Red Hat/Fedora/CentOS/Suse Linux use the rpm command:
$ rpm -qa | grep For example find out package mutt installed or not:
$ rpm -qa | grep mutt
Output:

If you do not see or get any outputs (package name along with version), it means the package is not installed at all. You can display or list all installed packages with the following command:
$ rpm -qa
$ rpm -qa | less
You can conditionally do something if a rpm command succeeded or failed to find package using bash shell if command:

On a CentOS/RHEL version 6.x/7.x and above use the following yum command to tell whether a package named htop is installed:
$ yum list installed
$ yum list installed htop
Sample outputs:

If you are using Fedora Linux, try the following dnf command:
$ dnf list installed
$ dnf list installed htop

See also:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

This is my first massage over here& i hope i will get full support.

How to open usermap.cfg file on NetApp server?- As i have to check whether unix user login is mapped correctly with Windows login.

As the main problem which few of the users are having is as below —

They are NOT able to map from Windows any network
drive (unix accounts) due to they have not access to their share drive.

It ask me for login and password, BUT earliear it never asked me for my windows login and password . It’s been working till the end of the year 2006.

Please suggest solutions—–

Many thanks in Advance

just a small addition –

on Gentoo Linux just do a:

or
cat /var/lib/portage/world

on CentOS or other “yum”-based systems:

yum list installed

how to see the programs and features in redhat linux (e.g– in windows we can check the same through control panel–progrmas)

@john: On RedHat – which is a rpm package management based distribution – you should can use i.e.:

to list all installed packages or

to get out details about the installed package.

how do i verify packages that are installed without using rpm, i mean recently i installed squid using make, make all, configure configure-install

after this, how do I check this package is installed?

…this is not possible as installing “by hand” (make install) has nothing to do with a “package” nor package management.

To find out if i.e. squid was installed just try to locate the squid binary by where, locate or find, even if you build and install software from sources by make.

If you use a port management system from i.e. pkgsrc, getoo portage or even FreeBSD the port management counts each modified and installed file of a port to make it possible to see which file belongs to which port (package) or which are installed etc.

this might be another story.

Thank you very much, I have another issue, I have Installed texlive but I still get an error message in my crm ” pdf latex not installed”, so do you know how check if any software is installed or not ? It’s different from packages, isn’t it ?

If you have a list of packages you want to query, it’s much easier to just list them instead of using grep:

rpm -q automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel

Why such a complicated command for rpm-based systems? On my machine (Fedora 20), I can just run rpm -q $, and it’s *much* faster since it doesn’t need to list every package on the system and then grep through it:

[blong@blong-desktop tmp]$ rpm -q vala; echo $?
vala-0.22.1-1.fc20.x86_64
0
[blong@blong-desktop tmp]$ rpm -q missing-package; echo $?
package missing-package is not installed
1

Is this a new feature?

In Debian based distros like Ubuntu, you can find out if a package is installed with:

apacheInstalled=$(dpkg -s apache2 | grep ‘Status: install ok installed’| wc -l)
#change apache2 to the package you are checking for. returns 1 if installed, 0 otherwise.
#script does not have to be running as root… but to change installed stuff… it would.

Источник

How can i find the location of installed software in linux?

Is there any command that I can use in the console to know the location of installed software in linux?

i have copied a xyz.bin from windows machine to linuxdesktop and installed it.

more over can you please tell me how to uninstall a software which is installed in linux

Thanks in advance

3 Answers 3

You may want to use

to find the path where the binary is linked to.

Other application specific files may reside in

The way a package is installed/uninstalled on Linux depends on either the specific Linux distribution AND the specific package.

Since you have used a .bin file for installation, it is likely that you have an uninstall command specific for your program in the path.

If you provide more information about the package and the Linux distribution, we can give more help.

It depends on the distribution you’re using. Supposing you are using a debian\ubuntu distribution, you can uninstall it by the apt command, using sudo apt-get remove software_name sudo apt-get purge software_name

Of course you need to have root privileges.

The softwares are usually installed in bin folders, in /usr/bin, /home/user/bin and many other places, a nice starting point could be the find command to find the executable name, but it’s usually not a single folder. The software could have components and dependencies in lib,bin and other folders.

Источник

How to find application’s path from command line?

For example, I have git installed on my system. But I don’t remember where I installed it, so which command is fit to find this out?

5 Answers 5

If it is in your path, then you can run either type git or which git . The which command has had problems getting the proper path (confusion between environment and dot files). For type , you can get just the path with the -p argument.

If it is not in your path, then it’s best to look for it with locate -b git It will find anything named ‘git’. It’ll be a long list, so might be good to qualify it with locate -b git | fgrep -w bin .

The POSIX standard way to do this is command -v git . All UNIX-like systems should support this.

whereis git and you get the path to the command.

that is just if the git is in you PATH variable, in case you have installed it not through you package manager, it is more complex and you should use the find or locate commands.

The other answers here seem to be largely geared towards modern versions of Linux, so if you happen to use git on an OS that doesn’t have locate , whereis , which , or apropos (like Solaris, HPUX, etc), then there is always the old standby find .

One some older versions of the systems listed above, you may need a -print option supplied to find .

Источник

How do I find the package that provides a file?

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.

Bonus question: what if it’s a file that isn’t installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?

10 Answers 10

You can use dpkg command to find out which installed package owns a file:

You can either search with a full path or with just the filename.

If you wish to search for files not yet installed on your computer, you can use the Ubuntu Packages Search, or apt-file as described in a different answer.

The apt-file command can do this for you from the command line. I use it frequently when building packages from source. For files provided by packages that are already installed on your system, apt-cache is another choice.

To install apt-file , do:

Then, you need to update it’s database:

And, finally, search the file:

However a much friendlier way is to use the Ubuntu Packages Search website. They have an option to «search the contents of packages» for a specific filename.

There’s also apt-file for looking up files in packages that aren’t installed. For example:

You can search the contents of packages included in the various Ubuntu releases on the Ubuntu Packages website. Look under the heading «Search the contents of packages».

For example, here are the search results for libnss3.so in focal (20.04):

You mean, which package and not which application. The application is your package manager, e.g. Software Center .

or also possible:

Or online here, in the section Search the contents of packages .

This is an extension to Alexx Roche’s excellent answer. I tried to make an edit to that answer, but it got rejected (though not by Alexx)

I was trying to track down what installed which on my system. After a little work I created /usr/local/bin/apt-whatprovides

Though for most THINGs that are installed you can just use:

For THINGs that are not installed, you can use:

The apt-whatprovides script works for files that are and are not on your system. For example, my system lacked dig but had ping so this it what resulted:

Источник

Читайте также:  Версии майл ру агента для windows
Оцените статью