How to list and search packages on Alpine Linux Server

How to list and search package on Alpine Linux Server


Do the below steps to list all packages on Alpine Linux server

1. Log into your Alpine server as ‘root’ user.

2. First you must run ‘apk update’ to update the Alpine package list.

3. Type the command ‘apk search’ to list all package on your Server.

Command:

# apk search

# apk search | wc -l
9728

‘apk search’ command will return long list of packages so please use ‘less’ option to list the packages one screen at a time.

# apk search | less

To list all package version (instead of latest version) use ‘--all’ or ‘-a’ option.

# apk search --all

OR

# apk search -a

Use grep to filter out specific keyword from the package list.

# apk search | grep php

Use ‘-v’ or ‘--verbose’ option to list all the packages and along their description.

Command:

# apk search --verbose

OR

# apk search -v

 

How to list all installed packages on Alpine Linux Server

 

Run ‘apk list -I’ OR ‘apk list --installed’ to list all installed package on Alpine Linux Server

Command :

apk list -I

OR

apk list --installed

You can also use ‘apk info’ command to list installed package on Alpine.

 

To list contents of a package

 

The below command will list the contents of a package.

# apk info -L [package_name]

OR

# apk info --contents [package_name]

 

To list all package that depends on another package

 

Before unstalling a package you can check which all package depends on that package. Deleting a package might affect other packages that depend on it.

# apk info --rdepends [package_name]

OR

# apk info -r [package_name]

Example :

# apk info --rdepends python
python2-2.7.15-r3 is required by:
supervisor-3.3.4-r1
py-setuptools-40.6.3-r0
py-meld3-1.0.2-r1

 

List all packages that package depend on

 

apk info --depends supervisor
supervisor-3.3.4-r1 depends on:
python2
py-meld3
py-setuptools

In the above example you can see that ‘supervisor’ package depends on python2.

 

How to print all information of a package on Alpine Server

 

Run the below command to list all information of package.

command:

# apk info [package_name] --all

Example :

# apk info supervisor --all

--all option will shows all details like package website, package dependencies, size of package, package description etc.

 

How to list content of a package installed on Alpine Linux Server

 

Run ‘apk info’ command with “--contents” or “-L” option to list contents within a package.

Command :

apk info [package_name] -L less

Example :

apk info supervisor -L | less