Welcome on my blog

We use cookies to ensure you get the best experience on our website.

Linux – SUSE – Zypper — Przydatne komendy – Menedżer pakietów SUSE

Autor: chmajster 24.08.2022

Zypper to konsolowy menedżer pakietów umożliwiający instalację, aktualizację i odpytywanie lokalnych i zdalnych repozytoriów.

Słownik Zyppera

Aktualizacja repozytoriów

zypper ref
or
zypper refresh

chris:~ # zypper ref
Retrieving repository 'Repozytorium główne (NON-OSS)' metadata ...............................................................................................................................................[done]
Building repository 'Repozytorium główne (NON-OSS)' cache ....................................................................................................................................................[done]
Retrieving repository 'Repozytorium główne (OSS)' metadata ...................................................................................................................................................[done]
Building repository 'Repozytorium główne (OSS)' cache ........................................................................................................................................................[done]
Retrieving repository 'Główne repozytorium aktualizacji' metadata ............................................................................................................................................[done]
Building repository 'Główne repozytorium aktualizacji' cache .................................................................................................................................................[done]
Retrieving repository 'openSUSE-20220914-0' metadata .........................................................................................................................................................[done]
Building repository 'openSUSE-20220914-0' cache ..............................................................................................................................................................[done]
All repositories have been refreshed.
chris:~ # 

Lista Repozytoriów

zypper lr
lub
zypper repos

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

# | Alias                            | Name                             | Enabled | GPG Check | Refresh
--+----------------------------------+----------------------------------+---------+-----------+--------
1 | download.opensuse.org-non-oss    | Repozytorium główne (NON-OSS)    | Yes     | (r ) Yes  | Yes
2 | download.opensuse.org-oss        | Repozytorium główne (OSS)        | Yes     | (r ) Yes  | Yes
3 | download.opensuse.org-tumbleweed | Główne repozytorium aktualizacji | Yes     | (r ) Yes  | Yes
4 | openSUSE-20220914-0              | openSUSE-20220914-0              | Yes     | (r ) Yes  | Yes
5 | repo-debug                       | openSUSE-Tumbleweed-Debug        | No      | ----      | ----
6 | repo-source                      | openSUSE-Tumbleweed-Source       | No      | ----      | ----
chris:~ # 

Dir with repo
/etc/zypp/repos.d/

Lista możliwych do uaktualnienia paczek

zypper lu
or
zypper list-updates

chris:~ # zypper lu
Loading repository data...
Reading installed packages...
S | Repository             | Name                                 | Current Version                          | Available Version                        | Arch
--+------------------------+--------------------------------------+------------------------------------------+------------------------------------------+-------
v | Main Update Repository | ImageMagick                          | 7.0.7.34-lp152.12.12.1                   | 7.0.7.34-lp152.12.15.1                   | x86_64
v | Main Update Repository | ImageMagick-config-7-SUSE            | 7.0.7.34-lp152.12.12.1                   | 7.0.7.34-lp152.12.15.1                   | x86_64
v | Main Update Repository | MozillaFirefox                       | 78.9.0-lp152.2.52.1                      | 78.10.0-lp152.2.55.1                     | x86_64
v | Main Update Repository | MozillaFirefox-translations-common   | 78.9.0-lp152.2.52.1                      | 78.10.0-lp152.2.55.1                     | x86_64

Aktualizacja paczki

zypper up <paczka>

Aktualizacja patched zgodnie z PATCHNAME

# Informacja o patch 
zypper info -t patch amarok #show info for 'amarok' patch

zypper up -t patch "CL-SUSE-SLE-SERVER-12-SP5-2023-337"

Aktualizacja wszystkich paczek na OS

zypper up
or 
zypper update

Podnoszenie dystrybucji OS (Service Pack)

zypper dup

Szukaj paczki w repo

zypper se <paczka>

chris:~ # zypper se -s open-vm-tools
Loading repository data...
Reading installed packages...

