So vuoi vedere un elenco di tutti i pacchetti installati sul tuo sistema SUSE Linux o OpenSUSE Linux? Prova questi semplici suggerimenti per elencare tutti i pacchetti.
Possiamo facilmente cercare i pacchetti che corrispondono a qualsiasi dato testo/parola di ricerca in OpenSUSE o SUSE Enterprise Linux utilizzando il comando zypper.
| Dettagli tutorial | |
|---|---|
| Livello di difficoltà | Facile |
| Privilegi di root | sì |
| Requisiti | SUSE/OpenSUSE Linux |
| Est. momento della lettura | 2 minuti |
Elenco di tutti i pacchetti installati sul comando OpenSUSE/SUSE Linux
La procedura è la seguente:
- Apri l’applicazione del terminale.
- Per il server remoto, usa il client ssh:
ssh ec2-user@suse-nixcraft-box - Quindi digita il comando zypper per mostrare solo i pacchetti installati:
ricerca zypper -i - Trova se il pacchetto nginx è installato o meno:
zypper search -i nginx

clicca per ingrandire
Si prega di notare che ricerca zypper -i può essere più leggibile come segue:
zypper search --installed-only
# search for php7 packages #
zypper search --installed-only php7
Loading repository data... Reading installed packages... S | Name | Summary | Type --+-----------------------+-----------------------------------------------------------+----------- | apache2-mod_php7 | PHP7 module for the Apache 2.x webserver | package | php7 | Interpreter for the PHP scripting language version 7 | package | php7 | Interpreter for the PHP scripting language version 7 | srcpackage | php7-APCu | APCu - APC User Cache | package | php7-bcmath | "Binary Calculator" extension for PHP | package | php7-bz2 | bzip2 codec support for PHP | package | php7-calendar | PHP7 Extension Module | package | php7-ctype | Character class extension for PHP | package | php7-curl | libcurl integration for PHP | package | php7-dba | Database abstraction layer for PHP | package | php7-devel | PHP7 development files for C/C++ extensions | package | php7-dom | Document Object Model extension for PHP | package | php7-embed | Embedded SAPI Library | package | php7-enchant | Spell checking extension for PHP | package | php7-exif | EXIF metadata extensions for PHP | package | php7-fastcgi | FastCGI PHP7 Module | package | php7-fileinfo | File identification extension for PHP | package | php7-firebird | Firebird database client for PHP | package .... ...... .. | php7-zip | ZIP archive support for PHP | package | php7-zlib | Zlib compression support for PHP | package | uwsgi-php7 | PHP7 Plugin for uWSGI | package
Visualizzazione dell’elenco dei pacchetti una pagina alla volta
Utilizzare il comando more o less come segue:zypper search -i | more
zypper search --installed-only | less
Possiamo anche usare il comando grep o il comando egrep per filtrare facilmente le informazioni (nomi dei pacchetti) anche su OpenSUSE:zypper search -i | grep 'apache'
zypper search --installed-only | egrep 'bash|php7|python|nginx'
Come usare i caratteri jolly
* e ? i caratteri jolly possono essere utilizzati anche all’interno delle stringhe di ricerca. Ad esempio, cerca i pacchetti nginx installati e disinstallati:zypper search 'nginx*'
Ecco cosa vedo:
Solo guide per i sostenitori di Patreon ????
- Nessuna pubblicità e tracciamento
- Guide approfondite per sviluppatori e amministratori di sistema su Opensourceflare✨
- Unisciti al mio Patreon per supportare i creatori di contenuti indipendenti e iniziare a leggere le ultime guide:
Loading repository data... Reading installed packages... S | Name | Summary | Type ---+----------------------------------------+----------------------+----------- i | nginx | A HTTP server and -> | package | nginx | A HTTP server and -> | srcpackage | nginx-geolite-asn | IP ASN geolocation-> | package | nginx-geolite-city | Free IP city geolo-> | package | nginx-geolite-country | Free IP country ge-> | package | nginx-ingress-controller | Kubernetes ingress-> | package i+ | nginx-module-brotli | NGINX module for B-> | package | nginx-module-cookie-flag | The Nginx module f-> | package | nginx-module-devel-kit | Additional generic-> | package | nginx-module-devel-kit-source | The nginx-module-d-> | package | nginx-module-http-auth-digest | Digest Authenticat-> | package | nginx-module-http-substitutions-filter | Regular expression-> | package | nginx-module-modsecurity | ModSecurity v3 Ngi-> | package | nginx-module-set-misc | Various set_xxx di-> | package | nginx-module-sticky-ng | Nginx module to ad-> | package | nginx-module-vts | Nginx virtual host-> | package | nginx-source | The nginx source | package
I risultati della ricerca vengono stampati in una tabella con le colonne Stato, Nome, Riepilogo e Tipo pacco.
| Stato | Descrizione |
|---|---|
| io+ | installato su richiesta dell’utente |
| io | installato automaticamente dal resolver |
| v | è installata una versione diversa |
| vuoto | nessuno dei casi precedenti |
| ! | una patch in stato necessario |
| .l | viene mostrato nella 2a colonna se l’elemento è bloccato |
| .P | viene mostrato nella 2a colonna se l’elemento fa parte di una PTF (una correzione temporanea del programma che deve essere selezionata in modo esplicito e che altrimenti non sarà considerata nella risoluzione delle dipendenze). |
| .R | viene mostrato nella 2a colonna se l’articolo è stato ritirato |
Riassumendo
Hai imparato a mostrare un elenco di tutti i pacchetti installati sul sistema OpenSUSE o SUSE Enterprise Linux utilizzando il comando zypper. Ottenere aiuto è facile usando il comando man:man zypper
zypper help search
Command options:
--match-substrings Search for a match to partial words (default).
--match-words Search for a match to whole words only.
-x, --match-exact Searches for an exact match of the search strings.
--provides Search for packages which provide the search strings.
--requires Search for packages which require the search strings.
--recommends Search for packages which recommend the search strings.
--supplements Search for packages which supplement the search strings.
--conflicts Search packages conflicting with search strings.
--obsoletes Search for packages which obsolete the search strings.
--suggests Search for packages which suggest the search strings.
--provides-pkg Search for all packages that provide any of the provides of the
package(s) matched by the input parameters.
--requires-pkg Search for all packages that require any of the provides of the
package(s) matched by the input parameters.
--recommends-pkg Search for all packages that recommend any of the provides of the
package(s) matched by the input parameters.
--supplements-pkg Search for all packages that supplement any of the provides of the
package(s) matched by the input parameters.
--conflicts-pkg Search for all packages that conflict with any of the package(s) matched
by the input parameters.
--obsoletes-pkg Search for all packages that obsolete any of the package(s) matched by
the input parameters.
--suggests-pkg Search for all packages that suggest any of the provides of the
package(s) matched by the input parameters.
-t, --type <TYPE> Search only for packages of the specified type.
-n, --name Useful together with dependency options, otherwise searching in package
name is default.
-f, --file-list Search for a match in the file list of packages.
-d, --search-descriptions Search also in package summaries and descriptions. Default: false
-C, --case-sensitive Perform case-sensitive search. Default: false
-s, --details Show each available version in each repository on a separate line.
Default: false
-v, --verbose Like --details, with additional information where the search has matched
(useful for search in dependencies). Default: false
-i, --installed-only Show only installed packages.
-u, --not-installed-only Show only packages which are not installed.
--sort-by-name Sort packages by name (default).
--sort-by-repo Sort packages by repository.
-r, --repo <ALIAS|#|URI> Work only with the specified repository.
ANNUNCIO
