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

RE: Backup Package names currently installed



On Wed, 2003-10-29 at 16:51, Jochen Daum wrote:
> Thanks Haim!
> 
> > > I have a debian woody machine which I installed via FTP.
> > > 
> > > I would like to dump the names of all installed packages 
> > into a file,
> > > so that I can install them automatically with dpkg.
> > > 
> > > I tried
> > > 
> > > dpkg --get-selections
> > > 
> > > but the file doesn't contain any package versions? Can I 
> > include that
> > > as well?
> > apt-show-versions will dump all installed packages with 
> > version, but I don't
> > know how to import it. 
> >
> 
> At least I can try something with shell scripting or sed.

Hi (down 8-) ) there,

dpkg -l |grep --extended-regexp --regexp='^[uirph]c|^[uirph]i'|awk {'
print $2 "=" $3'} >/tmp/p_list

will get you a file containing all installed (?i) and configurational
(?c) packages.

cat /tmp/p_list|xargs -n 1 apt-get install -s

will apt-get those packages. after you removed the -s option, of course.

but i'm sure this can be done more elegantly.

Michael

-- 
If you don't care where you are you ain't lost!



Reply to: