Automated install of existing apps

I have sold my AMD powered computer. I am replacing it with an Intel / Nvidea equipped system. The old system was running 13.1 I want to stay with that version.

Over the period of time since 13.1 was new, I have added quite a few non-default programs. As I am going to go to all SSDs, I’m sure it’ll be easier to do a fresh install on the new system. However, while concentrating on the install, I just know I’ll forget a bunch of programs that were on the old system.

Is there a way to get rpm to tell me the names of all the programs on my system? I tried and tried to get a reasonable response but am baffled. I always end up with either almost 300,000 lines of output, or nothing. How can I get a list of the names of the programs that are installed?

Is there an easy way to automate the install process? Could I have the output from rpm, or another process, create a script I could run that would install all the programs that are in the list but not on my system?

YAST -> Software -> Software Management -> Extras -> Export Package List to File.

On the new machine Import Package List from File :slight_smile:

Make sure you have the same repositories enabled on both machines, naturally.

Oh, MAN! It’s that easy? :open_mouth:

I feel dumb for missing that. I actually did spend a whole bunch of time trying to find out how that’s done.
Thank you!

Bart

On 2015-06-18 21:46, Miuku wrote:
>
> YAST -> Software -> Software Management -> Extras -> Export Package List
> to File.
>
> On the new machine Import Package List from File :slight_smile:

Does not work right. :-((

The feature was designed before repositories were invented, thus the
data has no information about what repository each package came from. It
will install things available on several repos probably according to
their priority.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

On 2015-06-18 21:36, montana suse user wrote:

> Over the period of time since 13.1 was new, I have added quite a few
> non-default programs. As I am going to go to all SSDs, I’m sure it’ll
> be easier to do a fresh install on the new system. However, while
> concentrating on the install, I just know I’ll forget a bunch of
> programs that were on the old system.

BTDT

I would copy every file using rsync, then edit fstab and grub
configuration, chroot, mkinird, install grub. Not necesarily in that order.

> Is there a way to get rpm to tell me the names of all the programs on my
> system? I tried and tried to get a reasonable response but am baffled.

“rpm -qa”, for instance.

> Is there an easy way to automate the install process?

Easy, no.

> Could I have the
> output from rpm, or another process, create a script I could run that
> would install all the programs that are in the list but not on my
> system?

I know of approximations to that, but no method that does it real right.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Hi,

Is there a way to get rpm to tell me the names of all the programs on my system? I tried and tried to get a reasonable response but am baffled. I always end up with either almost 300,000 lines of output, or nothing. How can I get a list of the names of the programs that are installed?

using rpm, something like

rpm -qa --qf '%{NAME}
'

using zypper

zypper --no-refresh se -i -t package

Is there an easy way to automate the install process? Could I have the output from rpm, or another process, create a script I could run that would install all the programs that are in the list but not on my system?

You could save that output in a file or a stream using the shell and reinstall it using zypper. Using 13.2 here and i don’t have that export/import option from yast sw_single. Still you can save the output from a file.

rpm -qa --qf '%{NAME}
' > packages.txt

or

zypper --no-refresh se -i -t package | awk '$1 ~ /^i/{print $3}' > packages.txt

On the new/other install machine

mapfile -t oldpackages < packages.txt
zypper in "${oldpackages@]}"

oldpackages and packages.txt are both arbitrary you can name it to your own hearts content :wink: and mapfile is a bash4 feature JFYI.
Normally zypper will complain if the packages are already installed in your system but if you add the -f flag to zypper then it will do a force reinstall.
One more thing, I’m not sure if that suffers the same thing that was robin is talking about, any ways good luck…

I tried using miku’s suggestion and it worked, for the most part. I did run into a problem with a few packages. So, I used your first suggestion and had rpm create a file with all the names. I’ll go through this list and remove any packages I know are already installed, and then feed it to zypper and we’ll see what happens.

I am actually surprised that this has not been requested before. I would think that everyone who faces the chore of changing versions would be looking to do this. Ergo, the attraction of Tumbleweed. Wish I knew enough to create an answer.

Bart

While I understand what you want, it may be that not many people need this because they already know how to get a list of installed RPMs (using a version of the rpm -q command) or are organised in another way.

I e.g. have a form of rpm -q that I run on every system every week and format the output (together with may other such data about hard and software) in web pages on an internal web site. Always avaialble even if the system in question is down.

Also, I have a list (some document, but also a printed version of it) on what packages not to install on system installation and what packages to add on system installation. If I later in the lifetime of the system add a package (not for testing, but for serious work), I add that to the list.

A lot of System Management means working with strict protocols.

On 2015-06-22 10:26, montana suse user wrote:

> I am actually surprised that this has not been requested before.

No, no. It has, many times.

I
> would think that everyone who faces the chore of changing versions would
> be looking to do this. Ergo, the attraction of Tumbleweed. Wish I knew
> enough to create an answer.

No, you can upgrade the system, using the offline system upgrade method,
or the online system upgrade method.

Both keep the packages.

However, none keep the vendors.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)