Table of Content

This is a four-parts article. There are few sections here.

Part One
  • Preface: Test Bed
  • Getting Started With Docker
  • Issues on Minimal Install: No Reset, No Manual
  • Package Management: ZYpp Frontend, Get Help, Zypper Shell
  • Updating System: OS Release, List Updates, Update, Upgrades, Patch Check, Process Being Used
  • Package IRSIF: Install, Download Only, Removal, Dependency Removal, Query Search, Show Info, File List
  • What's Next
Part Two
  • Dependency: Help, Dependency, Reverse Dependency, Test, Verify
  • Group: Pattern
  • System Wide: List Packages
  • History: The Log File
  • Clean Up
  • What's Next
Part Three
  • Repositories: List, Add/Remove, Modify, Service List, Additional, Mirror
  • What's Next
Part Four
  • Build from Source: General Requirement, Download and Extract, Build Dependencies, Source Path, Build, Install RPM
  • Inspect Package: rpmlint, rpm -Qpl, rpmls, rpm2cpio
  • Hold Package: Case Example, Add Lock, Test Example, Remove Lock
  • Interesting Issue: systemd Dependencies
  • Conclusion

Dependency

There are two main topics in package dependency, the dependency itself, and reverse dependency. Beside these two, there are other topic as well, such as managing conflict that we do not cover here.

Help

Zypper has a very nice help that show all dependency related options.

$ zypper help search
search (se) [options] [querystring]
...
    --provides             Search for packages which provide the search strings.
    --recommends           Search for packages which recommend the search strings.
    --requires             Search for packages which require the search strings.
    --suggests             Search for packages which suggest the search strings.
    --conflicts            Search packages conflicting with search strings.
    --obsoletes            Search for packages which obsolete the search strings.
...
$ zypper help info
info (if) [options] <name> ...
...
    --provides            Show provides.
    --requires            Show requires and prerequires.
    --conflicts           Show conflicts.
    --obsoletes           Show obsoletes.
    --recommends          Show recommends.
    --suggests            Show suggests.

Docker Zypper: Help Info

Dependency

Package that required by: such as man need less and other.

This dependency information can be achieved by info command. This will show required parts of the package.

$ zypper info --requires man
...
Description    :                                   
    A program for displaying man pages on the screen or sending them to a
    printer (using groff).
Requires       : [32]                              
...
    cron
    glibc-locale
    libgdbm.so.4()(64bit)
    less

Docker Zypper: Info Require

Reverse Dependency

Package that require: such as less needed by man or other.

This reverse dependency require search command.

$ zypper search --requires --match-exact less
Loading repository data...
Reading installed packages...

S  | Name                 | Summary                                | Type   
---+----------------------+----------------------------------------+--------
   | calc                 | C-style arbitrary precision calculator | package
   | git-core             | Core git tools                         | package
   | lftp                 | Command Line File Transfer Program     | package
i+ | man                  | A Program for Displaying man Pages     | package
   | nmh                  | Unix Mail Handler                      | package
   | patterns-caasp-Stack | openSUSE Kubic Stack                   | package
   | quilt                | A Tool for Working with Many Patches   | package

Docker Zypper: Search Require

Test

Removing less would remove man. And also remove fish, because fish depend on man.

$ zypper rm less
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 3 packages are going to be REMOVED:
  fish less man

3 packages to remove.
After the operation, 9.4 MiB will be freed.
Continue? [y/n/...? shows all options] (y):

Docker Zypper: Test Dependency

Verify

Zypper has a tool, to install or repair, missing dependencies.

$ zypper verify

Equal to:

$ zypper ve
Loading repository data...
Reading installed packages...

The following 3 NEW packages are going to be installed:
  dracut pinentry systemd-sysvinit

3 new packages to install.
Overall download size: 792.0 KiB. Already cached: 0 B. After the operation, additional 1.3 MiB will be
used.
Some of the dependencies of installed packages are broken. In order to fix these dependencies, the following actions need to be taken:
Continue? [y/n/...? shows all options] (y): y

Docker Zypper: Verify Dependency


Group

I cannot find any reference about group in Zypper. Although there is group concept in YaST.

