Linux 如何查找ubuntu中安装的软件版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14727450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to find version of a software installed in ubuntu
提问by hemal12
Is there any universal command that I can use in the console, for example how to find the mysql version ?
是否有任何通用命令可以在控制台中使用,例如如何查找 mysql 版本?
采纳答案by Carsten
You can use dpkg
to get that info:
您可以使用dpkg
来获取该信息:
dpkg -l mysql-server | grep -E "^ii" | tr -s ' ' | cut -d' ' -f3
This will give you the installed version of the mysql-server
package.
这将为您提供已安装的mysql-server
软件包版本。
If a package is not installed, it will print out "No packages found matching mysql-server." instead.
如果一个包没有安装,它会打印出“No packages found matching mysql-server”。反而。
回答by Shahbaz
Almost all programs that can be run in the command line have a --version
option.
几乎所有可以在命令行中运行的程序都有一个--version
选项。
For example:
例如:
git --version
ls --version
The format of their output is nowhere near standard though. Some make it easier to parse, some (often) include a little information about the license.
不过,他们的输出格式远不及标准。有些使它更容易解析,有些(通常)包含有关许可证的一些信息。