LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-05-2009, 12:09 PM   #1
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 168

Rep: Reputation: 30
scripting rpm/yum with --nodeps


I am trying to script the following:

rpm -qa | grep someapp

Assuming the above returned:

someapp-8.14.3-3.fc11.i386
someapp-devel-8.14.3-3.fc11.i386

I then want to remove the two using:

rpm -e --nodeps someapp-8.14.3-3.fc11.i386
rpm -e --nodeps someapp-devel-8.14.3-3.fc11.i386


Here is what I've tried, with the errors returned...

rpm -qa | grep someapp | rpm -e --nodeps
rpm: no packages given for erase


rpm -e --nodeps < rpm -qa | grep someapp
-bash: rpm: No such file or directory


rpm -qa | grep someapp > rpm -e --nodeps
grep: someapp: No such file or directory


yum remove < `rpm -qa | grep someapp`
-bash: someapp-8.14.3-3.fc11.i386: No such file or directory
 
Old 08-05-2009, 12:51 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,697
Blog Entries: 54

Rep: Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962Reputation: 2962
This is more a shell scripting question. You want something like 'rpm -e --nodeps $(rpm -qa | grep someapp)'.
 
Old 08-05-2009, 01:28 PM   #3
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 168

Original Poster
Rep: Reputation: 30
Thank you. That worked.
 
  


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
rpm -Uvh --nodeps php-5.0xxxx did a mistake pudhiyavan Linux - Software 2 06-06-2005 04:35 AM
rpm nodeps question ergo_sum Linux - Newbie 3 05-04-2005 04:39 PM
is it ok to 'rpm -e kernel --nodeps' ??? qwijibow Linux - Software 1 05-27-2004 02:21 AM
RPM still checks for dependencies even with -- nodeps . Travis86 Linux - Software 9 09-28-2003 10:15 PM
How to recover after an rpm -e --nodeps rpm ppuru Linux - General 4 08-07-2003 09:25 AM


All times are GMT -5. The time now is 06:09 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration