Hi all
Is there any easy way to get the description of all packages listed in a file which contains the names of all such packages?
eg. i used sudo dpkg --get-selections >installed-software
to make a list of all installed software packages on my system However I want to remove some of them in batch mode (from the command line) instead of by using synaptic and deleting them one by one which is a cumbersome process. So the description of such packages is needed in another file containing a subset of names of packages likely to be removed.
How can this be done ?
Kussh
On Thu, Dec 30, 2010 at 9:42 AM, Kussh Singh kussh.singh@gmail.com wrote:
Hi all
Is there any easy way to get the description of all packages listed in a file which contains the names of all such packages?
eg. i used sudo dpkg --get-selections >installed-software
to make a list of all installed software packages on my system However I want to remove some of them in batch mode (from the command line) instead of by using synaptic and deleting them one by one which is a cumbersome process. So the description of such packages is needed in another file containing a subset of names of packages likely to be removed.
How can this be done ?
From your description, I haven't understood your requirement very well.
Though I suspect you might be looking at something like this:
dpkg --get-selections | sed -es'![ \t]+.+$!!' | tee /var/tmp/installed-software | xargs apt-cache depends
/var/tmp/software-dpendencies
It lists down all the dependencies/suggestions/conflicts of packages installed on your system. If you just want to find out dependencies of few select packages you want to remove, then put their names (one per line) in a file, (say packages-to-remove) and run the following:
cat packages-to-remove | xargs apt-cache depends >/var/tmp/pkg-dpendencies
Raghu
On Fri, Dec 31, 2010 at 12:42 PM, Raghu Prasad prasad.raghu.k@gmail.comwrote:
From your description, I haven't understood your requirement very well. Though I suspect you might be looking at something like this:
dpkg --get-selections | sed -es'![ \t]+.+$!!' | tee /var/tmp/installed-software | xargs apt-cache depends
/var/tmp/software-dpendencies
It lists down all the dependencies/suggestions/conflicts of packages installed on your system. If you just want to find out dependencies of few select packages you want to remove, then put their names (one per line) in a file, (say packages-to-remove) and run the following:
cat packages-to-remove | xargs apt-cache depends >/var/tmp/pkg-dpendencies
Raghu
Thank you for the info. I was thinking of removing certain packages in one go that were tried out but were not found suitable in a new installation--so description of all packages installed earlier was needed. Thank you for your response. I guess I will have to go thru the apt documentation fairly rigorously in order to get the description of each package in one go.
Kussh
On Sat, Jan 1, 2011 at 4:30 AM, Kussh Singh kussh.singh@gmail.com wrote:
On Fri, Dec 31, 2010 at 12:42 PM, Raghu Prasad prasad.raghu.k@gmail.comwrote:
From your description, I haven't understood your requirement very well. Though I suspect you might be looking at something like this:
dpkg --get-selections | sed -es'![ \t]+.+$!!' | tee /var/tmp/installed-software | xargs apt-cache depends
/var/tmp/software-dpendencies
It lists down all the dependencies/suggestions/conflicts of packages installed on your system. If you just want to find out dependencies of few select packages you want to remove, then put their names (one per line) in a file, (say packages-to-remove) and run the following:
cat packages-to-remove | xargs apt-cache depends >/var/tmp/pkg-dpendencies
Raghu
Thank you for the info. I was thinking of removing certain packages in one go that were tried out but were not found suitable in a new installation--so description of all packages installed earlier was needed. Thank you for your response. I guess I will have to go thru the apt documentation fairly rigorously in order to get the description of each package in one go.
try
$ apt-cache show $(dpkg --get-selections |cut -f1) > package-desc.lst
The file will have all the packages install on your system along with their description
After your remove packages also try
# apt-get autoremove
to remove all packages not required on the system due to the dependencies removed from the system.
Kussh
HTH With regards, -- --Dinesh Shah :-) Shah Micro System Pvt. Ltd. +91-98213-11906 +91-9833-TICKET http://www.shahmicro.com http://iopt.in http://crm.iopt.in Blog: http://dineshah.wordpress.com
2011/1/1 Dinesh Shah (દિનેશ શાહ/दिनेश शाह) dineshah@gmail.com
try
$ apt-cache show $(dpkg --get-selections |cut -f1) > package-desc.lst
The file will have all the packages install on your system along with their description
After your remove packages also try
# apt-get autoremove
to remove all packages not required on the system due to the dependencies removed from the system.
THANKS and a very happy 2011
Kussh
On Saturday 01 January 2011 04:30 AM, Kussh Singh wrote:
On Fri, Dec 31, 2010 at 12:42 PM, Raghu Prasadprasad.raghu.k@gmail.comwrote:
From your description, I haven't understood your requirement very well. Though I suspect you might be looking at something like this:
dpkg --get-selections | sed -es'![ \t]+.+$!!' | tee /var/tmp/installed-software | xargs apt-cache depends
/var/tmp/software-dpendencies
It lists down all the dependencies/suggestions/conflicts of packages installed on your system. If you just want to find out dependencies of few select packages you want to remove, then put their names (one per line) in a file, (say packages-to-remove) and run the following:
cat packages-to-remove | xargs apt-cache depends>/var/tmp/pkg-dpendencies
Raghu
Thank you for the info. I was thinking of removing certain packages in one go that were tried out but were not found suitable in a new installation--so description of all packages installed earlier was needed. Thank you for your response. I guess I will have to go thru the apt documentation fairly rigorously in order to get the description of each package in one go.
That would be easy. Just list down such packages in a file, say pkgs_to_remove.txt; one per line. Then run the following:
cat pkgs_to_remove.txt | xargs apt-get remove
It will remove all such packages in one go. Then there could be some packages/libraries which were installed as part of some of the packages you had just removed. To remove all those packages which are no longer needed in the system, run the following:
apt-get autoremove
From the man page of apt-get:
"autoremove is used to remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed."
Raghu
On Thursday 06 January 2011 10:53 AM, Raghu Prasad wrote:
cat pkgs_to_remove.txt | xargs apt-get remove
Xargs looks like a nice command. Thanks!
Very useful in running the same command over a list of lines in a text file.
2011/1/6 Rony gnulinuxist@gmail.com:
On Thursday 06 January 2011 10:53 AM, Raghu Prasad wrote:
cat pkgs_to_remove.txt | xargs apt-get remove
Xargs looks like a nice command. Thanks!
Very useful in running the same command over a list of lines in a text file.
Yes, though the "cat" there is superfluous:
xargs apt-get remove < pkgs_to_remove.txt
Also see: http://en.wikipedia.org/wiki/Cat_%28Unix%29#Useless_use_of_cat
Binand