Searching for yum packages and dependencies

General support questions
Post Reply
expmrb
Posts: 26
Joined: 2019/02/19 14:31:35

Searching for yum packages and dependencies

Post by expmrb » 2019/03/31 17:14:56

I am new to linux (& learning). And I want to run my sites through CentOS via VPS.

Now I know that in order to install apache I need to do the command "yum install httpd". But what if I didn't know the command then how can I search for it?

And also if there are dependencies then how can I find and install them?

hunter86_bg
Posts: 2015
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Searching for yum packages and dependencies

Post by hunter86_bg » 2019/03/31 19:21:02

Imagine that you know the binary called 'smartctl' , but you don't know the package that provides it.
You can run:

Code: Select all

yum whatprovides "*/smartctl"
If you know the whole path you can run it like this:

Code: Select all

yum whatprovides /bin/bash
Both will output any package that matches the searched pattern - and that could be more than 1 package .

About the dependencies - you have 'yum' for that.
Of course you can download the package:

Code: Select all

yum --downloadonly install packagename
Then play with rpm's query to list the dependencies of that package.
Note: Yum saves all packages in /var/cache/yum.

expmrb
Posts: 26
Joined: 2019/02/19 14:31:35

Re: Searching for yum packages and dependencies

Post by expmrb » 2019/04/01 04:50:51

Sorry, but what I am asking that if I needed to install apache and mysql. And I don't know the correct package names then should I run 'yum search apache' or 'yum search mysql'?

User avatar
jlehtone
Posts: 2781
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Searching for yum packages and dependencies

Post by jlehtone » 2019/04/01 06:24:54

You can, but those lists are long.

The name of apache package is 'httpd'.

For mysql, try 'mariadb'.

expmrb
Posts: 26
Joined: 2019/02/19 14:31:35

Re: Searching for yum packages and dependencies

Post by expmrb » 2019/04/01 11:05:41

jlehtone wrote:
2019/04/01 06:24:54
You can, but those lists are long.

The name of apache package is 'httpd'.

For mysql, try 'mariadb'.
And for any dependencies in the case of MySQL?

User avatar
jlehtone
Posts: 2781
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Searching for yum packages and dependencies

Post by jlehtone » 2019/04/01 11:14:16

Sorry, the 'mariadb' has only client and common files. The server binary is in 'mariadb-server'.

Code: Select all

sudo yum install mariadb-server
will install all the packages that the mariadb-server depends on, for example the 'mariadb'.

Yum does show what it will install and requests for confirmation.

expmrb
Posts: 26
Joined: 2019/02/19 14:31:35

Re: Searching for yum packages and dependencies

Post by expmrb » 2019/04/01 12:15:54

Say if I don't know any package name then shall the 'yum search' option work?

scottro
Forum Moderator
Posts: 2450
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Searching for yum packages and dependencies

Post by scottro » 2019/04/01 12:27:55

It might. Or you can try the provides option mentioned above. Using yum search may bring you a long list. As for finding dependencies, as has been mentioned, if you type say, yum install httpd, it will show you what will be downloaded and installed and ask if you to type y (for yes) if you do want to install it.

If you have no idea of the package name, and yum search doesn't help, then google something like, apache centos-7 and something will probably turn up giving the name of the package. If you have a specific project, such as an apache server with mysql, googling centos-7 apache mysql tutorial will probably get you a tutorial, telling you what to install.
New users should check the FAQ and Read Me First pages

expmrb
Posts: 26
Joined: 2019/02/19 14:31:35

Re: Searching for yum packages and dependencies

Post by expmrb » 2019/04/02 03:38:18

scottro wrote:
2019/04/01 12:27:55
It might. Or you can try the provides option mentioned above. Using yum search may bring you a long list. As for finding dependencies, as has been mentioned, if you type say, yum install httpd, it will show you what will be downloaded and installed and ask if you to type y (for yes) if you do want to install it.

If you have no idea of the package name, and yum search doesn't help, then google something like, apache centos-7 and something will probably turn up giving the name of the package. If you have a specific project, such as an apache server with mysql, googling centos-7 apache mysql tutorial will probably get you a tutorial, telling you what to install.
Got it. Thanks.

Post Reply

Return to “CentOS 7 - General Support”