Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-08-2017, 12:05 PM
|
#1
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Rep:
|
Better way to query packages on a RHEL system?
Working with RHEL 6.8 x86_64 and working to install 3rd party software.
I have to query the default install to confirm what packages are installed and if they are the correct version. I'm basically just typing this command this over and over:
Code:
rpm -qa | grep -i "insert package here" >> /tmp/output.txt
Say when I query Python, I got back more packages then I wanted, so I had to do some cleanup of output.txt file.
Is there a better way to go about doing this?
thanks
|
|
|
05-08-2017, 12:16 PM
|
#2
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
yum list installed 'package'
I.E.
Code:
$ yum list installed 'php*'
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: centos.mirroring.pulsant.co.uk
* epel: mirror.freethought-internet.co.uk
* remi-php70: remi.mirror.wearetriple.com
* remi-safe: remi.mirror.wearetriple.com
* updates: mirror.sov.uk.goscomb.net
Installed Packages
php-cli.x86_64 7.0.11-1.el7.remi @remi-php70
php-common.x86_64 7.0.11-1.el7.remi @remi-php70
php-fpm.x86_64 7.0.11-1.el7.remi @remi-php70
php-gd.x86_64 7.0.11-1.el7.remi @remi-php70
php-imap.x86_64 7.0.11-1.el7.remi @remi-php70
php-json.x86_64 7.0.11-1.el7.remi @remi-php70
php-ldap.x86_64 7.0.11-1.el7.remi @remi-php70
php-mysqlnd.x86_64 7.0.11-1.el7.remi @remi-php70
php-opcache.x86_64 7.0.11-1.el7.remi @remi-php70
php-pdo.x86_64 7.0.11-1.el7.remi @remi-php70
php-xml.x86_64 7.0.11-1.el7.remi @remi-php70
Giving no package name will return ALL installed packages.
Last edited by r3sistance; 05-08-2017 at 12:18 PM.
|
|
|
05-08-2017, 07:56 PM
|
#3
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Original Poster
Rep:
|
A little better, however still have to manipulate it via cli to clean it up:
Code:
[root@server etc]# yum list installed 'python*'
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Installed Packages
python.x86_64 2.7.5-48.el7 @rhui-REGION-rhel-server-releases
python-IPy.noarch 0.75-6.el7 @anaconda/7.0
python-babel.noarch 0.9.6-8.el7 @rhui-REGION-rhel-server-releases
python-backports.x86_64 1.0-8.el7 @rhui-REGION-rhel-server-releases
python-backports-ssl_match_hostname.noarch 3.4.0.2-4.el7 @anaconda/7.0
python-caribou.noarch 0.4.16-1.el7 @rhui-REGION-rhel-server-releases
python-chardet.noarch 2.0.1-7.el7 @anaconda/7.0
python-chardet.noarch 2.2.1-1.el7_1 installed
python-cheetah.x86_64 2.4.4-5.el7 @koji-override-0/7.0
python-configobj.noarch 4.7.2-7.el7 @anaconda/7.0
python-dateutil.noarch 1.5-7.el7 @anaconda/7.0
python-decorator.noarch 3.4.0-3.el7 @anaconda/7.0
python-dmidecode.x86_64 3.10.13-11.el7 @anaconda/7.0
python-ethtool.x86_64 0.8-5.el7 @anaconda/7.0
python-gudev.x86_64 147.2-7.el7 @anaconda/7.0
python-hwdata.noarch 1.7.3-4.el7 @anaconda/7.0
python-iniparse.noarch 0.4-9.el7 @anaconda/7.0
python-jinja2.noarch 2.7.2-2.el7 @rhui-REGION-rhel-server-releases
python-jsonpatch.noarch 1.2-2.el7 @koji-override-0/7.0
python-jsonpointer.noarch 1.9-2.el7 @rhui-REGION-rhel-server-releases
python-kitchen.noarch 1.1.1-5.el7 @anaconda/7.0
python-libs.x86_64 2.7.5-48.el7 @rhui-REGION-rhel-server-releases
python-lxml.x86_64 3.2.1-4.el7 @anaconda/7.0
python-magic.noarch 5.11-33.el7 @rhui-REGION-rhel-server-releases
python-markdown.noarch 2.4.1-1.el7 @epel
python-markupsafe.x86_64 0.11-10.el7 @rhui-REGION-rhel-server-releases
python-perf.x86_64 3.10.0-514.16.1.el7 @rhui-REGION-rhel-server-releases
python-pillow.x86_64 2.0.0-19.gitd1c6db8.el7 @rhui-REGION-rhel-server-releases
python-prettytable.noarch 0.7.2-1.el7 @koji-override-0/7.0
python-pycurl.x86_64 7.19.0-19.el7 @rhui-REGION-rhel-server-releases
python-pygments.noarch 1.4-9.el7 @koji-override-0/7.0
python-pyudev.noarch 0.15-7.el7_2.1 @rhui-REGION-rhel-server-releases
python-requests.noarch 2.6.0-1.el7_1 @rhui-REGION-rhel-server-releases
python-rhsm.x86_64 1.17.9-1.el7 @rhui-REGION-rhel-server-releases
python-rhsm-certificates.x86_64 1.17.9-1.el7 @rhui-REGION-rhel-server-releases
python-setuptools.noarch 0.9.8-4.el7 @rhui-REGION-rhel-server-releases
python-six.noarch 1.9.0-2.el7 @rhui-REGION-rhel-server-releases
python-urlgrabber.noarch 3.10-8.el7 @rhui-REGION-rhel-server-releases
python-urllib3.noarch 1.5-8.el7 @anaconda/7.0
python-urllib3.noarch 1.10.2-2.el7_1 installed
python2-boto.noarch 2.45.0-3.el7 @epel
python2-pyasn1.noarch 0.1.9-7.el7 @rhui-REGION-rhel-server-releases
python2-rsa.noarch
|
|
|
05-08-2017, 09:11 PM
|
#4
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,286
|
What do you expect ? - you used "-a" and a glob .... :sheesh:
If you want just (base) python use "python" in either rpm -q or dnf.
If you are running this a lot, a better idea might be to list the lot to a file and just use grep on that.
|
|
|
05-08-2017, 09:22 PM
|
#5
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,797
|
In RHEL, there is a package "rpm-cron" that you can install. It will, daily, list all installed packages into file /var/log/rpmpkgs. Running grep on that file is quite fast.
|
|
|
05-08-2017, 11:52 PM
|
#6
|
Member
Registered: Jul 2013
Posts: 749
Rep:
|
Quote:
yum list installed "*<partial_name>*"
|
For example, if you want to see available geany plugins you could run
will show any packages, installed or not, with "geany" in the package name.
Last edited by Doug G; 05-08-2017 at 11:53 PM.
|
|
|
05-09-2017, 12:55 AM
|
#7
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
No solution for Redhat, but this is why I always end up back on debian. Basically I don't need to google to find things.
$ # find by filename
$ apt-file find file.h
$ # find by partial package name, even those NOT installed
$ dpkg-query --load-avail -l '*lib*sdl*'
$ # more current method of mostly the same
$ apt-cache search --names-only sdl | grep lib
$ # show specs on a package before you install it
$ apt-cache show alsa-utils
$ # show contents of a package, even those NOT installed
$ apt-file list devscripts
$ # same for the .deb file
$ dpkg -c package.deb
$ # or if you're curious and want to find things randomly with only one command
$ less /var/lib/dpkg/available
$ # although that requires dselect installed and dselect update
$ # to populate the mostly deprecated available file
|
|
|
05-09-2017, 02:04 AM
|
#8
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,647
|
i prefer
Code:
yum provides /usr/lib64/libgimp-2.0*
that will tell you WHAT package to install to get it
|
|
|
All times are GMT -5. The time now is 03:08 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|