LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Script to Remove a List of Debian Packages (https://www.linuxquestions.org/questions/programming-9/script-to-remove-a-list-of-debian-packages-185606/)

zael 05-25-2004 07:52 AM

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?

Technoslave 05-25-2004 07:55 AM

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

vectordrake 05-25-2004 08:45 PM

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...

Technoslave 05-26-2004 09:13 AM

*shrug* he asked for a script, not how to do it via just the command line :-P

vectordrake 05-26-2004 05:02 PM

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?

Hko 05-27-2004 06:08 AM

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

vectordrake 05-27-2004 05:36 PM

I await zael's answer


All times are GMT -5. The time now is 12:10 PM.