Zypper package argument ambiguity?
I took the Knowledge Check for section 12 and got the question following question incorrect:
True or False? zypper update does not accept a package as argument.
I answered it does not accept a package as an argument. I got it wrong.
I checked my notes, went back to the course work, and found that there is no mention of an accepted argument for the update command:
Updates all packages on system from a repository:
$ sudo zypper update
I even checked the help section of zypper in OpenSUSE 15.5, and it makes no mention of an accepted argument either:
Update Management:
update, up Update installed packages with newer versions.
list-updates, lu List available updates.
patch Install needed patches.
list-patches, lp List available patches.
dist-upgrade, dup Perform a distribution upgrade.
patch-check, pchk Check for patches.
I assumed that since dnf [11] previously explicitely mentioned an optional arguement, that the lack of one given during this lesson meant that it does not accept a package as an argument.
Update a package from a repository (if no package is listed, update all packages):
$ sudo dnf update [package]
I ran the zypper command with the package argument, and it does indeed accept it.
I eventually found the issue... the lab that asks you to update a specific package.
The course teaches you to update a package using the install command, not update.
Installs or updates a package on the system:
$ sudo zypper install firefox
So I didn't catch that the answer in the lab is slightly different, because I successfully updated the package using install and didn't check the lab syntax to see that update was used instead.
Is there a specific reason the knowledge is relegated to a lab answer? It might be worth updating the verbiage on one or two of those command descriptions, as the lab answer seems to come out of nowhere.
Best Answer
Answers
-
Hi @peffse,
Yes, 'zypper update' can accept arguments. And there isn't any ambiguity about this. Look at the man page for zypper, from https://en.opensuse.org/Archive:Zypper_manual_(plain)
update (up) [options] [packagename]...
Update installed packages with newer versions, where possible. + This command will not update packages
which would require change of package vendor unless the vendor is specified in /etc/zypp/vendors.d, or
which would require manual resolution of problems with dependencies. Such non-installable updates will
then be listed in separate section of the summary as "The following package updates will NOT be
installed:". + To update individual packages, specify one or more package names. You can use the * and ?
wildcard characters in the package names to specify multiple packages matching the pattern.In fact I made a test on my openSUSE Leap 16.0 system:
So first I took a look at what packages are ready to update:
luis@opensuse:~> zypper list-updates
Cargando datos del repositorio...
Leyendo los paquetes instalados...
S | Repository | Name | Current Version | Available Version | Arch
---+----------------------+--------------------------------------+---------------------------------------+---------------------------------------+-------
v | repo-oss (16.0) | avahi | 0.8-160000.2.2 | 0.8-160000.4.1 | x86_64
v | repo-oss (16.0) | bind-utils | 9.20.11-160000.2.2 | 9.20.18-160000.1.1 | x86_64
v | repo-oss (16.0) | branding-openSUSE | 16.0.20240405-lp160.9.1 | 16.0.20240405-lp160.10.1 | x86_64
v | repo-oss (16.0) | colord | 1.4.6-160000.2.2 | 1.4.8-160000.1.1 | x86_64
v | repo-oss (16.0) | colord-color-profiles | 1.4.6-160000.2.2 | 1.4.8-160000.1.1 | x86_64
v | repo-oss (16.0) | curl | 8.14.1-160000.2.2 | 8.14.1-160000.4.1 | x86_64Then I choose 'curl' to update it:
luis@opensuse:~> sudo zypper update curl
[sudo] contraseña para luis:
Actualizando el servicio 'openSUSE'.
Cargando datos del repositorio...
Leyendo los paquetes instalados...
Resolviendo dependencias de paquete...El siguiente paquete va a ser actualizado:
curl1 paquete a actualizar.
Tamaño de la descarga del paquete: 585,1 KiB
Cambio de tamaño de la instalación del paquete:
| 558,1 KiB requerido por los paquetes que se instalarán
603 B | - 557,5 KiB liberados por los paquetes que van a ser eliminadosBackend: classic_rpmtrans
¿Desea continuar? [s/n/v/...? mostrar todas las opciones] (s): s
Precargando: curl-8.14.1-160000.4.1.x86_64.rpm [terminado]
Precarga finalizada. [correcto (200,0 KiB/s) ] ........................................................................................................................[terminado]
Obteniendo: curl-8.14.1-160000.4.1.x86_64 (repo-oss (16.0)) (1/1), 585,1 KiBBuscando conflictos de archivos: ......................................................................................................................................[terminado]
(1/1) Instalando: curl-8.14.1-160000.4.1.x86_64 .......................................................................................................................[terminado]
Ejecutando guiones postransacción .....................................................................................................................................[terminado]luis@opensuse:~>
I hope this helps

Regards,
Luis.0 -
Oh, I think there might have been a misunderstanding. I was asking why the lesson does not actually include this information.
0
Categories
- All Categories
- 175 LFX Mentorship
- 175 LFX Mentorship: Linux Kernel
- 745 Linux Foundation IT Professional Programs
- 372 Cloud Engineer IT Professional Program
- 168 Advanced Cloud Engineer IT Professional Program
- 73 DevOps IT Professional Program - Discontinued
- 3 DevOps & GitOps IT Professional Program
- 98 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- AI & ML Training
- Blockchain & Decentralized Identity Training
- Cloud & Containers Training
- Cybersecurity Training
- DevOps & Site-Reliability Training
- Linux Kernel Development Training
- Networking Training
- Open Source Best Practice Training
- System Administration Training
- System Engineering Training
- Web & Application Development Training
- 2 LFD103-JP クラス フォーラム
- 4 LFD210-CN Class Forum
- 764 LFD259 Class Forum
- 681 LFS101 Class Forum
- 2 LFS158-JP クラス フォーラム
- 162 LFS207 Class Forum
- 3 LFS207-DE-Klassenforum
- 4 LFS207-JP クラス フォーラム
- 61 LFS241 Class Forum
- 52 LFS242 Class Forum
- 42 LFS243 Class Forum
- 19 LFS244 Class Forum
- 4 LFS250-JP クラス フォーラム
- 166 LFS253 Class Forum
- 19 LFS256 Class Forum
- 1.4K LFS258 Class Forum
- 165 LFS261 Class Forum
- 26 LFS267 Class Forum
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 768 Linux Distributions
- 81 Debian
- 67 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 105 Mobile Computing
- 18 Android
- 72 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 944 Programming and Development
- 310 Kernel Development
- 616 Software Development
- 977 Software
- 369 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)
