Thursday, May 2, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 752  / 3 Years ago, mon, may 10, 2021, 6:37:34

Can I know what is the command to search any package using the terminal, if I only know the name of the Software like, if I want to search VLC or JDK,JRE.. etc



If I do not know what is the url where I get them to download I might search them through the internet, but downloading them and extracting them and then installing becomes a lengthy procedure.



So I wanted to know is there any command to search the package via their names or part of names?


More From » command-line

 Answers
6

As Nick already pointed out, apt-cache search QUERY should list packages containing specific string in their names.



Another useful tool is apt-file. apt-file search QUERY will print list of packages containing files with QUERY in their names. In some cases you know the name of a binary needed (like when you are reading a tutorial and need some command not installed in your OS) but do not know what package it comes with.



Also, dpkg -S QUERY lists installed packages which provide files containing 'QUERY' in their names. In some cases you have a binary or script installed on one machine and want it also on another one, but do not remember where it came from. The output should be smaller than for apt-file in this case, as it does not display content of packages not installed.



You may filter output of those commands with egrep, say with egrep '/NAME$'.



e.g. dpkg -S ps | egrep '/bin/ps$' tells us that ps binary comes with procps package.


[#29799] Tuesday, May 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rhaeams

Total Points: 115
Total Questions: 111
Total Answers: 103

Location: Burundi
Member since Wed, Nov 25, 2020
4 Years ago
rhaeams questions
;