S | Name                      | Type    | Version    | Arch   | Repository
--+---------------------------+---------+------------+--------+--------------------------
i | open-vm-tools             | package | 12.1.0-1.2 | x86_64 | Repozytorium główne (OSS)
v | open-vm-tools             | package | 12.1.0-1.1 | x86_64 | openSUSE-20220914-0

Instalacja paczki

zypper in <paczka>
or
zypper install <paczka>

Instalacja paczka (starej, innej niż najnowsza)

zypper in -oldpackages <paczka>

Instalacja bez potwierdzenia

zypper -n in <paczka>

Informacje o Paczce skąd jest itp

zypper if <paczka>
or
zypper info <paczka>

chris:~ # zypper if lsof
Loading repository data...
Reading installed packages...


Information for package lsof:
-----------------------------
Repository     : Repozytorium główne (OSS)
Name           : lsof
Version        : 4.95.0-3.2
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 1013.4 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : lsof-4.95.0-3.2.src
Upstream URL   : https://github.com/lsof-org/lsof
Summary        : A Program That Lists Information about Files Opened by Processes
Description    : 
    Lsof lists information about files opened by processes. An open file
    may be a regular file, a directory, a block special file, a character
    special file, an executing text reference, a library, a stream, or a
    network file (Internet socket, NFS file, or UNIX domain socket.)  A
    specific  file or all the files in a file system may be selected by
    path.

Lista zablokowanych paczek

zypper ll

chris:~ # zypper ll
# | Name | Type    | Repository | Comment
--+------+---------+------------+--------
1 | lsof | package | (any)      | 
chris:~ # 

Blokowanie uaktualniania paczki

zypper al <paczka>

chris:~ # zypper la lsof
Specified lock has been successfully added.
chris:~ # 

Zdejmowanie locka z paczki

zypper rl <paczka>	

chris:~ # zypper rl lsof
1 lock has been successfully removed.
chris:~ # 

Dodaj repozytorium

zypper ar <url_repozytorium> <nazwa_repo>

Usuwanie Repozytorium

zypper rr <nazwa_repo>
zypper removerepo <nazwa_repo>

Usuwanie Sprawdzania „GPG check” dla wybranego repo

zypper mr -G <nazwa_repo>

Exportowanie listy repozytoriów

zypper lr --export moje_repozytoria.repo

chris:~ # zypper lr --export moje_repozytoria.repo
Repositories have been successfully exported to ./moje_repozytoria.repo.
chris:~ # 

Importowanie listy repozytoriów

zypper ar moje_repozytoria.repo

chris:~ # zypper rr -all

Repository 'Repozytorium główne (NON-OSS)' has been removed.
Removing repository 'Repozytorium główne (OSS)' ..............................................................................................................................................................[done]


URI         : http://download.opensuse.org/tumbleweed/repo/non-oss/
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)

Adding repository 'Repozytorium główne (OSS)' ................................................................................................................................................................[done]
Repository 'Repozytorium główne (OSS)' successfully added

URI         : http://download.opensuse.org/tumbleweed/repo/oss/
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)

Czy plik należy do jakieś paczki?

zypper wp alisp.h

Zypper obniżanie Service Packa np SLES 15 SP4 do SLES 15 SP3

# Remember to attach old repository
zypper dup --allow-downgrade --allow-vendor-change

Zypper in Scripts and Applications

Non Interactive Mode

zypper --non-interactive

Quiet Output

zypper --quiet

XML Output

zypper --xmlout

Auto-agree with Licenses

zypper --auto-agree-with-licenses
Tagi: Linux, SUSE
Dodaj komentarz

Search
Categories
O Blogu

Cześć Podróżniku!

Ta strona ma nie być typowym poradnikiem w IT, Głównym jej cel to zapisanie krótkich notatek, które mogą się przydać w codziennym życiu podczas korzystania/konfiguracji różnych urządzeń np. Ustawienia DHCP na Routerze Cisco, Ustawieniu Karty sieciowej na Linuxie itp.

Buy me A coffee
[Empty]

Wszelkie prawa zastrzeżone