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

Re: Moving "setup" from one computer to another?



On Fri, Oct 06, 2006 at 03:35:42 +0200, Micha Feigin wrote:
>[..]
>> I found this at
>> http://www.debian.org/doc/manuals/reference/ch-package.en.html
>> ----------------------------------------------------------------
>> To make a local copy of the package selection states:
>> 
>>       $ dpkg --get-selections "*" >myselections   # or use \*
>> 
>> "*" makes myselections include package entries for "purge" too.
>> 
>> You can transfer this file to another computer, and install 
>> it there with:
>> 
>>       # dselect update
>>       # dpkg --set-selections <myselections
>>       # apt-get -u dselect-upgrade    # or dselect install
>
>This is the easiest way AFAIK. The problem is that it doesn't copy the
>"auto" state of packages (packages installed automatically as opposed
>to explicitly)
>
>> ---------------------------------------------------------------
>> 
>> Is this the way to go, especially since:
>> "In stable releases up to and including Potato, dselect was 
>> the principal package maintenance tool. For Sarge, you should 
>> consider using aptitude instead." etc
>> 
>
>I don't know of  a way to do this that easily with aptitude. What you
>can do is aptitude search ~i  to get a list of installed packages, it
>will also give the state (auto or not), but I don't know of a way to
>feed it back into aptitude directly (you can write a sed+shell script
>to do it).

Well, doing it via aptitude and just considering the ~i packages is
likely to not produce a copy of the system.  Just installing those
packages will pull in not only the 'depends' but also the 'recommends'.

Personally I would do both :-) (all of this is untested so please take
care)

On the source system:

 # dpkg --get-selections > dpkg_selections
 # aptitude search '~i!~M'|sed -e 's/ \+/ /g'|cut -f2 -d ' ' > aptitude_selections

On the target system:

 # dpkg --set-selections < dpkg_selections
 # apt-get -u dselect-upgrade
 # aptitude --schedule-only markauto '~i'
 # aptitude --shedule-only markunauto < aptitude_selections

You probably should start the visual interface of aptitude afterwards to
make sure it worked out alright.

/M

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus@therning.org             Jabber: magnus.therning@gmail.com
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Programs should be written for people to read, and only incidentally
for machines to execute.
     -- Quote from Structure and Interpretation of Computer Programs

Attachment: pgpXWw_MJukWI.pgp
Description: PGP signature


Reply to: