LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2009, 10:37 AM   #1
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Rep: Reputation: 61
determine what packages depend on a given rpm


I know rpm -qR package_name will list the packages that package_name depends on. I'm trying to determine if there is a way to list the packages that depend on package_name?

Before I remove a package, I would like to determine if any other packages depend on it.

Thanks!
 
Old 05-06-2009, 11:02 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 11
Posts: 8,265

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
Quote:
Originally Posted by bradvan View Post
I'm trying to determine if there is a way to list the packages that depend on package_name?

Before I remove a package, I would like to determine if any other packages depend on it.
Use the --test option in rpm:

rpm --test -e package_name

See:

man rpm

---------------------------
Steve Stites
 
Old 05-06-2009, 02:15 PM   #3
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
If the system uses yum (current RH variants), the you can use yum remove package. It will list everything that is to be removed and give you a y/n on whether to continue.

You really should tell us what distro, version, and arch whenever you ask a question. Otherwise it is really tough to be of any real assistance.
 
Old 05-06-2009, 04:03 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
rpm -q --whatrequires package_name
 
1 members found this post helpful.
Old 05-07-2009, 06:03 AM   #5
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Original Poster
Rep: Reputation: 61
Hi,

Sorry, I thought it was just a generic rpm question. My versions are RHEL 3,4, and 5.

I don't think --test or --whatrequires will do it. I think --test just tests the rpm package for completeness and/or errors. Whatrequires I think will give me an option, but it doesn't take a package name as an argument, but rather a capability. So, if I'm trying to find out if any other packages depend on /usr/jdk1.3/bin/java, it looks like:

rpm -q --whatrequires /usr/jdk1.3/bin/java

will tell me. Unfortunately, no yum servers on this network.

Thanks for the input guys!
 
Old 05-07-2009, 07:13 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Nope. The --whatrequires and --whatprovides options accept also the name of a package as capability. Consider the following example:
Code:
$ rpm -ql startup-notification
/usr/lib/libstartup-notification-1.so.0
/usr/lib/libstartup-notification-1.so.0.0.0
/usr/share/doc/startup-notification-0.8
/usr/share/doc/startup-notification-0.8/AUTHORS
/usr/share/doc/startup-notification-0.8/COPYING
/usr/share/doc/startup-notification-0.8/ChangeLog
$ rpm -q --whatprovides libstartup-notification-1.so.0
startup-notification-0.8-4.1
$ rpm -q --whatrequires libstartup-notification-1.so.0
startup-notification-0.8-4.1
libwnck-2.16.0-4.fc6
metacity-2.16.0-10.el5
gnome-desktop-2.16.0-1.el5.centos.1
gnome-panel-2.16.1-7.el5
eel2-2.16.1-1.el5
nautilus-2.16.2-7.el5
gnome-utils-2.16.0-5.el5
nautilus-open-terminal-0.6-6.el5
eog-2.16.0.1-6.el5
gnome-terminal-2.16.0-3.el5
control-center-2.16.0-16.el5
totem-2.16.7-4.el5
gnome-applets-2.16.0.1-19.el5
gnome-session-2.16.0-6.el5.centos
yelp-2.16.0-22.el5
metacity-2.16.0-12.el5
gnome-terminal-2.16.0-5.3.el5
$ rpm -q --whatrequires startup-notification
libwnck-2.16.0-4.fc6
metacity-2.16.0-10.el5
gnome-desktop-2.16.0-1.el5.centos.1
metacity-2.16.0-12.el5
$ rpm -q --whatprovides startup-notification
startup-notification-0.8-4.1
The problem is that the --whatrequires <package> output lists a group of packages and each of them can be required from other packages and so on. So that it is difficult to retrieve the complete chain of dependencies using this method. The method suggested by lazlow perhaps is the most complete:
Code:
# yum remove startup-notification
<omitted>
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                                 Arch              Version                           Repository            Size
========================================================================================================================
Removing:
 startup-notification                    i386              0.8-4.1                           installed             67 k
Removing for dependencies:
 ImageMagick                             i386              6.2.8.0-4.el5_1.1                 installed             11 M
 ImageMagick-perl                        i386              6.2.8.0-4.el5_1.1                 installed            307 k
 NetworkManager-gnome                    i386              1:0.7.0-4.el5_3                   installed            891 k
 alacarte                                noarch            0.10.0-1.fc6                      installed            604 k
 bluez-gnome                             i386              0.5-5.fc6                         installed             43 k
 bluez-utils                             i386              3.7-2.2.el5.centos                installed            778 k
 control-center                          i386              1:2.16.0-16.el5                   installed            8.1 M
 desktop-printing                        i386              0.19-20.2.el5                     installed            259 k
 dogtail                                 noarch            0.6.1-2.el5                       installed            667 k
 eel2                                    i386              2.16.1-1.el5                      installed            1.1 M
 ekiga                                   i386              2.0.2-7.0.2                       installed             11 M
 eog                                     i386              2.16.0.1-6.el5                    installed            1.8 M
 esc                                     i386              1.0.0-39.el5                      installed            1.1 M
 evince                                  i386              0.6.0-8.el5                       installed            2.7 M
 evolution                               i386              2.12.3-8.el5_2.3                  installed             36 M
 evolution-connector                     i386              2.12.3-4.el5_2.1                  installed            2.3 M
 evolution-data-server                   i386              1.12.3-10.el5_3.3                 installed             11 M
 evolution-data-server                   i386              1.12.3-6.el5_2.3                  installed             11 M
 evolution-webcal                        i386              2.7.1-6                           installed            265 k
 file-roller                             i386              2.16.0-2.fc6                      installed            3.5 M
 firefox                                 i386              3.0.10-1.el5.centos               installed             14 M
 firstboot                               i386              1.4.27.7-1.el5.centos             installed            966 k
 firstboot                               noarch            1.4.27.3-1.el5.centos             installed            974 k
 gcalctool                               i386              5.8.25-1.el5                      installed            4.1 M
 gconf-editor                            i386              2.16.0-3.el5                      installed            852 k
 gdm                                     i386              1:2.16.0-46.el5.centos            installed             10 M
 gdm                                     i386              1:2.16.0-47.el5.centos            installed             10 M
 gedit                                   i386              1:2.16.0-9.el5                    installed             17 M
 gimp                                    i386              2:2.2.13-2.0.7.el5                installed             25 M
 gimp-data-extras                        noarch            2.0.1-1.1.1                       installed            7.6 M
 gimp-help                               noarch            2-0.1.0.10.1.1                    installed             64 M
 gimp-print-plugin                       i386              4.2.7-22                          installed             95 k
 gimp-print-plugin                       i386              4.2.7-22.2.el5                    installed             95 k
 gnome-applet-sensors                    i386              1.7.10-1.el5.rf                   installed            234 k
 gnome-applets                           i386              1:2.16.0.1-19.el5                 installed             31 M
 gnome-desktop                           i386              2.16.0-1.el5.centos.1             installed            1.9 M
 gnome-games                             i386              1:2.16.0-1.fc6                    installed             19 M
 gnome-games                             i386              1:2.16.0-2.el5                    installed             19 M
 gnome-media                             i386              2.16.1-3.el5                      installed            5.2 M
 gnome-mount                             i386              0.5-3.el5                         installed            228 k
 gnome-netstatus                         i386              2.12.0-5.el5                      installed            972 k
 gnome-panel                             i386              2.16.1-7.el5                      installed             10 M
 gnome-pilot                             i386              2.0.13-16                         installed            1.7 M
 gnome-power-manager                     i386              2.16.0-9.el5                      installed            6.1 M
 gnome-power-manager                     i386              2.16.0-10.el5                     installed            6.1 M
 gnome-python2                           i386              2.16.0-1.fc6                      installed            588 k
 gnome-python2-applet                    i386              2.16.0-2.el5                      installed             16 k
 gnome-python2-bonobo                    i386              2.16.0-1.fc6                      installed            167 k
 gnome-python2-canvas                    i386              2.16.0-1.fc6                      installed             45 k
 gnome-python2-desktop                   i386              2.16.0-2.el5                      installed            234 k
 gnome-python2-extras                    i386              2.14.2-6.el5                      installed             62 k
 gnome-python2-gconf                     i386              2.16.0-1.fc6                      installed             71 k
 gnome-python2-gnomeprint                i386              2.16.0-2.el5                      installed            427 k
 gnome-python2-gnomevfs                  i386              2.16.0-1.fc6                      installed            163 k
 gnome-python2-gtksourceview             i386              2.16.0-2.el5                      installed            347 k
 gnome-python2-libegg                    i386              2.14.2-6.el5                      installed            113 k
 gnome-screensaver                       i386              2.16.1-8.el5                      installed            3.3 M
 gnome-session                           i386              2.16.0-6.el5.centos               installed            1.3 M
 gnome-spell                             i386              1.0.7-3.1                         installed            258 k
 gnome-system-monitor                    i386              2.16.0-3.el5                      installed            2.9 M
 gnome-terminal                          i386              2.16.0-3.el5                      installed            8.4 M
 gnome-terminal                          i386              2.16.0-5.3.el5                    installed            8.4 M
 gnome-utils                             i386              1:2.16.0-5.el5                    installed            8.5 M
 gnome-vfs2                              i386              2.16.2-4.el5                      installed            4.7 M
 gnome-vfs2-smb                          i386              2.16.2-4.el5                      installed             28 k
 gnome-volume-manager                    i386              2.15.0-5.el5                      installed            1.9 M
 gok                                     i386              1.2.0-2.el5                       installed            9.2 M
 gstreamer                               i386              0.10.9-3.el5                      installed            1.4 M
 gstreamer-plugins-bad                   i386              0.10.8-2.el5.rf                   installed            6.8 M
 gstreamer-plugins-base                  i386              0.10.20-3.0.1.el5_3               installed            2.4 M
 gstreamer-plugins-good                  i386              0.10.9-1.el5_3.1                  installed            2.4 M
 gstreamer-plugins-ugly                  i386              0.10.9-1.el5.rf                   installed            1.9 M
 gthumb                                  i386              2.7.8-8.el5                       installed            5.6 M
 gtkhtml2                                i386              2.11.0-3                          installed            431 k
 gtkhtml3                                i386              3.16.3-1.el5                      installed            2.9 M
 gtweakui                                i386              0.4.0-1.el5.rf                    installed            271 k
 gucharmap                               i386              1.8.0-1.fc6                       installed            5.8 M
 hal-gnome                               i386              0.5.8.1-38.el5                    installed            205 k
 im-chooser                              i386              0.3.3-6.el5                       installed            188 k
 krb5-auth-dialog                        i386              0.7-1                             installed             52 k
 libbonoboui                             i386              2.16.0-1.fc6                      installed            1.2 M
 libgail-gnome                           i386              1.1.3-1.2.1                       installed             60 k
 libgnome                                i386              2.16.0-6.el5                      installed            3.3 M
 libgnomeui                              i386              2.16.0-5.el5                      installed            3.1 M
 libgsf                                  i386              1.14.1-6.1                        installed            258 k
 libnotify                               i386              0.4.2-6.el5                       installed             87 k
 librsvg2                                i386              2.16.1-1.el5                      installed            425 k
 libwnck                                 i386              2.16.0-4.fc6                      installed            517 k
 libwpd                                  i386              0.8.7-3.el5                       installed            535 k
 metacity                                i386              2.16.0-10.el5                     installed            9.5 M
 metacity                                i386              2.16.0-12.el5                     installed            9.5 M
 nautilus                                i386              2.16.2-7.el5                      installed             12 M
 nautilus-cd-burner                      i386              2.16.0-7.el5                      installed            1.7 M
 nautilus-extensions                     i386              2.16.2-7.el5                      installed             31 k
 nautilus-open-terminal                  i386              0.6-6.el5                         installed             57 k
 nautilus-sendto                         i386              0.7-6.el5.centos                  installed            156 k
 nautilus-sendto                         i386              0.7-5.fc6                         installed            172 k
 notification-daemon                     i386              0.3.5-9.el5                       installed            103 k
 notify-python                           i386              0.1.0-3.fc6                       installed             24 k
 nspluginwrapper                         i386              0.9.91.5-22.el5                   installed            302 k
 openoffice.org-calc                     i386              1:2.3.0-6.10.el5                  installed             20 M
 openoffice.org-core                     i386              1:2.3.0-6.10.el5                  installed            228 M
 openoffice.org-draw                     i386              1:2.3.0-6.10.el5                  installed            2.9 M
 openoffice.org-graphicfilter            i386              1:2.3.0-6.10.el5                  installed            460 k
 openoffice.org-impress                  i386              1:2.3.0-6.10.el5                  installed            4.8 M
 openoffice.org-math                     i386              1:2.3.0-6.10.el5                  installed            3.4 M
 openoffice.org-pyuno                    i386              1:2.3.0-6.10.el5                  installed            438 k
 openoffice.org-writer                   i386              1:2.3.0-6.10.el5                  installed            7.2 M
 openoffice.org-xsltfilter               i386              1:2.3.0-6.10.el5                  installed            257 k
 orca                                    i386              1.0.0-5.el5                       installed            3.4 M
 pirut                                   noarch            1.3.28-13.el5.centos              installed            1.4 M
 planner                                 i386              0.14.1-4.el5                      installed            5.9 M
 planner                                 i386              0.14-3                            installed            5.8 M
 policycoreutils-gui                     i386              1.33.12-14.2.el5                  installed            523 k
 policycoreutils-gui                     i386              1.33.12-14.el5                    installed            523 k
 rhythmbox                               i386              0.11.6-4.el5                      installed             12 M
 sound-juicer                            i386              2.16.0-3.el5                      installed            2.4 M
 system-config-date                      noarch            1.8.12-3.el5.centos.2             installed            3.6 M
 system-config-display                   noarch            1.0.48-2.el5                      installed            786 k
 system-config-keyboard                  noarch            1.2.11-1.el5                      installed            193 k
 system-config-network                   noarch            1.3.99.10-2.el5                   installed            2.3 M
 system-config-network                   noarch            1.3.99.12-1.el5                   installed            2.3 M
 totem                                   i386              2.16.7-4.el5                      installed            5.0 M
 unoconv                                 noarch            0.3-2.el5.rf                      installed            163 k
 vino                                    i386              2.13.5-6.el5                      installed            1.1 M
 xsane-gimp                              i386              0.991-5.el5                       installed            619 k
 xulrunner                               i386              1.9.0.10-1.el5                    installed             24 M
 xulrunner-devel                         i386              1.9.0.10-1.el5                    installed             36 M
 yelp                                    i386              2.16.0-22.el5                     installed            2.0 M

