如何在 Linux 上检查一个软件包的详细信息
2018-09-16 00:00
543 查看
我们可以就这个已经被广泛讨论的话题写出大量的文章,大多数情况下,因为各种各样的原因,我们都愿意让包管理器package manager来帮我们做这些事情。
每个 Linux 发行版都有自己的包管理器,并且每个都有各自有不同的特性,这些特性包括允许用户执行安装新软件包,删除无用的软件包,更新现存的软件包,搜索某些具体的软件包,以及更新整个系统到其最新的状态之类的操作。
习惯于命令行的用户大多数时间都会使用基于命令行方式的包管理器。对于 Linux 而言,这些基于命令行的包管理器有
作为一个系统管理员你应该清楚地知道:安装包来自何方,具体来自哪个软件仓库,包的具体版本,包的大小,版本,包的源代码 URL,包的许可证信息,等等。
这篇短文将用尽可能简单的方式帮你从随包自带的总结和描述中了解该包的用法。按你所使用的 Linux 发行版的不同,运行下面相应的命令,你能得到你所使用的发行版下的包的详细信息。
Yum 是用于在官方发行版仓库以及其他第三方发行版仓库下获取、安装、删除、查询 RPM 包的主要工具。
(LCTT 译注:用
每个 Linux 发行版都有自己的包管理器,并且每个都有各自有不同的特性,这些特性包括允许用户执行安装新软件包,删除无用的软件包,更新现存的软件包,搜索某些具体的软件包,以及更新整个系统到其最新的状态之类的操作。
习惯于命令行的用户大多数时间都会使用基于命令行方式的包管理器。对于 Linux 而言,这些基于命令行的包管理器有
yum、
dnf、
rpm、
apt、
apt-get、
dpkg、
pacman和
zypper。
作为一个系统管理员你应该清楚地知道:安装包来自何方,具体来自哪个软件仓库,包的具体版本,包的大小,版本,包的源代码 URL,包的许可证信息,等等。
这篇短文将用尽可能简单的方式帮你从随包自带的总结和描述中了解该包的用法。按你所使用的 Linux 发行版的不同,运行下面相应的命令,你能得到你所使用的发行版下的包的详细信息。
YUM 命令:在 RHEL 和 CentOS 系统上获得包的信息
YUM 英文直译是“黄狗更新器–修改版Yellowdog Updater, Modified”,它是一个开源的基于命令行的包管理器前端实用工具。它被广泛应用在基于 RPM 的系统上,例如:RHEL 和 CentOS。Yum 是用于在官方发行版仓库以及其他第三方发行版仓库下获取、安装、删除、查询 RPM 包的主要工具。
(LCTT 译注:用
yum info获取 python 包的信息)
#yuminfo python
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* epel: epel.mirror.constant.com
InstalledPackages
Name: python
Arch: x86_64
Version:2.6.6
Release:66.el6_8
Size:78 k
Repo: installed
From repo : updates
Summary:An interpreted, interactive, object-oriented programming language
URL : http://www.python.org/[/code]License:PythonDescription:Pythonis an interpreted, interactive, object-oriented programming: language often compared to Tcl,Perl,SchemeorJava.Python includes: modules, classes, exceptions, very high level dynamic data types and: dynamic typing.Python supports interfaces to many system calls and: libraries,as well as to various windowing systems (X11,Motif,Tk,:Macand MFC).::Programmers can writenew built-in modules forPythonin C or C++.:Python can be used as an extension language for applications that need: a programmable interface.::Note that documentation forPythonis provided in the python-docs:package.::Thispackage provides the "python" executable; most of the actual: implementation is within the "python-libs"package.
YUMDB 命令:查看 RHEL 和 CentOS 系统上的包信息
yumdb info这个命令提供与yum info相类似的的信息,不过它还额外提供了诸如包校验值、包类型、用户信息(由何人安装)。从 yum 3.2.26 版本后,yum开始在 rpm 数据库外储存额外的信息了(此处如显示user表明该包由用户安装,而dep说明该包是被作为被依赖的包而被安装的)。
(LCTT 译注:用yumdb info来获取 python 包的信息)# yumdb info pythonLoaded plugins: fastestmirrorpython-2.6.6-66.el6_8.x86_64changed_by =4294967295checksum_data =53c75a1756e5b4f6564c5229a37948c9b4561e0bf58076bd7dab7aff85a417f2checksum_type = sha256command_line = update -yfrom_repo = updatesfrom_repo_revision =1488370672from_repo_timestamp =1488371100installed_by =4294967295reason = depreleasever =6
RPM 命令:在 RHEL/CentOS/Fedora 系统上查看包的信息
RPM 英文直译为“红帽包管理器Red Hat Package Manager”,这是一个在 RedHat 以及其变种发行版(如RHEL、CentOS、Fedora、openSUSE、Megeia)下的功能强大的命令行包管理工具。它能让你轻松的安装、升级、删除、查询以及校验你的系统或服务器上的软件。RPM 文件以.rpm结尾。RPM 包由它所依赖的软件库以及其他依赖构成,它不会与系统上已经安装的包冲突。
(LCTT 译注:用rpm -qi查询 nano 包的具体信息)# rpm -qi nanoName:nanoRelocations:(not relocatable)Version:2.0.9Vendor:CentOSRelease:7.el6BuildDate:Fri12Nov201002:18:36 AM ESTInstallDate:Fri03Mar201708:57:47 AM EST BuildHost: c5b2.bsys.dev.centos.orgGroup:Applications/EditorsSource RPM:nano-2.0.9-7.el6.src.rpmSize:1588347License:GPLv3+Signature: RSA/8,Sun03Jul201112:46:50 AM EDT,Key ID 0946fca2c105b9dePackager:CentOSBuildSystemURL : http://www.nano-editor.org[/code]Summary: A small text editorDescription:GNU nanois a small and friendly text editor.
DNF 命令:在 Fedora 系统上查看包信息
DNF 指“时髦版的 YumDandified yum”,我们也可以认为 DNF 是下一代的 yum 包管理器(Yum 的一个分支),它在后台使用了 hawkey/libsolv 库。Aleš Kozumplík 在Fedora 18 上开始开发 DNF,在 Fedora 22 上正式最后发布。dnf命令用来在 Fedora 22 及以后的系统上安装、更新、搜索以及删除包。它能自动的解决包安装过程中的包依赖问题。
(LCTT 译注: 用dnf info查看 tilix 包信息)$ dnf info tilixLast metadata expiration check:27 days,10:00:23 ago on Wed04Oct201706:43:27 AM IST.InstalledPackagesName: tilixVersion:1.6.4Release:1.fc26Arch: x86_64Size:3.6 MSource: tilix-1.6.4-1.fc26.src.rpmRepo:@SystemFrom repo :@commandlineSummary:Tiling terminal emulatorURL : https://github.com/gnunn1/tilix[/code]License:MPLv2.0andGPLv3+and CC-BY-SADescription:Tilixis a tiling terminal emulator with the following features:::-Layout terminals in any fashion by splitting them horizontally or vertically:-Terminals can be re-arranged using drag and drop both within and between: windows:-Terminals can be detached into a new window via drag and drop:-Input can be synchronized between terminals so commands typed in one: terminal are replicated to the others:-The grouping of terminals can be saved and loaded from disk:-Terminals support custom titles:-Color schemes are stored in files and custom color schemes can be created by: simply creating a newfile:-Transparent background:-Supports notifications when processes are completed out of view::The application was written using GTK 3and an effort was made to conform to: GNOME HumanInterfaceGuidelines(HIG).
Zypper 命令:在 openSUSE 系统上查看包信息
zypper 是一个使用 libzypp 库的命令行包管理器。zypper提供诸如软件仓库访问,安装依赖解决,软件包安装等等功能。
(LCTT 译注: 用zypper info查询 nano 包的信息)$ zypper infonanoLoading repository data...Reading installed packages...Informationforpackagenano:-----------------------------Repository:MainRepository(OSS)Name:nanoVersion:2.4.2-5.3Arch: x86_64Vendor: openSUSEInstalledSize:1017.8KiBInstalled:NoStatus:not installedSourcepackage:nano-2.4.2-5.3.srcSummary:Pico editor clonewith enhancementsDescription:GNU nanois a small and friendly text editor.It aims to emulatethe Pico text editor while also offering a few enhancements.
Pacman 命令:在 ArchLinux 及 Manjaro 系统上查看包信息
Pacman 意即包管理器package manager实用工具。pacman是一个用于安装、构建、删除、管理 Arch Linux 上包的命令行工具。它后端使用 libalpm(Arch Linux package Manager(ALPM)库)来完成所有功能。
(LCTT 译注: 用pacman -Qi来查询 bash 包信息)$ pacman -QibashName:bashVersion:4.4.012-2Description:The GNU BourneAgain shellArchitecture: x86_64URL : http://www.gnu.org/software/bash/bash.html[/code]Licenses: GPLGroups: baseProvides: shDependsOn: readline>=7.0 glibc ncursesOptionalDeps:bash-completion:for tab completionRequiredBy: autoconf automake bison bzip2 ca-certificates-utils dbdhcpcd diffutils e2fsprogs fakeroot figlet findutilsflex freetype2 gawk gdbm gettext gmp grub gzip icuiptables keyutils libgpg-error libksba libpcap libpnglibtool lvm2 m4 man-db mkinitcpio nano neofetch nsprnss openresolv os-prober pacman pcre pcre2 shadowsystemd texinfo vte-common which xdg-user-dirs xdg-utilsxfsprogs xorg-mkfontdir xorg-xpr xzOptionalFor:NoneConflictsWith:NoneReplaces:NoneInstalledSize:7.13MiBPackager:JanAlexanderSteffens(heftig)BuildDate:Tue14Feb201701:16:51 PM UTCInstallDate:Thu24Aug201706:08:12 AM UTCInstallReason:Explicitly installedInstallScript:NoValidatedBy:Signature
apt-cache 命令:在 Debian/Ubuntu/Mint 系统上查看包信息
apt-cache 命令能显示 apt 内部数据库中的大量信息。这些信息是从sources.list中的不同的软件源中搜集而来,因此从某种意义上这些信息也可以被认为是某种缓存。这些信息搜集工作是在运行apt update命令时执行的。
(LCTT 译注:用管理员权限查询 apache2 包的信息)$ sudo apt-cache show apache2Package: apache2Priority: optionalSection: webInstalled-Size:473Maintainer:UbuntuDevelopersOriginal-Maintainer:DebianApacheMaintainersArchitecture: amd64Version:2.4.12-2ubuntu2Replaces: apache2.2-commonProvides: httpd, httpd-cgiDepends: lsb-base, procps, perl, mime-support, apache2-bin (=2.4.12-2ubuntu2), apache2-utils (>=2.4), apache2-data (=2.4.12-2ubuntu2)Pre-Depends: dpkg (>=1.17.14)Recommends: ssl-certSuggests: www-browser, apache2-doc, apache2-suexec-pristine | apache2-suexec-custom, ufwConflicts: apache2.2-common (<<2.3~)Filename: pool/main/a/apache2/apache2_2.4.12-2ubuntu2_amd64.debSize:91348MD5sum: ab0ee0b0d1c6b3d19bd87aa2a9537125SHA1:350c9a1a954906088ed032aebb77de3d5bb24004SHA256:03f515f7ebc3b67b050b06e82ebca34b5e83e34a528868498fce020bf1dbbe34Description-en:Apache HTTP ServerTheApache HTTP ServerProject's goal is to build a secure, efficient andextensible HTTP server as standards-compliant open source software. Theresult has long been the number one web server on the Internet..Installing this package results in a full installation, including theconfiguration files, init scripts and support scripts.Description-md5: d02426bc360345e5acd45367716dc35cHomepage: http://httpd.apache.org/[/code]Bugs: https://bugs.launchpad.net/ubuntu/+filebug[/code]Origin: UbuntuSupported: 9mTask: lamp-server, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, mythbuntu-backend-master
APT 命令:查看 Debian/Ubuntu/Mint 系统上的包信息
APT 意为高级打包工具Advanced Packaging Tool,就像 DNF 将如何替代 YUM 一样,APT 是 apt-get 的替代物。它功能丰富的命令行工具包括了如下所有命令的功能如apt-cache、apt-search、dpkg、apt-cdrom、apt-config、apt-key等等,我们可以方便的通过apt来安装.dpkg包,但是我们却不能通过apt-get来完成这一点,还有一些其他的类似的功能也不能用apt-get来完成,所以apt-get因为没有解决上述功能缺乏的原因而被apt所取代。
(LCTT 译注: 用apt show查看 nano 包信息)$ apt show nanoPackage:nanoVersion:2.8.6-3Priority: standardSection: editorsOrigin:UbuntuMaintainer:UbuntuDevelopersOriginal-Maintainer:JordiMallachBugs: https://bugs.launchpad.net/ubuntu/+filebug[/code]Installed-Size:766 kBDepends: libc6 (>=2.14), libncursesw5 (>=6), libtinfo5 (>=6)Suggests: spellConflicts: picoBreaks:nano-tiny (<<2.8.6-2)Replaces:nano-tiny (<<2.8.6-2), picoHomepage: https://www.nano-editor.org/[/code]Task: standard, ubuntu-touch-core, ubuntu-touchSupported:9mDownload-Size:222 kBAPT-Manual-Installed:yesAPT-Sources: http://in.archive.ubuntu.com/ubuntu artful/main amd64 PackagesDescription: small, friendly text editor inspired by PicoGNU nanois an easy-to-use text editor originally designed as a replacementforPico, the ncurses-based editor from the non-free mailer packagePine(itself now available under the ApacheLicenseasAlpine)..However, GNU nano also implements many features missing in pico, including:- undo/redo- line numbering- syntax coloring- soft-wrapping of overlong lines- selecting text by holding Shift- interactive search and replace (with regular expression support)- a go-to line (and column) command- support for multiple file buffers-auto-indentation- tab completion of filenames and search terms- toggling features while running-and full internationalization support
dpkg 命令:查看Debian/Ubuntu/Mint系统上的包信息
dpkg 意指 Debian 包管理器Debian package manager。dpkg是用于 Debian 系统上安装、构建、移除以及管理 Debian 包的命令行工具。dpkg使用aptitude(因为它更为主流及用户友好)作为前端工具来完成所有的功能。其他的工具如dpkg-deb和dpkg-query使用dpkg做为前端来实现功能。尽管系统管理员还是时不时会在必要时使用dpkg来完成一些软件安装的任务,他大多数情况下还是会因为apt、apt-get以及aptitude的健壮性而使用后者。
(LCTT 译注: 用dpkg -s查看 python 包的信息)$ dpkg -s pythonPackage: pythonStatus: install ok installedPriority: optionalSection: pythonInstalled-Size:626Maintainer:UbuntuDevelopersArchitecture: amd64Multi-Arch: allowedSource: python-defaultsVersion:2.7.14-2ubuntu1Replaces: python-dev (<<2.6.5-2)Provides: python-ctypes, python-email, python-importlib, python-profiler, python-wsgirefDepends: python2.7(>=2.7.14-1~), libpython-stdlib (=2.7.14-2ubuntu1)Pre-Depends: python-minimal (=2.7.14-2ubuntu1)Suggests: python-doc (=2.7.14-2ubuntu1), python-tk (>=2.7.14-1~)Breaks: update-manager-core (<<0.200.5-2)Conflicts: python-central (<<0.5.5)Description: interactive high-level object-oriented language (default version)Python, the high-level, interactive object oriented language,includes an extensive class library with lots of goodies fornetwork programming, system administration, sounds and graphics..Thispackageis a dependency package, which depends on Debian's defaultPython version (currently v2.7).Homepage: http://www.python.org/[/code]Original-Maintainer: Matthias Klose
我们也可使用dpkg的-p选项,这个选项提供和dpkg -s相类似的信息,但是它还提供了包的校验值和包类型。
(LCTT 译注: 用dpkg -p查看 python3 包的信息)$ dpkg -p python3Package: python3Priority: importantSection: pythonInstalled-Size:67Origin:UbuntuMaintainer:UbuntuDevelopersBugs: https://bugs.launchpad.net/ubuntu/+filebug[/code]Architecture: amd64Multi-Arch: allowedSource: python3-defaultsVersion:3.6.3-0ubuntu2Replaces: python3-minimal (<<3.1.2-2)Provides: python3-profilerDepends: python3.6(>=3.6.3-1~), libpython3-stdlib (=3.6.3-0ubuntu2), dh-pythonPre-Depends: python3-minimal (=3.6.3-0ubuntu2)Suggests: python3-doc (>=3.6.3-0ubuntu2), python3-tk (>=3.6.3-1~), python3-venv (>=3.6.3-0ubuntu2)Filename: pool/main/p/python3-defaults/python3_3.6.3-0ubuntu2_amd64.debSize:8712MD5sum: a8bae494c6e5d1896287675faf40d373Description: interactive high-level object-oriented language (default python3 version)Original-Maintainer:MatthiasKloseSHA1:2daec885cea7d4dc83c284301c3bebf42b23e095SHA256:865e509c91d2504a16c4b573dbe27e260c36fceec2add3fa43a30c1751d7e9bbHomepage: http://www.python.org/[/code]Task: minimal, ubuntu-core, ubuntu-coreDescription-md5:950ebd8122c0a7340f0a740c295b9eabSupported:9m
aptitude 命令:查看 Debian/Ubuntu/Mint 系统上的包信息
aptitude是 Debian GNU/Linux 包管理系统的文本界面。它允许用户查看已安装的包的列表,以及完成诸如安装、升级、删除包之类的包管理任务。这些管理行为也能从图形接口来执行。
(LCTT 译注: 用aptitude show查看 htop 包信息)$ aptitude show htopPackage:htopVersion:2.0.2-1State: installedAutomatically installed:noPriority: optionalSection: universe/utilsMaintainer:UbuntuDevelopersArchitecture: amd64UncompressedSize:216 kDepends: libc6 (>=2.15), libncursesw5 (>=6), libtinfo5 (>=6)Suggests:lsof,straceConflicts:htop:i386Description: interactive processes viewerHtopis an ncursed-based process viewer similar to top, but it allows one to scroll the list vertically and horizontally to see all processes and their full command lines.Tasks related to processes (killing, renicing) can be done without entering their PIDs.Homepage: http://hisham.hm/htop/[/code]
via: https://www.2daygeek.com/how-to-view-detailed-information-about-a-package-in-linux/
作者:Prakash Subramanian 选题:lujun9972 译者:DavidChenLiang 校对:wxy
本文由 LCTT 原创编译,Linux中国 荣誉推出
相关文章推荐
- 如何在 Linux 上检查一个软件包的详细信息
- Linux:如何查看一个进程的详细的启动时间
- linux 下如何查看已经经安装的软件包信息
- linux 进程(关于守护进程、检查一个进程是否活着、如何写一个进程号文件)
- Linux 基础:如何在Ubuntu上检查一个软件包是否安装
- JavaEE体验笔记二 -- 如何在一个显示了一堆投票(或新闻之类的)的页面中,点击其中一个就会显示其详细信息
- 在Linux上,如何知道一个可执行文件是否包含调试信息呢?
- 如何创建一个用弹出窗口来查看详细信息的超链接列
- Linux中如何搭建一个ftp服务服务器-超详细
- 如何在windows下和linux下获取文件(如exe文件)的详细信息和属性
- 通过学习学生信息管理系统软件,C程序中,如何设计和编写一个应用系统
- 如何创建一个用弹出窗口来查看详细信息的超链接列
- Linux下怎样检查、如何查看某软件包是否已经安装?
- linux系统如何安装软件(详细文字教程)
- 如何创建一个用弹出窗口来查看详细信息的超链接列
- Linux 基础:如何在Ubuntu上检查一个软件包是否安装
- 解决方法:对性能监视器计数器注册表值执行系统配置检查失败。有关详细信息,请参阅自述文件或 SQL Server 联机丛书中的“如何在 SQL Server 2005 中为安装程序增加计数器注册表项值”
- 【转】Linux下怎样检查、如何查看某软件包是否已经安装?
- Linux:如何查看一个进程的详细的启动时间
- 如何创建一个用弹出窗口来查看详细信息的超链接列