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

Re: Replicating a Squeeze system on Wheezy



David wrote at 2013-07-03 06:10 -0500:
> On 3 July 2013 21:06, David <bouncingcats@gmail.com> wrote:
> > I did something similar using aptitude:
> >
> > aptitude -F "%p" search '~i!M' >package_list
> > aptitude -R install $(cat package_list)
> 
> Sorry, there is a typo error above. It should be:
> 
> aptitude -F "%p" search '~i!~M' >package_list
> aptitude -R install $(cat package_list)

I use and recommend aptitude because of the interactive dependency
resolver which I believe to be important for handling the intricate
dependencies among Debian's thousands of packages.

The above example is one I used to backup the package set on my
systems, until I tested it with a restore and learned that it does not
properly duplicate the selected packages.  This is because of
dependencies which are satisfied with one of multiple packages.
Aptitude, or apt, might not select the same "auto-installed" package
as was selected before.  While this does not matter so much for
libraries, it does for dependencies like mail-transport-agent.

The solution is to select *all* installed packages, and then mark the
auto-installed packages.  Alternative, try
aptitude-create-state-bundle, which I have not tested.

Saving the package state:
aptitude -F "%?p" --disable-columns search \~i >| installed-all
aptitude -F "%?p" --disable-columns search \~i\~M >| installed-auto

Marking as auto-installed some extra default packages, if you wish:
aptitude -R --schedule-only install $( aptitude -F "%?p" search \
    \!\~i?or(\~E,\~pimportant,\~prequired,\~pstandard) )
aptitude -R --schedule-only unmarkauto $( aptitude -F "%?p" search \
    \~i?or(\~E,\~pimportant,\~prequired,\~pstandard) )
aptitude --schedule-only markauto $( aptitude -F "%?p" search \
    \~i\!\~E\!\~pimportant\!\~prequired\!\~pstandard )

Restoring the package state:
aptitude -R --schedule-only install $( cat installed-all )   
aptitude --schedule-only markauto $( cat installed-auto )
aptitude # Verify selections; no installs have happened yet

Attachment: signature.asc
Description: Digital signature


Reply to: