Re-installing on a new machine
Is there some way to extract the (minimum) list of patterns and packages to re-create an existing installation on a new machine? The last time I moved to a new machine it took me a few weeks until I've had everything back together and I would like to avoid that this time around if possible. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
On Wednesday 2023-04-19 21:12, Achim Gratz wrote:
Is there some way to extract the (minimum) list of patterns and packages to re-create an existing installation on a new machine? The last time I moved to a new machine it took me a few weeks until I've had everything back together and I would like to avoid that this time around if possible.
Have you tried `rpm -qa --qf="%{NAME}\n"` and then feeding that list back into zypper?
On 2023-04-19 21:55, Jan Engelhardt wrote:
On Wednesday 2023-04-19 21:12, Achim Gratz wrote:
Is there some way to extract the (minimum) list of patterns and packages to re-create an existing installation on a new machine? The last time I moved to a new machine it took me a few weeks until I've had everything back together and I would like to avoid that this time around if possible.
Have you tried `rpm -qa --qf="%{NAME}\n"` and then feeding that list back into zypper?
That works unless you use extra repos. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
Jan Engelhardt writes:
Have you tried `rpm -qa --qf="%{NAME}\n"` and then feeding that list back into zypper?
That just gives me all installed packages, which is 8370 of them. I was hoping for some incantation that at least weeds out packages that were installed as dependencies of others or as part of a pattern from this list. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
On Wednesday 2023-04-19 22:36, Achim Gratz wrote:
Jan Engelhardt writes:
Have you tried `rpm -qa --qf="%{NAME}\n"` and then feeding that list back into zypper?
That just gives me all installed packages, which is 8370 of them. I was hoping for some incantation that at least weeds out packages that were installed as dependencies of others or as part of a pattern from this list.
comm -23 <(rpm -qa --qf="%{NAME}\n" | sort) <(sort /var/lib/zypp/AutoInstalled)
Jan Engelhardt writes:
On Wednesday 2023-04-19 22:36, Achim Gratz wrote: comm -23 <(rpm -qa --qf="%{NAME}\n" | sort) <(sort /var/lib/zypp/AutoInstalled)
OK, so that information can actually be requested from zypper, just not quite as elegantly as one would hope since there is no machine readable output available: zypper -ts 10 se -i | grep i+ | tr -d ' ' | cut -d: -f2 | sort -u Similarly the list of explicitly installed patterns: zypper -ts 10 pt | grep i+ | tr -d ' ' | cut -d: -f2 | sort -u This will let you know which packages got installed as part of base: zypper -ts 10 info --type pattern base | grep '^ i' | tr -d ' ' | cut -d: -f2 | sort -u Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
On 4/19/23 22:36, Achim Gratz wrote:
I was hoping for some incantation that at least weeds out packages that were installed as dependencies of others or as part of a pattern from this list.
I was wondering about an easy way to get such a list multiple times in the past as it would be a handy thing to have as a part of backups. I don't want to back up the actual files of the installed packages, just that list, any configs, and any data. That should be a good set to start with if I have to reconstruct a "dead" machine from a backup. I saw the commands in this thread, but they look rather convoluted and therefore easy to get broken by some changes in the future. KaiRo
On 2023-04-21 23:18, Robert Kaiser wrote:
On 4/19/23 22:36, Achim Gratz wrote:
I was hoping for some incantation that at least weeds out packages that were installed as dependencies of others or as part of a pattern from this list.
I was wondering about an easy way to get such a list multiple times in the past as it would be a handy thing to have as a part of backups. I don't want to back up the actual files of the installed packages, just that list, any configs, and any data. That should be a good set to start with if I have to reconstruct a "dead" machine from a backup.
There is a way to have the rpm command generate a list of modified configuration files. There was in YaST, long ago, a module that did a backup of the system, and it used that trick to find out what to backup. I made a script that must be somewhere, I can dig it out. But then you also need a way to clone the btrfs setup, and that ain't trivial. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On 4/22/23 02:08, Carlos E. R. wrote:
There is a way to have the rpm command generate a list of modified configuration files. There was in YaST, long ago, a module that did a backup of the system, and it used that trick to find out what to backup. I made a script that must be somewhere, I can dig it out.
Having /etc (and a bit more) backed up is easy, and that's pretty much what's needed for configs. And data and /home directories, that's also easy. My largest issue has always been to know which packages to install when I needed to restore a machine. That's where I typically have lost most time and made most mistakes.
But then you also need a way to clone the btrfs setup, and that ain't trivial.
I use custom disk/filesystem setups anyhow and have good docs of how I did those, that's also not a big issue. Also, restoring a machine from backups doesn't necessarily need to be bit-by-bit perfect (if you want that, there's different tools for that), it just needs to ensure that everything works again as it should, in as little time as possible. KaiRo
Hello, On 2023-04-19 21:12, Achim Gratz wrote:
Is there some way to extract the (minimum) list of patterns and packages to re-create an existing installation on a new machine?
out of curiosity: Could you explain your particular reason behind why backup and restore of all the files is not feasible in your case? I ask because installing the same patterns and packages does not re-create an existing installation because plain installing RPM packages results a pristine "raw" system with the default configuration files from the RPM packages that must be configured as needed. Kind Regards Johannes Meixner -- SUSE Software Solutions Germany GmbH Frankenstr. 146 - 90461 Nuernberg - Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman (HRB 36809, AG Nuernberg)
Johannes Meixner writes:
Could you explain your particular reason behind why backup and restore of all the files is not feasible in your case?
I've accumulated quite a bit of cruft on that machine over the last 9 years that I want to shed during the transition.
I ask because installing the same patterns and packages does not re-create an existing installation because plain installing RPM packages results a pristine "raw" system with the default configuration files from the RPM packages that must be configured as needed.
That was indeed the intention. Anyway, it appears that over time quite a few packages have been marked as explicitly/user installed that probably were installed as dependencies originally, so I'll have to spend a bit of time comparing the list of packages on the old and new machine plus a third one that I use for experimentation to figure out what's a good set of packages to start with. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds
participants (6)
-
Achim Gratz
-
Carlos E. R.
-
Jan Engelhardt
-
Johannes Meixner
-
Larry Len Rainey
-
Robert Kaiser