How to use the command 'eix' (with examples)
- Linux
- December 25, 2023
The ’eix’ command is a utility for searching local Gentoo packages. It allows users to search for packages, update the local package cache, and provides more information on Gentoo packages. This article will provide examples and explanations of different use cases for the ’eix’ command.
Use case 1: Search for a package
Code:
eix query
Motivation: This command is useful when you want to search for a specific package in the Gentoo package database.
Explanation: The ’eix’ command followed by the ‘query’ argument allows users to search for a package. The ‘query’ argument should be replaced with the name of the package you want to search for.
Example output:
* net-misc/curl
Available versions: 7.76.1^t {adns alt-svc brotli darwin debug http2 idn ipv6 ldap libpsl metalink nghttp2 nss progress-meter rtmp ssl static-libs test threaded unicode uriparser zstd}
Homepage: https://curl.se/
Description: A Client that groks URLs
Use case 2: Search for installed packages
Code:
eix --installed query
Motivation: This command is useful when you want to search for packages that are already installed on your system.
Explanation: The ‘–installed’ flag is used to search for installed packages, followed by the ‘query’ argument which should be replaced with the name of the package you want to search for.
Example output:
* sys-apps/gentoo-sources
Description: Full sources including the Gentoo patchset for the 5.4 kernel tree
Homepage: https://www.gentoo.org/
Installed versions: 5.4.114-r1^d(05:32:39 PM 07/21/2021)
Use case 3: Search in package descriptions
Code:
eix --description "description"
Motivation: This command is useful when you want to search for packages based on the descriptions provided.
Explanation: The ‘–description’ flag is used to search for packages based on the provided description. The “description” argument should be replaced with the desired keyword or phrase to search for in the package descriptions.
Example output:
* net-misc/openssh
Description: Port of OpenBSD's free SSH release
Use case 4: Search by package license
Code:
eix --license license
Motivation: This command is useful when you want to search for packages based on their license.
Explanation: The ‘–license’ flag is used to search for packages based on the provided license. The “license” argument should be replaced with the desired license to search for.
Example output:
* dev-util/cmake
Description: Cross platform Make
License: Apache-2.0 BSD BSD-2 BSD-3 BSD-4 EPL-1.0 GPL-2 GPL-3 LGPL MIT MIT-1.0 MPL-2.0 OpenSSL public-domain UCD YUIDoc
Use case 5: Exclude results from search
Code:
eix --not --license license
Motivation: This command is useful when you want to exclude certain packages from the search results based on their license.
Explanation: The ‘–not’ flag is used to exclude packages from the search results based on the provided license. The ‘–license’ flag is used to specify the license to exclude. The “license” argument should be replaced with the license you want to exclude.
Example output:
* dev-util/cmake
Description: Cross platform Make
License: Apache-2.0 BSD BSD-2 BSD-3 BSD-4 EPL-1.0 GPL-2 GPL-3 LGPL MIT MIT-1.0 MPL-2.0 OpenSSL public-domain UCD YUIDoc
Conclusion:
The ’eix’ command is a useful tool for searching local Gentoo packages. It provides various options to search for packages, including searching by package name, installed packages, package descriptions, package licenses, and excluding results based on license. By utilizing these search options, users can easily find and manage Gentoo packages on their system.