Transaction Summary
========================================================================================================================
Install      0 Package(s)         
Update       0 Package(s)         
Remove     130 Package(s)         

Is this ok [y/N]: N
This tells you that it is not a good idea to remove startup-notification from your system!
 
1 members found this post helpful.
Old 05-07-2009, 09:01 AM   #7
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Original Poster
Rep: Reputation: 61
Interesting. I see what I was doing wrong with the whatrequires. I did for example:

rpm -qa | grep glibc

and saw glibc-2.5-12 listed. So I then did:

rpm -q --whatrequires glibc-2.5-12 and got back no package requires glibc-2.5-12. When I changed that to rpm -q --whatrequires glibc, I received a list of packages.

I think this will do to start. I'm just trying to determine if any package depends on another one. If not and the developers aren't using it, I'm just going to remove it.

Thanks!
 
Old 05-07-2009, 09:22 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Yes. It accepts the package name but not the version number. Anyway, it is not an easy task, due to the huge chain of dependencies: if you check one package you have to check all the package which depends on it, then all the package which depends on them and so on. If you have a little list of package not used by developers you can do that manually using the yum remove <package> method (which does the recursion for you) otherwise... it should be a panic!
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get the packages that depend in download RPM? nadavvin Linux - Software 2 08-26-2008 06:51 AM
How do I get the packages that depend in download RPM? nadavvin Linux - Software 1 08-24-2008 06:11 PM
How do I get list of which packages one rpm depend on? nadavvin Linux - General 10 01-04-2007 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration