尽管在图形包管理器的帮助下包管理变得更加容易,但一些用户总是更喜欢命令行方式。有不同的命令可以在不同的 linux 版本中找出包版本。今天,在本教程中,我们将看到如何在一些流行的 linux 发行版中找到软件包版本,例如 alpine linux、arch linux 及其衍生产品、debian 及其衍生产品、rhel 及其衍生产品。
在 alpine linux 中查找软件包版本在基于 arch 的系统中查找软件包版本在基于 deb 的系统中查找包版本在基于 rpm 的系统中查找软件包版本在 alpine linux 中查找软件包版本要查看软件包版本和其他详细信息,请使用apk info如下命令。
$ apk info vim您将看到给定包的简短描述及其托管网站。
示例输出:
vim-8.2.2137-r0 description:improved vi-style text editorvim-8.2.2137-r0 webpage:https://www.vim.org/vim-8.2.2137-r0 installed size:18 mibgvim-8.2.2137-r0 description:advanced text editor, with guigvim-8.2.2137-r0 webpage:https://www.vim.org/gvim-8.2.2137-r0 installed size:29 mib如您所见,安装的 vim 版本是8.2.
在基于 arch 的系统中查找软件包版本要在 arch linux 及其衍生产品(如 endeavouros 和 manjaro linux)中查找已安装的软件包(例如 vlc)版本,请运行以下命令:
$ pacman -q vlc示例输出:
vlc 2.2.4-3正如你在上面的输出中看到的,vlc 包的安装版本是2.2.4-3。
要显示包的详细信息,请运行:
$ pacman -qi vlc示例输出:
name : vlcversion : 2.2.4-3description : a multi-platform mpeg, vcd/dvd, and divx playerarchitecture : x86_64url : http://www.videolan.org/vlc/licenses : lgpl2.1 gpl2groups : noneprovides : nonedepends on : a52dec libdvbpsi libxpm libdca libproxy sdl_image libdvdnav libtiger lua libmatroska zvbi taglib libmpcdec ffmpeg2.8 faad2 libupnp libshout libmad libmpeg2 xcb-util-keysyms libtar libxineramaoptional deps : avahi: for service discovery using bonjour protocol [installed] libnotify: for notification plugin [installed] gtk2: for notify plugin [installed] [...] lua-socket: for http interface qt4: for the gui [installed]required by : noneoptional for : smtubeconflicts with : vlc-pluginreplaces : vlc-plugininstalled size : 53.28 mibpackager : antonio rojas build date : sun 24 jul 2016 03:12:59 pm istinstall date : fri 05 aug 2016 11:22:54 am istinstall reason : explicitly installedinstall script : novalidated by : signature在基于 deb 的系统中查找包版本在 debian、ubuntu 及其衍生产品(例如 linux mint、pop os 和 elementary os)中,我们可以找到已安装的软件包,例如 apache webserver,使用dpkg带有-l开关的命令的版本如下:
$ dpkg -l apache2或者,您可以使用dpkgwithgrep命令来获取安装版本的软件包,如下所示。
$ dpkg -s apache2 | grep -i version示例输出:
version: 2.4.18-2ubuntu3.1要显示已安装软件包的详细信息,请运行:
$ dpkg -s apache2示例输出:
package: apache2status: install ok installedpriority: optionalsection: httpdinstalled-size: 488maintainer: ubuntu developers architecture: amd64version: 2.4.18-2ubuntu3.1replaces: apache2.2-bin, apache2.2-commonprovides: httpd, httpd-cgidepends: lsb-base, procps, perl, mime-support, apache2-bin (= 2.4.18-2ubuntu3.1), apache2-utils (>= 2.4), apache2-data (= 2.4.18-2ubuntu3.1)pre-depends: dpkg (>= 1.17.14)recommends: ssl-certsuggests: www-browser, apache2-doc, apache2-suexec-pristine | apache2-suexec-custom, ufwconflicts: apache2.2-bin, apache2.2-commonconffiles: /etc/apache2/apache2.conf da32fcc6a783acaebf0d74c17c726bf7 /etc/default/apache-htcacheclean ae8721a0bc5b4e2ef7a5258b1e9db5c5 [..] /etc/logrotate.d/apache2 7322a4f050c1e2454249695236a3472c /etc/ufw/applications.d/apache2-utils.ufw.profile f8d4fd920e598ceb4379613c6261f6afdescription: apache http server the apache http server project's goal is to build a secure, efficient and extensible http server as standards-compliant open source software. the result has long been the number one web server on the internet. . installing this package results in a full installation, including the configuration files, init scripts and support scripts.homepage: http://httpd.apache.org/original-maintainer: debian apache maintainers此外,我们可以使用以下apt-show-versions命令查找软件包版本:
$ apt-show-versions apache2示例输出:
apache2:amd64/xenial-security 2.4.18-2ubuntu3.1 uptodateapache2:i386 not installed如上结果所示,我安装了 apache2 64位版本,版本为 2.4.18。
如果没有安装'apt-show-versions'程序,您可以使用以下命令安装它:
$ sudo apt install apt-show-versions我们现在知道如何检查已安装软件包的版本。在线存储库中的软件包版本如何?无论如何要检查官方存储库中可用的软件包版本?这也是可能的。查看以下链接以了解操作方法。
即使这些软件包没有安装在基于 debian 的系统中,您仍然可以找到它们的版本。查看以下指南了解更多详情。
在基于 rpm 的系统中查找软件包版本要在基于 rpm 的发行版(例如 red hat、centos、fedora、almalinux、rocky linux 和 opensuse 等)中找出已安装软件包(例如 httpd)的版本,请运行:
$ rpm -qi httpd示例输出:
name : httpdversion : 2.4.6release : 40.el7.centos.4architecture: x86_64install date: thu 11 aug 2016 08:08:45 pm istgroup : system environment/daemonssize : 9806117license : asl 2.0signature : rsa/sha256, mon 18 jul 2016 09:35:16 pm ist, key id 24c6a8a7f4a80eb5source rpm : httpd-2.4.6-40.el7.centos.4.src.rpmbuild date : mon 18 jul 2016 09:02:11 pm istbuild host : worker1.bsys.centos.orgrelocations : (not relocatable)packager : centos buildsystem上面的命令显示安装的包版本、构建日期、许可证、描述等。正如你在输出中看到的,httpd 包版本是2.4.6。
苹果iMac安装Windows XP系统步骤
11月1日 联想首款Tango智能机Phab 2 Pro出货
一种简便的PLC通讯方式控制变频器的方法
基于verilog的浮点乘法器实现
Google DevFest 2021广州国际嘉年华成功举办
在Linux中如何查找软件包版本
芯片巨头AMD遭遇“滑铁卢”之痛
有效管理孩子游戏时长 只需开启华为P10学生模式
支付宝在今年第三季度移动支付市场的份额中占比达到了53.58%排列第一
魅族16 Plus渲染图曝光:6.5英寸大屏幕,颜值颇高
浅谈断路器越级跳闸的原因和解决对策
华裔教授成功解码脑电波并合成语音
人工智能指的是什么
一种由纳米金颗粒构成的新型薄膜会因为任何一种变形而变色
日本电子产业巨头怎么了?
云知声AI开放平台可快速助力用户搭建应用产品
【重磅】联通加入ZETA联盟,加强“大联接”能力锻造万物智联“数字底座”
1分钟看懂什么是IGZO屏幕
CPU如何控制单极性晶体管
单域和多域SSL证书的区别