[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fwd: How to check Bio-Linux package selections



On 05/01/2011 08:42 PM, Tony Travis wrote:
On 29/04/11 22:20, Steffen Möller wrote:
[..]
Hi, Steffen and Will.

I originally wrote this to help me port Bio-Linux4 to Ubuntu 6.06 LTS, but I've used it with all versions up to and including
Bio-Linux6 and Ubuntu 10.04 LTS. I'm using it right now to make sure my Ununtu 10.04 LTS servers are as similar as possible to
Bio-Linux 6. I also use it to check what packages are installed on my laptop version of Bio-Linux6.

Back in the day, when I used Debian, the mantra I learned to clone an installation from one machine to another was:

On the source machine:

dpkg --get-selections > packages.sel

On the destination machine:

dpkg --set-selections < packages.sel
apt-get dselect-upgrade

This is what I based the script on, but I also find it useful to track the packages installed on various machines against the
Bio-Linux list, or compare machines against each other. I posted it to the Debian-Med list because I suspect there are better ways
of doing it using some clever Debian tools that I don't know about.

An answer you might like is to constrain the --get-selection to those packages that are referred to by the med-bio package.
One could to it all on a single command line, but just show how it developed I am splitting it up a bit

apt-cache show med-bio med-bio-dev | egrep '^(Depends|Recommends)' | cut -f2 -d: | tr "," "\n" | sed -e 's/^ //' -e 's/ .*//' | sort -u > /tmp/a

That sorting is not required. Somehow I had difficulties with the tool "join" to accept the sort of --get-selections as sorted when run through sort -u -k1,2. I gave up on it so I am now just using it within this grep

dpkg --get-selections | egrep "^(`tr "\n" "|" < /tmp/a | sed -e 's/.$/)/'`"

and the one liner would be

dpkg --get-selections | egrep "^(`apt-cache show med-bio med-bio-dev | egrep '^(Depends|Recommends)' | cut -f2 -d: | tr "," "\n" | sed -e 's/^ //' -e 's/ .*//' | tr "\n" "|" | sed -e 's/.$/)/'`


For my laptop this is
autodock                                        install
[19 others ... thought this would be more ...]
t-coffee                                        install

Cheers,

Steffen


Reply to: