LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 12-05-2005, 05:25 AM   #1
arunvk
Member
 
Registered: Nov 2005
Location: India
Distribution: Fedora 11
Posts: 192

Rep: Reputation: 30
help with rpm command


hi

my query is regarding rpm with the -e option.

usually i maintain a list of all the rpms that i have installed. so whenever i want to erase an rpm i refer to this list and then go to the shell and individually erase them. this takes a lot of time.

i want to know is it possible to put the list in the command itself that will act as an input to the rpm command.eg.

rpm -e < rpm_list.txt

i think the '<' and '>' operators are used for directing the i/o of a command.

i tried the above command but i got an error. did i do something wrong or its just that iam attempting something thats not possible.

anyone with solutions.

thanks.
 
Old 12-05-2005, 08:16 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 53
If you want to make a list of all installed rpms, you could use this command: rpm -qa | sort > list.txt

A more detailed list comes from this command:
Code:
rpm -qa --qf 'Installed on %{installtime:date}     %{vendor}     %{name} %{version}-%{release}\n' | sort > list.txt
 
Old 12-05-2005, 09:27 PM   #3
arunvk
Member
 
Registered: Nov 2005
Location: India
Distribution: Fedora 11
Posts: 192

Original Poster
Rep: Reputation: 30
hi

i dont want redirect the ouput to a file. what i want is to do the other way. to specify the file that will act as an input to the command. this way iam hoping that i dont have to type each package inorder to remove it.

thanks.
 
Old 12-09-2005, 04:21 AM   #4
furcatus
Member
 
Registered: Dec 2005
Location: The Netherlands
Distribution: Ubuntu 6.06 Dapper Drake
Posts: 39

Rep: Reputation: 15
Quick question

If I run that command will it search all installed rpms automaticly or do I have to specifie something?
 
Old 12-09-2005, 05:02 AM   #5
FogSwimmer
Member
 
Registered: Sep 2003
Distribution: Kubuntu / debian / SuSE
Posts: 73

Rep: Reputation: 15
Quote:
Originally Posted by arunvk
hi

i dont want redirect the ouput to a file. what i want is to do the other way. to specify the file that will act as an input to the command. this way iam hoping that i dont have to type each package inorder to remove it.

thanks.
Hi arunvk,

all I can come up with is a workaround. Create a simple shell script uninstall.sh as follows:

#!/bin/sh
progs=`cat rpm_list.txt`
for prog in $progs
do
rpm -e $prog
done

then make it executable:
$ chmod +x uninstall.sh

and execute (as root probably)
# ./uninstall.sh

f
 
Old 12-09-2005, 05:32 AM   #6
FogSwimmer
Member
 
Registered: Sep 2003
Distribution: Kubuntu / debian / SuSE
Posts: 73

Rep: Reputation: 15
Another way of doing this may be

# PROG=`cat rpm_list.txt` && rpm -e $PROG

f
 
Old 12-10-2005, 09:15 AM   #7
arunvk
Member
 
Registered: Nov 2005
Location: India
Distribution: Fedora 11
Posts: 192

Original Poster
Rep: Reputation: 30
thanks a lot. u saved me a lot of typing overhead.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get the rpm command and rpm build command on my Debian box? abefroman Debian 6 11-28-2005 12:38 PM
problem with rpm command saipraveen Linux - Newbie 3 08-22-2005 03:51 PM
rpm -q command praveenv Linux - Newbie 2 09-08-2004 04:41 AM
RPM command question Rodcl Linux - General 1 06-12-2002 03:59 AM
rpm command loganwva Linux - General 3 03-13-2002 09:48 AM


All times are GMT -5. The time now is 01:28 AM.

Main Menu
 
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
Open Source Consulting | Domain Registration