GNU/Linux >> Linux の 問題 >  >> Debian

コマンドラインを使用して、Debian、Ubuntu、または Linux Mint で利用可能なパッケージを検索する方法は次のとおりです [APT]

コマンド ラインから Debian、Ubuntu、または Linux Mint で利用可能なパッケージを検索する方法はいくつかあります。この記事ではそれらについて説明します aptapt-cacheaptitude .これを使用して、パッケージ名とパッケージの説明の両方を検索します。これは、特定のパッケージを探しているが正確なパッケージ名がわからない場合、または特定の目的/タスク用のツールが必要であるが利用可能なオプションがわからない場合に役立ちます.

apt を使用する場合の主な違い 、 apt-cache および aptitude 以下の例でわかるように、利用可能なパッケージを検索することは、それらの出力とソート順です。同様に、aptitude Debian ベースの Linux ディストリビューションでは、デフォルトでインストールされない場合があります。

個人的には apt-cache の方が好きです 出力が読みやすいため (通常、追加情報は必要ありません。apt-cache policy package-name を使用できるインストール済み/利用可能なバージョンを確認するため) );また、探している結果が一番上に表示される傾向もあります。

もう 1 つ注意すべき点は、apt です。 および apt-cache apt ソフトウェア パッケージ キャッシュを検索して、aptitude の間、リポジトリで利用可能なパッケージと手動でインストールされた DEB パッケージの両方が返されるようにします (リポジトリでは利用できません)。 リポジトリで利用可能なパッケージのみを返します。

I. aptitude で利用可能なパッケージを検索

aptitude apt の Ncurses ベースのフロントエンドです。 .通常、このツールはデフォルトではインストールされませんが、次のコマンドを使用して、Debian、Ubuntu、Linux Mint、およびその他の Debian ベースの Linux ディストリビューションにインストールできます:

sudo apt install aptitude

aptitude を使用して、コマンド ラインからパッケージを検索できます。

aptitude search KEYWORD

例:

$ aptitude search openssh
p   libconfig-model-openssh-perl                           - configuration editor for OpenSsh
p   libghc-crypto-pubkey-openssh-dev                       - OpenSSH key codec
p   libghc-crypto-pubkey-openssh-dev:i386                  - OpenSSH key codec
v   libghc-crypto-pubkey-openssh-dev-0.2.7-6af0a           -
v   libghc-crypto-pubkey-openssh-dev-0.2.7-6af0a:i386      -
p   libghc-crypto-pubkey-openssh-doc                       - OpenSSH key codec; documentation
p   libghc-crypto-pubkey-openssh-prof                      - OpenSSH key codec; profiling libraries
p   libghc-crypto-pubkey-openssh-prof:i386                 - OpenSSH key codec; profiling libraries
v   libghc-crypto-pubkey-openssh-prof-0.2.7-6af0a          -
v   libghc-crypto-pubkey-openssh-prof-0.2.7-6af0a:i386     -
p   libnet-openssh-compat-perl                             - collection of compatibility modules for Net::OpenSSH
p   libnet-openssh-parallel-perl                           - run SSH jobs in parallel
p   libnet-openssh-perl                                    - Perl SSH client package implemented on top of OpenSSH
p   lxqt-openssh-askpass                                   - OpenSSH user/password GUI dialog for LXQt
p   lxqt-openssh-askpass:i386                              - OpenSSH user/password GUI dialog for LXQt
p   lxqt-openssh-askpass-l10n                              - Language package for lxqt-openssh-askpass
v   lxqt-openssh-askpass-l10n:i386                         -
i   openssh-client                                         - secure shell (SSH) client, for secure access to remote machines
p   openssh-client:i386                                    - secure shell (SSH) client, for secure access to remote machines
p   openssh-client-ssh1                                    - secure shell (SSH) client for legacy SSH1 protocol
p   openssh-client-ssh1:i386                               - secure shell (SSH) client for legacy SSH1 protocol
p   openssh-known-hosts                                    - download, filter and merge known_hosts for OpenSSH
p   openssh-server                                         - secure shell (SSH) server, for secure access from remote machines
p   openssh-server:i386                                    - secure shell (SSH) server, for secure access from remote machines
p   openssh-sftp-server                                    - secure shell (SSH) sftp server module, for SFTP access from remote machines
p   openssh-sftp-server:i386                               - secure shell (SSH) sftp server module, for SFTP access from remote machines


必要に応じて、aptitude Ncurses ユーザー インターフェイスを使用することもできます。 aptitude と入力します 開始するには:


/ を押すとパッケージを検索できます キーワードの入力を開始します。

Ⅱ. apt-cache で利用可能なパッケージを検索

apt-cache を使用 次のように、Debian、Ubuntu、または Linux Mint リポジトリで利用可能なパッケージ (およびリポジトリにないインストール済みの DEB パッケージ) を検索するには:

apt-cache search KEYWORD

例:

$ apt-cache search openssh
openssh-client - secure shell (SSH) client, for secure access to remote machines
openssh-server - secure shell (SSH) server, for secure access from remote machines
openssh-sftp-server - secure shell (SSH) sftp server module, for SFTP access from remote machines
python-setproctitle - Setproctitle implementation for Python 2
python3-setproctitle - Setproctitle implementation for Python 3
ssh - secure shell client and server (metapackage)
agent-transfer - copy a secret key from GnuPG's gpg-agent to OpenSSH's ssh-agent
...
ssh-askpass-gnome - interactive X program to prompt users for a passphrase for ssh-add
ssh-audit - tool for ssh server auditing
sshpass - Non-interactive ssh password authentication

非常に長くなる可能性があるため、出力の一部を削除しました。ただし、表示される結果の順序は変更されていません。

III. apt で利用可能なパッケージを検索

apt の使用 次のようにコマンドラインから利用可能なパッケージを検索できます:

apt search KEYWORD

KEYWORD を検索するキーワードに置き換えます (複数のキーワードを引用符で囲むことができます)。

「openssh」とその出力を検索する例を次に示します。

$ apt search openssh
Sorting... Done
Full Text Search... Done
agent-transfer/bionic 0.41-1ubuntu1 amd64
  copy a secret key from GnuPG's gpg-agent to OpenSSH's ssh-agent
cme/bionic,bionic 1.026-1 all
  Check or edit configuration data with Config::Model
connect-proxy/bionic 1.105-1 amd64
  Establish TCP connection using SOCKS4/5 or HTTP tunnel
...
openssh-client/bionic,now 1:7.6p1-4 amd64 [installed]
  secure shell (SSH) client, for secure access to remote machines
openssh-client-ssh1/bionic 1:7.5p1-10 amd64
  secure shell (SSH) client for legacy SSH1 protocol
openssh-known-hosts/bionic,bionic 0.6.2-1 all
  download, filter and merge known_hosts for OpenSSH
openssh-server/bionic 1:7.6p1-4 amd64
  secure shell (SSH) server, for secure access from remote machines
openssh-sftp-server/bionic 1:7.6p1-4 amd64
  secure shell (SSH) sftp server module, for SFTP access from remote machines
putty-tools/bionic 0.70-4 amd64
  command-line tools for SSH, SCP, and SFTP
python-scp/bionic,bionic 0.10.2-1 all
  scp module for paramiko

ここでも、結果のリストが非常に長いため、一部の結果を削除しました。ただし、結果の順序は変更されていません。

3 つすべてについて、検索結果は非常に長くなる可能性があります。そのような場合、それらを通過できます more 、次のように読みやすくします:

apt-cache search KEYWORD | more

grep を使用して、特定のキーワード (この例では KEYWORD2) を含まない結果を除外することもできます。 :

apt-cache search KEYWORD | grep KEYWORD2

grep デフォルトでは、大文字と小文字が区別されます。 -i に追加 (grep -i KEYWORD2 ) 大文字と小文字を区別しません。


Debian
  1. Ubuntu 18.04、Debian 9、LinuxMint19にPipをインストールする方法

  2. sipcalcLinuxコマンドラインツールの使用方法

  3. Ubuntu、Debian、または Linux Mint でリポジトリ内のすべてのパッケージを一覧表示する方法 [APT]

  1. Linuxgrepコマンドの使用方法

  2. Ubuntu18.04およびCentOS7でLinuxシャットダウンコマンドを使用する方法

  3. UbuntuLinuxでtailコマンドを使用する方法

  1. Linux rsyncコマンド:使用方法

  2. コマンドラインからUbuntuのバージョンを確認する方法

  3. APT PPA リポジトリを使用して Ubuntu、Debian、または Linux Mint に Oracle Java 15 をインストールする方法