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

Re: keeps servers consistant (debs)



On Thu, Nov 09, 2006 at 04:16:56 +0200, Ratiu Petru wrote:
> On Mon, 06 Nov 2006, Kevin Mark wrote:
> 
> > On Sun, Nov 05, 2006 at 05:45:01PM -0800, Jason Morehouse wrote:
> > > Hello,
> > > 
> > > Just wondering if there is an existing solution (or home-rolled script) 
> > > to keep packages consistent across multiple servers.
> > > 
> > > The standard repositories are fine, and caching isn't needed (ala 
> > > apt-proxy), as they are on different networks.  But if I install / 
> > > remove packages on a server, I'd like to do the same on other servers 
> > > without having to keep track.  Also when I create a new server, id like 
> > > to quickly remove and apt-get packages from a master list.
> > > 
> > > Any ideas?
> > > 
> > > Thanks,
> > Hi Jason,
> > 
> > dpkg --get-selections|grep -v deinstall > package.list
> > will get the Debian package names sans the version number.
> > 
> Is there a way to do this in such a way to preserve aptitude's database,
> too? I'm talking primarily about the auto/noauto status of packages.

This will give you a list of all automatically installed packages:

aptitude -F %p search '~M' > automatic.txt

Then it should be possible to do this on the new system:

aptitude unmarkauto '~i'
aptitude markauto $(cat automatic.txt)

Disclaimer: I have never actually tried the second part myself.

> I've previously used dpkg --set-selections < sel.txt && apt-get
> dselect-upgrade and it worked like a charm, but I'm now considering to start
> using aptitude for package management, as it's the recommended package
> manager since sarge.

It might be possible to just copy /var/lib/aptitude/pkgstates to the new
box if you are absolutely sure that you installed the exact same
packages. I don't know what happens if there is a discrepancy between
aptitude's pkgstates and the dpkg database. My guess is that aptitude
will adjust its own database since it has to allow for the possibility
that the user (un)installed something with dpkg.

-- 
Regards,
          Florian



Reply to: