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

Re: Install matching set of software while preserving aptitude auto/manual install info

On Wed, Nov 05, 2008 at 12:11:55PM -0500, Brian McKee wrote:
> I'd like to 'clone' the installed software on a machine.   I can find
> lots of references to this procedure
> > Backup installed package list on current machine
> > dpkg --get-selections > selections.txt
> > move selections.txt to the new machine Set package list on new machine and install packages
> > dpkg --set-selections < selections.txt
> > apt-get update
> > apt-get upgrade
> What I can't find, but I know I've seen, is a way to do it using
> aptitude that preserves aptitude's knowledge of what was installed
> manually vs automatically.
> Can someone throw me a link (or a cluestick)

Just take a list of packages that aptitude knows are installed manually:

aptitude search '~i!~M'

You'd then want to tidy up this list so that it is just a list of
package names which could be passed to aptitude.  Then edit the list
into a script that runs

aptitude install <followed by the list of packages>

Remember to escape the newlines with \

I forget what the maximum command-line length is; it may be an issue
depending on how many packages you manually installed.

You could make the package list with one package per line and use xargs
to pipe it through aptitude (may take longer).

Or you can just use the aptitude user interface on the new box and
manually mark the packages off the list.  For a one-off, this may be the
fastest way.

It all depends on how automated you want the process to be.


Reply to: