| Art Alexion on 19 Dec 2009 09:30:09 -0800 |
|
On Friday 18 December 2009 14:42:59 JP Vossen wrote:
> > * Figure out some way to capture current non-default packages[*] so
> > that I can script their reinstall, if possible.
> [...]
> > [*] By "non-default packages", I mean the ones that didn't come with
> > the distro, but I installed optionally.
>
> I can think of at least two ways to do this.
>
> First, I've never tried it, and I'm not sure how well that would work
> for 32-->64 upgrade, but:
> $ man aptitude-create-state-bundle
>
>
> Second, these will give you a list of (more-or-less) installed .debs.
>
> dpkg -l | grep ^i | awk '{print $2}' | sort > deb.list.old
> -- OR --
> dpkg-query --show | cut -f1 | sort > deb.list.old
>
> The first one is more reliable, as the dpkg-query might include things
> that were installed but have since been removed. Man pages for both
> are mildly useful.
>
> So you pick one, run it, install the new system, run the same command
> again, and diff the files (to get rid of the "default" debs). You'll
> almost certainly have to sort out some package names containing '32' vs
> '64', but that should be obvious. I also always ignore '^lib' packages
> since anything that needs a lib will usually install it automatically.
>
> Then you tweak your /etc/apt/sources* file(s) accordingly, build the
> 'aptitude install' command, and run it.
>
>
> > I'd also like a way to find out which non-repo packages I may have
> > installed with dpkg (and save the debs in case they are no longer
> > available).
>
> The above dpkg* commands will include any/all .deb packages installed on
> the system. Obviously non-repo .debs will have to be pulled out and
> handled separately. I just build the 'aptitude install' command and try
> it, the cull out packages it complains about it, and re-run until it
> works, then circle back to the culls to sort them out.
>
> Doing all of this over SSH from a stable machine with a text editor for
> a scratch-pad and copy&paste works quite well. Kind of self-documenting
> too, if you save your steps. You've seen examples I've posted to this
> list from my docs like that. Easy to do when you copy&paste to/from SSH.
>
Thanks, this is just what I was looking for.
--
Art Alexion
Attachment:
signature.asc ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|