Correct names for installing packages with zypper

I’m trying to create a sript to install everything on a new openSUSE LEAP that I had on a previous release. The Yast menu for installing patterns doesn’t list the actual pattern names, so I used zipper and have some questions about the output.

Pattern names for gnome don’t align well with the dscriptins in the Yast menu; which of these do I need? gnome_basic, gnome_x11, patterns-gnome-gnome_basic, patterns-gnome-gnome_x11

In general, between foo and patterns-foo?

From YaST’s Software manager you can export the installed packages to an xml file, and ( not sure if during install ) import that on another machine. I’ve done this once or twice, but too long ago to remember all the details.

Yes, but I’m trying to do everything from a script.

That would be a script recreating autoyast. Admitted I don’t have much experience there, autoyast should be the tool. If you insist on writing your own script ( have a good time :smiley: ) that should bring you what you want. Both for ‘transferring’ an install, and for ‘cloning’ an install. There’s a YaST module ( installable ) for it, so you can even create a modified install.

Whoohah, it’s even progressed further than I thought. The autoyast2 features can create a complete autoinst.xml which can be read by the installer. So if you want a homebrew script install the autoyast* packages, create an autoinst.xml and find out how to use it in your own script. Next, find out how the installer deals with the xml, make it execute your script and be satisfied only when you replicated the result of the tested installer options with the autoinst.xml .

FWIW, I assume you see this as a personal project. Otherwise use what’s already there :smiley:

zypper in -t pattern gnome

Yes, to install any pattern with the text string “gnome” in the name.
And, if you want to list every available pattern, the following will do that… and you can modify the search the usual ways like restricting to installed

zypper se -t pattern

I do not generally recommend autoyast unless you want to build a complete unattended install including the distro.
If instead you simply want to script everything to install after a distro install (This gives you plenty of flexibility) then a BASH script is sufficient.

I posted a collection of what I consider many of the most useful commands you can use to build your script…

The main script page
https://en.opensuse.org/User:Tsu2/Scripts_and_Scriplets

Zypper commands
https://en.opensuse.org/User:Tsu2/BASH_zypper

I’ve also sprinkled through my Wiki a number of install scripts, I don’t keep them current but can serve as examples how to do various things like add repos, install patterns, packages, configure apps, more.

If you have any questions about specific things you run into, just post.

TSU

The summary descriptions for the patterns you’re asking about…

Pattern Description
gnome GNOME Desktop Environment (Wayland)
gnome_basic GNOME Desktop Environment (Basic)
gnome_x11 GNOME Desktop Envoronment (X11)

Note that when you do a repository search for a name, you can return both a pattern and the package that installs the pattern, so for instance that’s why you can see both a “gnome_x11” which would be the pattern name and a package called “patterns-gnome-gnome_x11” – This is very clear when you do your zypper search, the results each clearly say whether it’s a pattern or package.
You can install this either way as follows, both should install the same collection of packages.

zypper in -t pattern gnome_x11   # Installing using pattern name
zypper in patterns-gnome-gnome_x11   # Installing using package name

HTH,
TSU

That will include things that are automatically installed; in general, I don’t want to carry those forward if a new release of LEAP drops them from the default configuration. What I want is a list of those packages and patterns that I explicitly requested. Most of those are no-brainers, but there are a few edge cases.

I could write a dozen scripts in the time that it would take to learn and use autoyast. It’s possible that I’ll eventually play with it just out of curiousity, but my current plans are much more modest. For the time being I don’t want to do much more than call zipper to add repositories and install packages; nothing hardware specific.

Those three names don’t align with what’s on the Yast menu. Would it be correct to assume that I need gnome and gnome_x11? Do I need to explicitly install both, or will gnome_x11 drag in gnome_basic?

zypper info -t pattern gnome

Also, the install command lists all patterns and packages that will be installed before you confirm the installation.

Maybe you can use this, it produces a list of all installed packages, with only their names.

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


You could redirect that to a file, and use that on another machine.

IIRC gnome_basic will be pulled in automatically when you install either of the other two patterns which essentially will install your Gonme Desktop with either Wayland or an xorg Xserver…

You can test this and answer any questions for yourself easily as follows…
run any “Install” command like the following which will list what it will propose to do, but don’t actually go through with the install if you don’t want to do so… Note the “-f” which will propose a “force re-install” for anything that is already installed, else you will see a “nothing to do” if already installed

zypper in -f -t pattern *pattern_name *

TSU