How to find which package certain command belongs to on CentOS?
up vote
15
down vote
favorite
For example I can easily find locate command belongs to mlocate.i386 package.
yum search locate
mlocate.i386 : An utility for finding files by name
[mirror@home /]$ rpm -qa | grep locate
mlocate-0.15-1.el5.1
yum search updatedb
Loaded plugins: fastestmirror, protectbase
0 packages excluded due to repository protections
=========================================== Matched: updatedb ===========================================
mlocate.i386 : An utility for finding files by name
But it's not so easy to find which package free command belongs to:
yum search free // this command just returns too much informationy
rpm -qa | grep free
freetype-2.2.1-31.el5_8.1 // obviously not the package by which free command is installed
So is there any convinent way to know which package a specific command belongs to on Linux? For example CentOS or some other distributions
linux command-line centos package-management
add a comment |
up vote
15
down vote
favorite
For example I can easily find locate command belongs to mlocate.i386 package.
yum search locate
mlocate.i386 : An utility for finding files by name
[mirror@home /]$ rpm -qa | grep locate
mlocate-0.15-1.el5.1
yum search updatedb
Loaded plugins: fastestmirror, protectbase
0 packages excluded due to repository protections
=========================================== Matched: updatedb ===========================================
mlocate.i386 : An utility for finding files by name
But it's not so easy to find which package free command belongs to:
yum search free // this command just returns too much informationy
rpm -qa | grep free
freetype-2.2.1-31.el5_8.1 // obviously not the package by which free command is installed
So is there any convinent way to know which package a specific command belongs to on Linux? For example CentOS or some other distributions
linux command-line centos package-management
add a comment |
up vote
15
down vote
favorite
up vote
15
down vote
favorite
For example I can easily find locate command belongs to mlocate.i386 package.
yum search locate
mlocate.i386 : An utility for finding files by name
[mirror@home /]$ rpm -qa | grep locate
mlocate-0.15-1.el5.1
yum search updatedb
Loaded plugins: fastestmirror, protectbase
0 packages excluded due to repository protections
=========================================== Matched: updatedb ===========================================
mlocate.i386 : An utility for finding files by name
But it's not so easy to find which package free command belongs to:
yum search free // this command just returns too much informationy
rpm -qa | grep free
freetype-2.2.1-31.el5_8.1 // obviously not the package by which free command is installed
So is there any convinent way to know which package a specific command belongs to on Linux? For example CentOS or some other distributions
linux command-line centos package-management
For example I can easily find locate command belongs to mlocate.i386 package.
yum search locate
mlocate.i386 : An utility for finding files by name
[mirror@home /]$ rpm -qa | grep locate
mlocate-0.15-1.el5.1
yum search updatedb
Loaded plugins: fastestmirror, protectbase
0 packages excluded due to repository protections
=========================================== Matched: updatedb ===========================================
mlocate.i386 : An utility for finding files by name
But it's not so easy to find which package free command belongs to:
yum search free // this command just returns too much informationy
rpm -qa | grep free
freetype-2.2.1-31.el5_8.1 // obviously not the package by which free command is installed
So is there any convinent way to know which package a specific command belongs to on Linux? For example CentOS or some other distributions
linux command-line centos package-management
linux command-line centos package-management
edited Aug 28 '12 at 6:07
Sathya♦
52.5k29153252
52.5k29153252
asked Aug 28 '12 at 2:19
hugemeow
85771933
85771933
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
14
down vote
accepted
Query the rpmdb.
rpm -qf $(which free)
why not use rpm -qfwhich free
?
– hugemeow
Sep 1 '12 at 9:35
Either is fine.$(...)
is habit for me.
– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
add a comment |
up vote
20
down vote
Ubuntu / Debian example to check the package of the free
command:
dpkg -S $(which free)
this works only for installed packages. i found here something that works for non installed packages$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
@bobrobbob I am afraid that is not correct. I tested withdpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work becausedpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…
– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
1
If you get dpkg-query: no path found matching pattern try this:dpkg -S "$(readlink -fn "$(which free)")"
.
– Pablo Bianchi
Jul 7 '17 at 21:00
add a comment |
up vote
5
down vote
For CentOS, how about yum provides?
Use
which free
to find out where it is
For me it's at
/usr/bin/free
So then you can run
yum provides /usr/bin/free
and it will tell you which package has it
add a comment |
up vote
0
down vote
For all red-hat based distributions you can use yum package management utility
yum provides `which free`
provides argument specifies which package provides certain feature or file.
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
14
down vote
accepted
Query the rpmdb.
rpm -qf $(which free)
why not use rpm -qfwhich free
?
– hugemeow
Sep 1 '12 at 9:35
Either is fine.$(...)
is habit for me.
– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
add a comment |
up vote
14
down vote
accepted
Query the rpmdb.
rpm -qf $(which free)
why not use rpm -qfwhich free
?
– hugemeow
Sep 1 '12 at 9:35
Either is fine.$(...)
is habit for me.
– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
add a comment |
up vote
14
down vote
accepted
up vote
14
down vote
accepted
Query the rpmdb.
rpm -qf $(which free)
Query the rpmdb.
rpm -qf $(which free)
answered Aug 28 '12 at 2:21
Ignacio Vazquez-Abrams
95.2k6150208
95.2k6150208
why not use rpm -qfwhich free
?
– hugemeow
Sep 1 '12 at 9:35
Either is fine.$(...)
is habit for me.
– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
add a comment |
why not use rpm -qfwhich free
?
– hugemeow
Sep 1 '12 at 9:35
Either is fine.$(...)
is habit for me.
– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
why not use rpm -qf
which free
?– hugemeow
Sep 1 '12 at 9:35
why not use rpm -qf
which free
?– hugemeow
Sep 1 '12 at 9:35
Either is fine.
$(...)
is habit for me.– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
Either is fine.
$(...)
is habit for me.– Ignacio Vazquez-Abrams
Sep 1 '12 at 12:20
add a comment |
up vote
20
down vote
Ubuntu / Debian example to check the package of the free
command:
dpkg -S $(which free)
this works only for installed packages. i found here something that works for non installed packages$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
@bobrobbob I am afraid that is not correct. I tested withdpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work becausedpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…
– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
1
If you get dpkg-query: no path found matching pattern try this:dpkg -S "$(readlink -fn "$(which free)")"
.
– Pablo Bianchi
Jul 7 '17 at 21:00
add a comment |
up vote
20
down vote
Ubuntu / Debian example to check the package of the free
command:
dpkg -S $(which free)
this works only for installed packages. i found here something that works for non installed packages$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
@bobrobbob I am afraid that is not correct. I tested withdpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work becausedpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…
– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
1
If you get dpkg-query: no path found matching pattern try this:dpkg -S "$(readlink -fn "$(which free)")"
.
– Pablo Bianchi
Jul 7 '17 at 21:00
add a comment |
up vote
20
down vote
up vote
20
down vote
Ubuntu / Debian example to check the package of the free
command:
dpkg -S $(which free)
Ubuntu / Debian example to check the package of the free
command:
dpkg -S $(which free)
edited Nov 21 at 14:22
answered Aug 28 '12 at 18:41
Jeroen Vermeulen - MageHost
72048
72048
this works only for installed packages. i found here something that works for non installed packages$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
@bobrobbob I am afraid that is not correct. I tested withdpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work becausedpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…
– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
1
If you get dpkg-query: no path found matching pattern try this:dpkg -S "$(readlink -fn "$(which free)")"
.
– Pablo Bianchi
Jul 7 '17 at 21:00
add a comment |
this works only for installed packages. i found here something that works for non installed packages$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
@bobrobbob I am afraid that is not correct. I tested withdpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work becausedpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…
– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
1
If you get dpkg-query: no path found matching pattern try this:dpkg -S "$(readlink -fn "$(which free)")"
.
– Pablo Bianchi
Jul 7 '17 at 21:00
this works only for installed packages. i found here something that works for non installed packages
$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
this works only for installed packages. i found here something that works for non installed packages
$ dpkg -S */free$*
– bobrobbob
Jun 2 '17 at 9:23
@bobrobbob I am afraid that is not correct. I tested with
dpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work because dpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
@bobrobbob I am afraid that is not correct. I tested with
dpkg -S */firefox$*
which gives multiple results on a server which has Firefox installed, none on a server without Firefox. I think it can't work because dpkg
is a command operating on the locally installed packages. To find non installed packages you can go to packages.ubuntu.com/…– Jeroen Vermeulen - MageHost
Jun 2 '17 at 10:31
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
oh my. you're right, sorry for that
– bobrobbob
Jun 3 '17 at 6:32
1
1
If you get dpkg-query: no path found matching pattern try this:
dpkg -S "$(readlink -fn "$(which free)")"
.– Pablo Bianchi
Jul 7 '17 at 21:00
If you get dpkg-query: no path found matching pattern try this:
dpkg -S "$(readlink -fn "$(which free)")"
.– Pablo Bianchi
Jul 7 '17 at 21:00
add a comment |
up vote
5
down vote
For CentOS, how about yum provides?
Use
which free
to find out where it is
For me it's at
/usr/bin/free
So then you can run
yum provides /usr/bin/free
and it will tell you which package has it
add a comment |
up vote
5
down vote
For CentOS, how about yum provides?
Use
which free
to find out where it is
For me it's at
/usr/bin/free
So then you can run
yum provides /usr/bin/free
and it will tell you which package has it
add a comment |
up vote
5
down vote
up vote
5
down vote
For CentOS, how about yum provides?
Use
which free
to find out where it is
For me it's at
/usr/bin/free
So then you can run
yum provides /usr/bin/free
and it will tell you which package has it
For CentOS, how about yum provides?
Use
which free
to find out where it is
For me it's at
/usr/bin/free
So then you can run
yum provides /usr/bin/free
and it will tell you which package has it
answered Dec 17 '15 at 16:06
Mark
5111
5111
add a comment |
add a comment |
up vote
0
down vote
For all red-hat based distributions you can use yum package management utility
yum provides `which free`
provides argument specifies which package provides certain feature or file.
add a comment |
up vote
0
down vote
For all red-hat based distributions you can use yum package management utility
yum provides `which free`
provides argument specifies which package provides certain feature or file.
add a comment |
up vote
0
down vote
up vote
0
down vote
For all red-hat based distributions you can use yum package management utility
yum provides `which free`
provides argument specifies which package provides certain feature or file.
For all red-hat based distributions you can use yum package management utility
yum provides `which free`
provides argument specifies which package provides certain feature or file.
answered May 13 at 15:36
LoveWithMaths
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f467186%2fhow-to-find-which-package-certain-command-belongs-to-on-centos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown