简体   繁体   English

如何查找ubuntu中安装的软件版本

[英]How to find version of a software installed in ubuntu

我可以在控制台中使用任何通用命令,例如如何找到mysql版本?

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." 如果没有安装软件包,它将打印出“找不到匹配mysql-server的软件包”。 instead. 代替。

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. 有些人更容易解析,有些(通常)包含有关许可证的一些信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM