如何使用yum列出来自给定仓库的已安装包

时间:2023-02-05 15:30:48

I want to list all packages I have installed on a system from a given repo using yum. Usually to do this I use yum list installed | grep "something". But now I am faced with a problem. The repo I am interested in does not have that "something" for me to grep. The packages from that repo do not have any distinctive characteristics. How do I list them?

我想列出我使用yum从给定仓库安装在系统上的所有软件包。通常这样做我使用yum list安装| grep“某事”。但现在我遇到了一个问题。我感兴趣的回购没有那个“东西”让我grep。来自该回购的包装没有任何独特的特征。我如何列出它们?

I looked through yum man pages but did not find anything. I wonder if there are other commands I could use.

我查看了yum man pages但没有找到任何东西。我想知道是否还有其他可以使用的命令。

2 个解决方案

#1


38  

On newer versions of yum, this information is stored in the "yumdb" when the package is installed. This is the only 100% accurate way to get the information, and you can use:

在较新版本的yum上,此信息在安装软件包时存储在“yumdb”中。这是获取信息的唯一100%准确方法,您可以使用:

yumdb search from_repo repoid

(or repoquery and grep -- don't grep yum output). However the command "find-repos-of-install" was part of yum-utils for a while which did the best guess without that information:

(或repoquery和grep - 不要grep yum输出)。然而,命令“find-repos-of-install”暂时是yum-utils的一部分,在没有这些信息的情况下做了最好的猜测:

http://james.fedorapeople.org/yum/commands/find-repos-of-install.py

http://james.fedorapeople.org/yum/commands/find-repos-of-install.py

As floyd said, a lot of repos. include a unique "dist" tag in their release, and you can look for that ... however from what you said, I guess that isn't the case for you?

正如弗洛伊德所说,很多回购。在他们的发布中包含一个独特的“dist”标签,你可以寻找...但是根据你的说法,我想你不是这样的情况?

#2


63  

Try

尝试

yum list installed | grep reponame

On one of my servers:

在我的一台服务器上:

yum list installed | grep remi
ImageMagick2.x86_64                       6.6.5.10-1.el5.remi          installed
memcache.x86_64                          1.4.5-2.el5.remi             installed
mysql.x86_64                              5.1.54-1.el5.remi            installed
mysql-devel.x86_64                        5.1.54-1.el5.remi            installed
mysql-libs.x86_64                         5.1.54-1.el5.remi            installed
mysql-server.x86_64                       5.1.54-1.el5.remi            installed
mysqlclient15.x86_64                      5.0.67-1.el5.remi            installed
php.x86_64                                5.3.5-1.el5.remi             installed
php-cli.x86_64                            5.3.5-1.el5.remi             installed
php-common.x86_64                         5.3.5-1.el5.remi             installed
php-domxml-php4-php5.noarch               1.21.2-1.el5.remi            installed
php-fpm.x86_64                            5.3.5-1.el5.remi             installed
php-gd.x86_64                             5.3.5-1.el5.remi             installed
php-mbstring.x86_64                       5.3.5-1.el5.remi             installed
php-mcrypt.x86_64                         5.3.5-1.el5.remi             installed
php-mysql.x86_64                          5.3.5-1.el5.remi             installed
php-pdo.x86_64                            5.3.5-1.el5.remi             installed
php-pear.noarch                           1:1.9.1-6.el5.remi           installed
php-pecl-apc.x86_64                       3.1.6-1.el5.remi             installed
php-pecl-imagick.x86_64                   3.0.1-1.el5.remi.1           installed
php-pecl-memcache.x86_64                  3.0.5-1.el5.remi             installed
php-pecl-xdebug.x86_64                    2.1.0-1.el5.remi             installed
php-soap.x86_64                           5.3.5-1.el5.remi             installed
php-xml.x86_64                            5.3.5-1.el5.remi             installed
remi-release.noarch                       5-8.el5.remi                 installed

It works.

有用。

#1


38  

On newer versions of yum, this information is stored in the "yumdb" when the package is installed. This is the only 100% accurate way to get the information, and you can use:

在较新版本的yum上,此信息在安装软件包时存储在“yumdb”中。这是获取信息的唯一100%准确方法,您可以使用:

yumdb search from_repo repoid

(or repoquery and grep -- don't grep yum output). However the command "find-repos-of-install" was part of yum-utils for a while which did the best guess without that information:

(或repoquery和grep - 不要grep yum输出)。然而,命令“find-repos-of-install”暂时是yum-utils的一部分,在没有这些信息的情况下做了最好的猜测:

http://james.fedorapeople.org/yum/commands/find-repos-of-install.py

http://james.fedorapeople.org/yum/commands/find-repos-of-install.py

As floyd said, a lot of repos. include a unique "dist" tag in their release, and you can look for that ... however from what you said, I guess that isn't the case for you?

正如弗洛伊德所说,很多回购。在他们的发布中包含一个独特的“dist”标签,你可以寻找...但是根据你的说法,我想你不是这样的情况?

#2


63  

Try

尝试

yum list installed | grep reponame

On one of my servers:

在我的一台服务器上:

yum list installed | grep remi
ImageMagick2.x86_64                       6.6.5.10-1.el5.remi          installed
memcache.x86_64                          1.4.5-2.el5.remi             installed
mysql.x86_64                              5.1.54-1.el5.remi            installed
mysql-devel.x86_64                        5.1.54-1.el5.remi            installed
mysql-libs.x86_64                         5.1.54-1.el5.remi            installed
mysql-server.x86_64                       5.1.54-1.el5.remi            installed
mysqlclient15.x86_64                      5.0.67-1.el5.remi            installed
php.x86_64                                5.3.5-1.el5.remi             installed
php-cli.x86_64                            5.3.5-1.el5.remi             installed
php-common.x86_64                         5.3.5-1.el5.remi             installed
php-domxml-php4-php5.noarch               1.21.2-1.el5.remi            installed
php-fpm.x86_64                            5.3.5-1.el5.remi             installed
php-gd.x86_64                             5.3.5-1.el5.remi             installed
php-mbstring.x86_64                       5.3.5-1.el5.remi             installed
php-mcrypt.x86_64                         5.3.5-1.el5.remi             installed
php-mysql.x86_64                          5.3.5-1.el5.remi             installed
php-pdo.x86_64                            5.3.5-1.el5.remi             installed
php-pear.noarch                           1:1.9.1-6.el5.remi           installed
php-pecl-apc.x86_64                       3.1.6-1.el5.remi             installed
php-pecl-imagick.x86_64                   3.0.1-1.el5.remi.1           installed
php-pecl-memcache.x86_64                  3.0.5-1.el5.remi             installed
php-pecl-xdebug.x86_64                    2.1.0-1.el5.remi             installed
php-soap.x86_64                           5.3.5-1.el5.remi             installed
php-xml.x86_64                            5.3.5-1.el5.remi             installed
remi-release.noarch                       5-8.el5.remi                 installed

It works.

有用。