FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 11-05-2008, 04:38 PM
Florian Kulzer
 
Default Install matching set of software while preserving aptitude auto/manual install info

On Wed, Nov 05, 2008 at 09:13:41 -0800, Robert Caruso wrote:
> Get me off this [expletive deleted] list asap.
>
>
> Robert Caruso
> President/Owner
> Mitigation Online Consultants
> 818-501-1520 Main Office
> 818-501-1524 Direct Office
> 310-709-7157 Cell
> 310-997-3677 Fax
> rob@mitigationonlineconsultants.com
> www.mitigationonlineconsultants.com
> AIM: robmodelinla

Please stop top posting and mark your messages "OT" if you do not want
to participate in the discussion of the thread.

--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-05-2008, 04:45 PM
Florian Kulzer
 
Default Install matching set of software while preserving aptitude auto/manual install info

On Wed, Nov 05, 2008 at 12:11:55 -0500, Brian McKee wrote:
> Hi All,
>
> 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)

You can save a list of the automatically installed packages on the
original system like this:

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

Once you have installed the same packages on the cloned system, you can
do this:

aptitude unmarkauto '~i'

aptitude markauto $(cat auto-list.txt)

(I never tried this myself, but I think it should work.)

--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-05-2008, 07:30 PM
green
 
Default Install matching set of software while preserving aptitude auto/manual install info

On Wed, 2008.11.05, 310, 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)

If you want to preserve auto-install information, use aptitude only, not dpkg
or apt-get.

Note that I have almost never actually restored the package selections using
the commands under [restore] but the [save] ones are run with each backup.
Understand what the [restore] commands do before you use them. And if this
works, maybe someone could put it on the wiki.

[save]
# Save a list of all installed packages
aptitude -F "%?p" --disable-columns search ~i >| installed-all
# Save a list of all installed packages with their versions
aptitude -F "%?p=%?V" --disable-columns search ~i >| installed-all-ver
# Save a list of all automatically installed packages
aptitude -F "%?p" --disable-columns search ~i~M >| installed-auto

[restore]
# Install all essential, important, required, or standard packages
aptitude -R --schedule-only install $( aptitude -F "%?p" search !~i?or(~E,~pimportant,~prequired,~pstandard) )
# Mark as manually installed all essential, important, required, or standard priority packages
aptitude -R --schedule-only unmarkauto $( aptitude -F "%?p" search ~i?or(~E,~pimportant,~prequired,~pstandard) )
# Mark as automatically installed all packages that are not essential, important, required, or standard priority
aptitude --schedule-only markauto $( aptitude -F "%?p" search ~i!~E!~pimportant!~prequired!~pstandard )
# Install all the packages in the installed package list (manual + automatic)
aptitude -R --schedule-only install $( cat installed-all )
# Mark as automatically installed all packages in that list
aptitude --schedule-only markauto $( cat installed-auto )

The version of aptitude I am using (0.4.11.10-1lenny1.1) does not seem to
correctly handle repeated scheduling, so you may need to not use the
'--schedule-only' option (inconvenient but will accomplish the same thing).

Note that any changes in the available packages since the time you saved the
package selections will affect how well this procedure works and again: this is
only minimally tested.

Please let us know whether it works.
 
Old 11-05-2008, 09:34 PM
green
 
Default Install matching set of software while preserving aptitude auto/manual install info

On Wed, 2008.11.05, 310, Brian McKee wrote:
> On Wed, Nov 5, 2008 at 3:30 PM, green <greenfreedom10@gmail.com> wrote:
> > [save]
> > # Save a list of all installed packages
> > aptitude -F "%?p" --disable-columns search ~i >| installed-all
> > # Save a list of all installed packages with their versions
> > aptitude -F "%?p=%?V" --disable-columns search ~i >| installed-all-ver
> > # Save a list of all automatically installed packages
> > aptitude -F "%?p" --disable-columns search ~i~M >| installed-auto
> >
> > [restore]
> > # Install all essential, important, required, or standard packages
> > aptitude -R --schedule-only install $( aptitude -F "%?p" search !~i?or(~E,~pimportant,~prequired,~pstandard) )
> > # Mark as manually installed all essential, important, required, or standard priority packages
> > aptitude -R --schedule-only unmarkauto $( aptitude -F "%?p" search ~i?or(~E,~pimportant,~prequired,~pstandard) )
> > # Mark as automatically installed all packages that are not essential, important, required, or standard priority
> > aptitude --schedule-only markauto $( aptitude -F "%?p" search ~i!~E!~pimportant!~prequired!~pstandard )
> > # Install all the packages in the installed package list (manual + automatic)
> > aptitude -R --schedule-only install $( cat installed-all )
> > # Mark as automatically installed all packages in that list
> > aptitude --schedule-only markauto $( cat installed-auto )
>
> Thanks for that. I'm not sure of the implications of marking
> 'essential, important, required, or standard priority packages' as
> manually installed and the rest as automatically installed. I mean,
> how did I get to that spot - from the install disc I'm assuming. Is
> that a manual or automatic install?. If I look at initscripts say,
> it's required, but automatic right now. If I follow your logic
> correctly, you'd be marking it manual.

Those first two [restore] commands are just to return the package selections to
what they would be after an install. I think it might not be safe to mark the
initscripts package as automatically installed; aptitude may try to remove it
(or rather throw up warnings about removing it). The last command would mark
the initscripts package as automatically installed if it is listed in the
installed-auto file.

> I also wonder about too many arguments if I do
> > aptitude -R --schedule-only install $( cat installed-all )
> with a lot of packages on that list.

I'm not sure about this. I think I did it once without problems but I am not
sure.
 
Old 11-06-2008, 07:57 PM
Andrei Popescu
 
Default Install matching set of software while preserving aptitude auto/manual install info

On Wed,05.Nov.08, 12:58:42, Douglas A. Tutty wrote:

> 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.

Or you could just feed the list to 'dpkg --get-selections'

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
 
Old 11-07-2008, 06:26 AM
Andrei Popescu
 
Default Install matching set of software while preserving aptitude auto/manual install info

On Thu,06.Nov.08, 18:35:52, Douglas A. Tutty wrote:

> > Or you could just feed the list to 'dpkg --get-selections'
>
>
> Do you mean dpkg --set-selections?

Yes, of course [blush]!

> I suppose that would work because aptitude should then install those,
> with the dependancies and mark things appropriately.

Yep, just running 'aptitude install' would be enough.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
 

Thread Tools




All times are GMT. The time now is 10:08 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org