Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alpine apk: List all available package versions

How can I list all available package versions of a given package on Alpine Linux?

I couldn't find anything helpful in the apk help.

apk info bash only shows me the latest available bash version.

# apk info bash
bash-5.0.0-r0 description:
The GNU Bourne Again shell

bash-5.0.0-r0 webpage:
https://www.gnu.org/software/bash/bash.html

bash-5.0.0-r0 installed size:
1200128

Using the --all flag I only get some additional info for that version:

# apk info --all bash
bash-5.0.0-r0 description:
The GNU Bourne Again shell

bash-5.0.0-r0 webpage:
https://www.gnu.org/software/bash/bash.html

bash-5.0.0-r0 installed size:
1200128

bash-5.0.0-r0 depends on:
/bin/sh
so:libc.musl-x86_64.so.1
so:libreadline.so.8

bash-5.0.0-r0 provides:
cmd:bash

bash-5.0.0-r0 has auto-install rule:

bash-5.0.0-r0 license:
GPL-3.0-or-later

apk list and apk list --available only list all available packages at their latest version.
So if I run apk list -a | grep "^bash-\d", I only get this:

# apk list -a | grep "^bash-\d"
bash-5.0.0-r0 x86_64 {bash} (GPL-3.0-or-later)
like image 883
Forivin Avatar asked Sep 09 '19 08:09

Forivin


People also ask

How do I list installed packages in Alpine?

The list of repositories is stored in /etc/apk/repositories configuration file. Use the cat command to view /etc/apk/repositories file. Alpine Linux package often has the . apk extension called “a-packs”.

How do I find my Alpine packages?

On your local Alpine Linux system, you can find the repositories in the /etc/apk/repositories file, you can use the cat command to view them as follows. Having looked at the repositories, let us straight away jump into managing packages using the apk package manager.

What packages does Alpine Linux use?

Alpine Linux is a Linux distribution designed to be small, simple and secure. Unlike most other Linux distributions, Alpine uses musl and BusyBox instead of the more commonly used Glibc and GNU Core Utilities and OpenRC for its init system instead of systemd.


1 Answers

The command list the info from the lastest branch and Alpine manage package version in different branches for example v3.5, v3.6.... v3.10

The apk utility can install packages from multiple repositories. The list of repositories to check is stored in /etc/apk/repositories, one repository per line.

You can search for the version here

https://pkgs.alpinelinux.org/packages?name=bash&branch=v3.5

or

https://pkgs.alpinelinux.org/packages

So if you are interested to add the version bash4.3 the should tell the branch name while adding the older version or from other branchers rather then the latest one.

apk add  --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/main/ bash=4.3.46-r5

So if you run

apk add  --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/main/ && apk info bash

You will get the version info from two different branches.

The GNU Bourne Again shell

bash-4.3.46-r5 webpage:
http://www.gnu.org/software/bash/bash.html

bash-4.3.46-r5 installed size:
700416

bash-5.0.0-r0 description:
The GNU Bourne Again shell

bash-5.0.0-r0 webpage:
https://www.gnu.org/software/bash/bash.html

bash-5.0.0-r0 installed size:
1200128
like image 84
Adiii Avatar answered Sep 18 '22 02:09

Adiii