LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 11-21-2007, 02:31 PM   #1
jCash
Member
 
Registered: Sep 2006
Posts: 57

Rep: Reputation: 15
centos how to check for dependency and uninstall package


I am running centos 5.

1) How do I use rpm command to list the package installed and its dependency.

2) How do I use rpm command to uninstall package and its dependency?

thnx.

Last edited by jCash; 11-21-2007 at 02:43 PM.
 
Old 11-21-2007, 03:01 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
This command will list any package that has "fox" in it's name...
Code:
rpm -qa | grep fox
This command will list what is required by the firefox package...
Code:
rpm -q -R firefox
This command will erase the firefox package...
Code:
rpm -e firefox
If something depends on a package you are erasing, it will error and tell you what it is. You can then add it to the erase command if you want, or not do anything. (Thunderbird doesn't depend on firefox, that's just an example of erasing two packages at once.)
Code:
rpm -e firefox thunderbird
It's prob'ly not a good idea to run a command that tries to delete all dependencies for a package... In the example above, it lists about 100 dependencies for firefox.

Now, having answered the questions, is there a reason you need / want to use rpm rather than yum? yum is a package manager that uses rpm. yum is also better at handling dependencies than rpm. The commands above would be similar in yum...
Code:
yum list | grep fox
Code:
yum deplist firefox
Code:
yum remove firefox
This command will install GIMP. It will check if there are any dependencies that need to be downloaded and installed, and do so. rpm won't retrieve dependencies, just error when you don't have them.
Code:
yum install gimp
 
Old 11-21-2007, 04:30 PM   #3
jCash
Member
 
Registered: Sep 2006
Posts: 57

Original Poster
Rep: Reputation: 15
I have package A, B and C. Package A needs B and B needs C.
I want to uninstall package A. If do:

Code:
rpm -e packA
I will complain about packB.
Code:
rpm -e packA, packB
then it will complain about packC. Do I have to keep doing this until I get to the bottom of the dependency and add the package to the command
Code:
rpm -e packA,..,packZ
?

Or any simpler way to remove or at least list this type of package dependency?
 
Old 11-21-2007, 05:27 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have you tried yum remove? It should be able to do this for you
 
Old 11-22-2007, 10:14 PM   #5
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
Quote:
Originally Posted by jCash View Post
I have package A, B and C. Package A needs B and B needs C.
I want to uninstall package A.
If you remove A, it should go without a problem... In your example, nothing depends on A.

Unfortunately, you'll have to track down and remove any packages A depends on.
 
Old 03-03-2010, 09:41 AM   #6
tuewru
LQ Newbie
 
Registered: Feb 2010
Location: Hanoi - Vietnam
Distribution: Centos v5
Posts: 9

Rep: Reputation: 0
You can use YUM for install and uninstall packages

Task: Display list of updated software (security fix)

Quote:
Type the following command at shell prompt:
# yum list updates

Task: List all installed packages


List all installed packages, enter:
# rpm -qa
# yum list installed

Task: Check for and update specified packages

# yum update {package-name-1}

Task: Search for packages by name

Search httpd and all matching perl packages, enter:
# yum list {package-name}
# yum list {regex}
# yum list httpd
# yum list perl*


Task: Install the specified packages [ RPM(s) ]


Install package called httpd:
# yum install {package-name-1} {package-name-2}
# yum install httpd

Task: Remove / Uninstall the specified packages [ RPM(s) ]

Remove package called httpd, enter:
# yum remove {package-name-1} {package-name-2}
# yum remove httpd


Task: Update all the default packages by group


Update all 'Development Tools' group packages, enter:
# yum groupupdate "Development Tools"


Code:
http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/
Best regards
 
Old 03-03-2010, 08:26 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Please don't bring up old posts (3 yrs old).
 
  


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
library dependency check matters Slackware 1 06-18-2007 11:22 AM
centos & madwifi rpm madness (weird dependency issue) angryfirelord Linux - Wireless Networking 3 10-05-2006 04:35 PM
How to check if a package(eg. gdebi)will be available in 'Etch' as binary package? Akhran Debian 4 08-28-2006 12:53 PM
Dependency check possible? Slovak Slackware 8 12-02-2004 10:56 PM
from source/dependency check TheBman Linux - Software 1 12-30-2003 03:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration