If you want to install a software application but do not know the name of the software package, you can use the tools in the Linux system to search for the package. This topic describes the commands that you can use to search for software packages and how to use these commands on different Linux distributions.
Search for software packages on CentOS
- Command
yum search [keywords of software packages]
- Examples
- Example 1: Search for two software applications with the keywords "rz" and "sz".
Run the following command to search for the software packages to which the two applications belong.
The command result indicates that these two software applications belong to theyum search sz rz
lrzsz.x86_64
package, as shown in the following figure. After you install the package, you can use thelrz
andlsz
software applications. - Example 2: Search for a software application by using the keyword "mysql-community-server".
Run the following command to search for the software package to which the application belongs.
The command result indicates the package to which the software application belongs, as shown in the following figure.yum search mysql-community-server
Note If you cannot find the mysql-community-server package in the CentOS operating system, it may be because you have not added the repository of the software package. For more information about how to add the required software repository, and install and use MySQL Server, see Use MySQL on ECS.
- Example 1: Search for two software applications with the keywords "rz" and "sz".
Search for software packages on Debian or Ubuntu
- Command
apt-cache search [keywords of software packages]
- Examples
- Example 1: Search for software packages relating to Web servers.
Run the following command to search for the software packages.
The command result indicates that apache2 is the software package of the Web server, as shown in the following figure.apt-cache search "web server"
- Example 2: Search for Java development environment by using the keyword "openjdk".
Run the following command to search for "openjdk".
The command result shows the software packages relating to openjdk, as shown in the following figure.apt-cache search openjdk
- Example 1: Search for software packages relating to Web servers.
Next steps
After you find the software packages, you may need to install them. For more information about how to install software packages, see Install software packages.