Online searches show this has been discussed for at least a decade, but I’ve tried the suggested method without success.
I have a Leap 42.1 system that I’ve been using for years. It has literally thousands of packages which were incrementally installed. I’ve just installed Leap 15.1 on a new machine and to the greatest extent possible want it to have everything the old one does.
As per suggestions, on 42.1 I did:
$ rpm -qa --qf "%{NAME}
" > rpm-qa--qfNAME.txt
$ wc -l rpm-qa--qfNAME.txt
5567 rpm-qa--qfNAME.txt
(The wc
is my own addition – like I said, thousands of packages.)
On 15.1 I tried:
fgrep -v gpg-pubkey /tmp/rpm-qa--qfNAME.txt | xargs -- zypper install
Not sure why the “gpg-pubkey” lines need to be removed, but that was suggested so I did it.
Many 42.1 packages are missing from the 15.1 repositories. I expected this. What I want is all the 42.1 packages that exist in 15.1 – I’ll go back into YaST Software Management and add replaced/changed ones as necessary.
Problem is that zypper prints lots of errors and other messages, and then does nothing – it doesn’t install the “good” packages. Examples from the output:
Package 'gimp-help-browser' not found.
'samba-libs' is already installed.
No update candidate for 'make-4.2.1-lp151.7.39.x86_64'. The highest available version is already installed.
`dbus-1-python3' not found in package names. Trying capabilities.
Note that ‘make-4.2.1-lp151.7.39.x86_64’ is not in the .txt file:
$ fgrep make rpm-qa--qfNAME.txt
texlive-makeindex
imake
cmake
makeinfo
make
texlive-makeindex-bin
texlive-makecmds
makedepend
extra-cmake-modules
texlive-makeindex-doc
automake
gccmakedep
texlive-makecmds-doc
libpagemaker-0_0-0
I’ve confirmed that if there are any missing, etc. package in the .txt file zypper won’t install anything. This text file doesn’t install anything:
emacs
python2-numpy
non-existent-package-foobar
python3-numpy
python2-scipy
python3-scipy
But removing the “non-existent-package-foobar” and doing cat file.txt | xargs zypper install
works and installs emacs, numpy, scipy, and all their dependencies.
Adding the global “–non-interactive” flag to zypper doesn’t help. And I don’t want to use “–force”. I specifically don’t want to overwrite existing/installed packages from the 15.1 base install with other ones.
Am I doing anything wrong in my zypper command? Is this at all possible? I really don’t want to have to install thousands of packages interactively with YaST Software Management. Or edit the 5000 line “rpm-qa–qfNAME.txt” file removing hundreds of problematic lines. Thanks for any suggestions.