User Tools

Site Tools


linux:suse_zypper

Zypper package installer for Suse/Opensuse

To verify whether all dependencies are still fulfilled and to repair missing dependencies, use:

# zypper verify

Updating the entire distribution

# zypper dist-upgrade

zypper list-patches

To list all patches regardless of whether they are needed, use the option –all additionally. For example, to list all patches with a CVE number assigned, use:

# zypper list-patches --all --cve

If a repository contains only new packages, but does not provide patches, zypper patch does not show any effect. To update all installed packages with newer available versions (while main- taining system integrity), use:

# sudo zypper update

To update individual packages, specify the package with either the update or install command:

# zypper update PACKAGE_NAME
# zypper install PACKAGE_NAME

A list of all new installable packages can be obtained with the command:

# zypper list-updates

Note that this command only lists packages that match the following criteria: has the same vendor like the already installed package, is provided by repositories with at least the same priority than the already installed pack- age,is installable (all dependencies are satisfied). A list of all new available packages (regardless whether installable or not) can be obtained with:

# zypper list-updates --all

When patching, updating or removing packages, there may be running processes on the system which continue to use files having been deleted by the update or removal. Use zypper ps to list processes using deleted files. In case the process belongs to a known service, the service name is listed, making it easy to restart the service. By default zypper ps shows a table:

# zypper ps
PID | PPID | UID | User | Command | Service | Files
------+------+-----+-------+--------------+--------------+-------------------
814 | 1 | 481 | avahi | avahi-daemon | avahi-daemon | /lib64/ld-2.19.s
# zypper ps --print "systemctl status %s"
Show the commands to retrieve status information for services which might need a restart.
systemctl status avahi-daemon
systemctl status irqbalance
systemctl status postfix
systemctl status sshd

List repository

# zypper repos

List repository with more details

# zypper repos -d

zypper enables you to fetch changes in packages from configured repositories. To fetch the changes, run:

# zypper refresh

zypper removerepo 1

The following command will enable the repository named updates , turn on auto-refresh and set its priority to 20:

# sudo zypper modifyrepo -er -p 20 'updates'

To search for packages which provide a special capability, use the command what-provides . For example, if you want to know which package provides the Perl module SVN::Core , use the following command:

# zypper what-provides 'perl(SVN::Core)'

Simple search for a package name containing fire

# zypper search "fire"

Simple search for the exact package MozillaFirefox

# zypper search --match-exact "MozillaFirefox"

Also search in package descriptions and summaries

# zypper search -d fire

Only display packages not already installed

# zypper search -u fire

Display packages containing the string fir not followed be e

# zypper se "/fir[^e]/"

Zypper Rollback Feature on Btrfs File System

If the Btrfs filesystem is used on the root partition and snapper is installed, Zypper automati- cally calls snapper when committing changes to the filesystem to create appropriate filesystem snapshots. These snapshots can be used to revert any changes made by Zypper.

If not enable, you can activate snapshots using

# snapper -c root create-config /

Config files of snapper are located in /etc/snapper, snapshots will not take more than 50% of filesystem space

Keep in mind that snapshots require a Btrfs root filesystem with subvolumes set up as proposed by the installer and a partition size of at least 16 GB. Iinitially a snapshot does not occupy additional disk space. If data in the original filesystem is modified, changed data blocks are copied while the old data blocks are kept for the snapshot.

Suse 15

Add an additionnal repository, on register Suse 15, first list available repositories

prlnx01:~ # SUSEConnect --list-extensions
AVAILABLE EXTENSIONS AND MODULES

    Basesystem Module 15 x86_64 (Installed)
    Deactivate with: SUSEConnect -d -p sle-module-basesystem/15/x86_64

        Containers Module 15 x86_64
        Activate with: SUSEConnect    -p sle-module-containers/15/x86_64

        Desktop Applications Module 15 x86_64
        Activate with: SUSEConnect    -p sle-module-desktop-applications/15/x86_64

            Development Tools Module 15 x86_64
            Activate with: SUSEConnect    -p sle-module-development-tools/15/x86_64

            SUSE Linux Enterprise Workstation Extension 15 x86_64
            Activate with: SUSEConnect    -p sle-we/15/x86_64 -r ADDITIONAL REGCODE

        SUSE Cloud Application Platform Tools Module 15 x86_64
        Activate with: SUSEConnect    -p sle-module-cap-tools/15/x86_64

        SUSE Linux Enterprise Live Patching 15 x86_64
        Activate with: SUSEConnect    -p sle-module-live-patching/15/x86_64 -r ADDITIONAL REGCODE

        SUSE Package Hub 15 x86_64
        Activate with: SUSEConnect    -p PackageHub/15/x86_64

        Server Applications Module 15 x86_64 (Installed)
        Deactivate with: SUSEConnect -d -p sle-module-server-applications/15/x86_64

            Legacy Module 15 x86_64
            Activate with: SUSEConnect    -p sle-module-legacy/15/x86_64

            Public Cloud Module 15 x86_64
            Activate with: SUSEConnect    -p sle-module-public-cloud/15/x86_64

            SUSE Enterprise Storage 6 x86_64 (BETA)
            Activate with: SUSEConnect    -p ses/6/x86_64 -r ADDITIONAL REGCODE

            SUSE Linux Enterprise High Availability Extension 15 x86_64
            Activate with: SUSEConnect    -p sle-ha/15/x86_64 -r ADDITIONAL REGCODE

            Web and Scripting Module 15 x86_64
            Activate with: SUSEConnect    -p sle-module-web-scripting/15/x86_64

MORE INFORMATION

You can find more information about available modules here:
https://www.suse.com/products/server/features/modules.html

Add a new repository

prlnx01:~ # SUSEConnect    -p sle-module-desktop-applications/15/x86_64
Registered sle-module-desktop-applications 15 x86_64
To server: https://scc.suse.com
Successfully registered system.

List available repositories

prlnx01:~ # zypper lr
Repository priorities are without effect. All enabled repositories share the same priority.

#  | Alias                                                                                     | Name                                                | Enabled | GPG Check | Refresh
---+-------------------------------------------------------------------------------------------+-----------------------------------------------------+---------+-----------+--------

 6 | Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Debuginfo-Pool    | SLE-Module-Desktop-Applications15-Debuginfo-Pool    | No      | ----      | ----   
 7 | Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Debuginfo-Updates | SLE-Module-Desktop-Applications15-Debuginfo-Updates | No      | ----      | ----   
 8 | Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Pool              | SLE-Module-Desktop-Applications15-Pool              | Yes     | (r ) Yes  | No     
 9 | Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Source-Pool       | SLE-Module-Desktop-Applications15-Source-Pool       | No      | ----      | ----   
10 | Desktop_Applications_Module_15_x86_64:SLE-Module-Desktop-Applications15-Updates           | SLE-Module-Desktop-Applications15-Updates           | Yes     | (r ) Yes  | Yes    

Install X11

prlnx01:~ # zypper install xorg-x11-server

https://kamarada.github.io/en/2019/05/27/how-to-upgrade-from-opensuse-leap-150-to-151/#.XO5smnUzZzV

linux/suse_zypper.txt · Last modified: 2021/01/01 21:25 (external edit)