LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-25-2004, 07:52 AM   #1
zael
LQ Newbie
 
Registered: Aug 2003
Posts: 26

Rep: Reputation: 15
Script to Remove a List of Debian Packages


Does any one know how i can write a script that will remove a list of debian packages using apt-get?
 
Old 05-25-2004, 07:55 AM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
if you know the package names and the syntax of the apt-get remove or whatever it is.

for i in `cat list_of_packages`;do apt-get remove stuff here $i;done
 
Old 05-25-2004, 08:45 PM   #3
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
Are you doing something especialy different? If you want to remove several packages via apt-get you simply list them all with a space between the names. All will be removed as well as what depends on them.
Code:
apt-get remove package_a package_b package_c package_d...
 
Old 05-26-2004, 09:13 AM   #4
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
*shrug* he asked for a script, not how to do it via just the command line :-P
 
Old 05-26-2004, 05:02 PM   #5
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
I know that. I was just wondering why one would need to write a script for a one-shot thing. Once a package is removed, its gone. Why script the script?
 
Old 05-27-2004, 06:08 AM   #6
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Maybe because the list of packages-to-remove are in a file. But in that case the command coudl be easily changed to something like:

cat packagelist.txt | xargs apt-get remove
 
Old 05-27-2004, 05:36 PM   #7
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
I await zael's answer
 
  


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
list installed debian packages Fernandoch Debian 4 07-07-2005 05:16 AM
List of 6600 packages on Debian Sarge bamboo_spider Debian 4 04-21-2005 10:49 AM
get list of latest list of packages bobwall Linux - Distributions 1 11-30-2004 03:48 PM
Mandrake Update/Install Packages/Remove Packages wslyhbb Mandriva 2 03-15-2004 09:43 AM
List and remove rpms linuxturtle Linux - General 3 09-24-2003 01:01 AM


All times are GMT -5. The time now is 02:48 PM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration