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

Re: Question about get-selections

On 2009-03-26_19:08:32, Douglas A. Tutty wrote:
> On Thu, Mar 26, 2009 at 04:26:12PM -0600, Paul E Condon wrote:
> > But I think I would like to have a record of what packages were
> > actually installed. So I'm thinking of writing a script, to be run
> > nightly, that puts a fresh copy of my selections in /etc/apt, e.g.
> > 
> > # dpkg --get-selections >/etc/apt/selections
> Many of those packages will have been installed automatically by your
> package manager.  If you use aptitude, you only need to record the
> packages which you manually installed:
> aptitude search `~i!~M'
> You can then install them, then aptitude will automatically install what
> is needed by them.
> I wouldn't put my backup info in /etc/apt.  Most of what is in /etc/
> (just like the rest of the file system) is managed by packages which are
> managed by apt.  You may find that what you put in /etc/apt gets changed
> (I don't know, but I wouldn't risk it).
> I keep my backups in /var/local/backup.
> Your remote script can run a local script to create the backups, then
> rsync what you want to the remote (or any other) box.
> Doug.

Well, I may sound like an orderly person, but writing down a record of
each time I install something is rather more orderly than I think I
can ever be.  I'm looking to program the computer to keep track of me.

Your suggestion does raise in interesting issue: given a set of
installed packages in a --get-selections file, and given that the
dependency information is available in the packages, what is the
minimum set of install commands to aptitude that will reconsturct the
installation from scratch? Does anyone know a way to solve this
problem? It might be a rather difficult search problem, but it might
be there is some neat trick. Does anyone here know?

I guess I could somehow search the apt system for packages that are not
in the depends list of any other package, but I think there are cycles
in the dependency linkages. The way it is used, there is no reason to
demand that the linkage network be free of cycles, like is required of
the directory tree in a file system.

Paul E Condon           

Reply to: