Skip to content

Commit 1338cf1

Browse files
author
kencx
committed
til 20260413
1 parent 9fb205c commit 1338cf1

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
+++
2+
title = "How to use lax pinning in Alpine Linux"
3+
date = "2026-04-13"
4+
updated = "2026-04-13"
5+
6+
[taxonomies]
7+
tags = ["alpine linux"]
8+
+++
9+
10+
To pin the version to a major or minor release in `apk` (i.e. fuzzy matching):
11+
12+
```sh
13+
# matches 3.X.Y-rZ
14+
apk add 'openssl=~3'
15+
16+
# matches 3.5.Y-rZ
17+
apk add 'openssl=~3.5'
18+
19+
# matches 3.5.1-rZ
20+
apk add 'openssl=~3.5.1'
21+
```
22+
23+
By default, `apk add` will avoid changing installed packages unless required.
24+
This means if the installed version of `openssl` is `3.5.1`, and we run `apk add
25+
openssl=~3.5` it will not be upgraded to `3.5.2` if its available.
26+
27+
To upgrade to the latest installable version (eg. `3.5.2`), we must use `apk add
28+
--upgrade openssl=~3.5`.
29+
30+
## References
31+
- [apk - Package Pinning](https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper#Package_pinning)
32+
- [apk-add](https://man.archlinux.org/man/apk-add.8.en)

0 commit comments

Comments
 (0)