Home > System Tutorial > LINUX > Check if Linux has a specific package installed

Check if Linux has a specific package installed

王林
Release: 2023-12-31 15:01:58
forward
1034 people have browsed it

There are many ways to install software in Linux systems, so there is no universal method to check whether a certain software has been installed. However, I have summarized some types below for your reference:

1. If the rpm package is installed, you can use rpm -qa to see it. If you want to find out whether a certain software package is installed, use rpm -qa | grep "the name of the software or package".

rpm -qa | grep ruby
Copy after login

2. If installed with deb package, you can use dpkg -l to see it. If you are looking for a specific software package, use dpkg -l | grep "the name of the software or package";

dpkg -l | grep ruby
Copy after login

3. If installed using the yum method, you can use yum list installed to search. If you are looking for a specified package, add | grep "software name or package name" after the command;

yum list installed | grep ruby
Copy after login

4. If you compile and install the source code package yourself, such as .tar.gz or tar.bz2, you can only check whether the executable file exists.

Neither of the above two methods can see the package installed in this source code form. If installed as the root user, the executable programs are usually in the /sbin:/usr/bin directory.

There are other methods, please indicate.

The following are the additions from other netizens

1. If the rpm package is installed, you can use rpm -qa to see it. If you want to find out whether a certain software package is installed, use rpm -qa | grep "the name of the software or package"

2. Installed with deb package, you can use dpkg -l to see it. If you are looking for a specific software package, use dpkg -l | grep "the name of the software or package"

3. If installed using the yum method, you can use yum list installed to search. If you are looking for a specified package, use yum list installed | grep "software name or package name"

The above is the detailed content of Check if Linux has a specific package installed. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template