Metapackage

Neither metapackage exist in Zypper.

Pattern

The closest concept about group in zypper is, by using pattern package.

$ zypper pt
Loading repository data...
Reading installed packages...
S | Name                 | Version       | Repository | Dependency
--+----------------------+---------------+------------+-----------
  | apparmor             | 20170319-10.2 | OSS        |           
  | apparmor             | 20170319-10.2 | OSS        |           
  | base                 | 20170319-10.2 | OSS        |           
  | base                 | 20170319-10.2 | OSS        |           
  | basesystem           | 20170319-10.2 | OSS        |           
  | basesystem           | 20170319-10.2 | OSS        |           
  | books                | 20170319-4.1  | OSS        |           

Docker Zypper: Pattern


System Wide

System Wide Information

List Packages

There is this zypper packages command

$ zypper help packages
packages (pa) [options] [repository] ...

List all packages available in specified repositories.

  Command options:

-r, --repo <alias|#|URI>  Just another means to specify repository.
-i, --installed-only      Show only installed packages.
-u, --not-installed-only  Show only packages which are not installed.
    --orphaned            Show packages which are orphaned (without repository).
    --suggested           Show packages which are suggested.
    --recommended         Show packages which are recommended.
    --unneeded            Show packages which are unneeded.
-N, --sort-by-name        Sort the list by package name.
-R, --sort-by-repo        Sort the list by repository.
 
 $ zypper pa --unneeded
Loading repository data...
Reading installed packages...
S | Repository | Name               | Version    | Arch  
--+------------+--------------------+------------+-------
i | oss        | asciidoc           | 8.6.9-3.1  | noarch
i | oss        | glib2-devel        | 2.54.0-1.1 | x86_64
i | oss        | libsgutils2-1_43-2 | 1.43-3.1   | x86_64
i | oss        | libxslt-devel      | 1.1.29-6.1 | x86_64
i | oss        | openssl            | 1.0.2l-2.1 | noarch
i | oss        | p11-kit            | 0.23.2-2.5 | x86_64
i | oss        | p11-kit-tools      | 0.23.2-2.5 | x86_64
i | oss        | xorg-x11-devel     | 7.6-47.3   | noarch
 
$ zypper pa --orphaned
Loading repository data...
Reading installed packages...
S  | Repository | Name                  | Version          | Arch  
---+------------+-----------------------+------------------+-------
i+ | @System    | herbstluftwm          | 1335135043-3.280 | x86_64
i  | @System    | openSUSE-release-mini | 20170816-1.2     | x86_64

Docker Zypper: Package Unneeded


History

The Log File

This is most the forgotten part of package management, although it is not uncommon to notice messages.

$ less /var/log/zypp/history
# 2017-08-23 08:57:51 man-2.7.6-3.3.x86_64.rpm installed ok
# Additional rpm output:
# Updating /etc/sysconfig/cron ...
# 
2017-08-23 08:57:51|install|man|2.7.6-3.3|x86_64|root@d2e88a46e111|oss|21490bfff69e98449f8ae00bb9e91b15038566ca|
2017-08-23 10:01:09|command|root@d2e88a46e111|'zypper' 'install' '--force' 'man' 'nano' 'htop' 'ncdu' 'fish'|
2017-08-23 10:01:12|install|htop|2.0.2-3.4|x86_64|root@d2e88a46e111|oss|2807afd80fa606228799ab76baddfc2e688d60b8|

Most likely you want the tail, latest transaction, at the bottom of the recorded event.

Docker: /var/log/zypp/history


Clean Up

Opensuse as default does not keep downloaded package, unless keeppackages=1 sets in /etc/zypp/repos.d/. But sometimes cache files left for some reason.

Package Cache

  • /var/cache/zypp/packages/ * /x86_64/ * .x86_64.rpm

  • /var/cache/zypp/packages/ * /suse/noarch/ * .noarch.rpm

$ ls -lR /var/cache/zypp/packages/

Docker Zypper: Cache

You can clean these directory.

$ zypper clean

Docker Zypper: Clean


What’s Next

Repository deserve their own article. Consider finish reading [ Part Three ].

Thank you for reading