Re: saving package selections (Stability issues)
On Thu, Jul 26, 2007 at 08:14:23PM -0400, Douglas Allan Tutty wrote:
> On Thu, Jul 26, 2007 at 04:07:59PM -0700, Andrew Sackville-West wrote:
> > if you are only installing the tasksel selections and not adding
> > additional software, then there is no reason to do this. I just know
> > that if I had to reinstall my current machine, I'd want to pull a list
> > of what was installed as I've got a couple years of built-up stuff on
> > here and wouldn't want to hassle with trying to remember it all.
>
> I use aptitude which keeps track of packages that I requested for
> install vs those installed to meet dependancies. In my backups, I keep
> both the dpkg --get-selections but also aptitude search '~i!~M' which
> gives me the names of packages that are installed (~i) that are not (!)
> automatically installed (~M).
I prefer to add a few more steps in order to:
a. save versions, like for mixed stable/testing/unstable systems, yet be
friendly to version changes
b. install exactly the packages I have selected as auto-installed
(recommends makes this a bit more tricky, when used)
c. keep all essential-marked packages
== Saving the package selections ==
1. Save list of all installed packages:
# aptitude -F "%?p" search \~i >| aptitude-installed
2. Same as previous but with versions:
# aptitude -F "%?p=%?V" search \~i | sed 's/ //g' >| aptitude-installed-ver
3. Save list of the packages that have been automatically installed:
# aptitude -F "%?p" search \~i\~M >| aptitude-autoinstalled
== Applying package selections ==
1. Make sure /etc/apt/sources.list and /etc/apt/preferences are correct
and update the lists:
# aptitude update
2. Select essential packages for installation, unmarkauto them, and
markauto non-essential packages:
# aptitude -R --schedule-only install `aptitude -F "%?p" search \~E`
# aptitude -R --schedule-only unmarkauto `aptitude -F "%?p" search \~E`
# aptitude -R --schedule-only markauto `aptitude -F "%?p" search \~i\!\~E`
3. Select packages for installation, then apply versions:
# aptitude -R --schedule-only install `cat aptitude-installed`
# aptitude -R --schedule-only install `cat aptitude-installed-ver`
4. Mark auto-installed packages as such:
# aptitude -R --schedule-only markauto `cat aptitude-autoinstalled`
5. Run aptitude interactively, make sure it is doing what it ought, then
apply either with 'g' or:
# aptitude -y install
There are probably better ways to do some of this. ...Let me know how I
can improve it.
This is obviously overkill for a lot of people.
Reply to: