2022-07-31 15:59:52 +03:00
|
|
|
|
---
|
|
|
|
|
title: "Установить пакет из edge в Alpine Linux"
|
|
|
|
|
date: 2022-07-31T15:38:09+03:00
|
|
|
|
|
draft: false
|
|
|
|
|
tags: [linux, tips, alpine linux]
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Пердисловие
|
|
|
|
|
|
|
|
|
|
Стало мне необходимо обновить язык программирования Crystal до версии 1.5.0.
|
|
|
|
|
|
|
|
|
|
Имеем версию дистрибутива **3.16**:
|
|
|
|
|
```sh
|
|
|
|
|
cat /etc/os-release
|
|
|
|
|
NAME="Alpine Linux"
|
|
|
|
|
ID=alpine
|
|
|
|
|
VERSION_ID=3.16.0
|
|
|
|
|
PRETTY_NAME="Alpine Linux v3.16"
|
|
|
|
|
HOME_URL="https://alpinelinux.org/"
|
|
|
|
|
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
[Crystal](https://crystal-lang.org/)
|
|
|
|
|
[1.5.0](https://pkgs.alpinelinux.org/package/edge/community/x86_64/crystal) лежит в edge,
|
|
|
|
|
а в Alpine Linux 3.16 на момент напиcания статьи версия пакета
|
|
|
|
|
[1.4.1](https://pkgs.alpinelinux.org/package/v3.16/community/x86_64/crystal).
|
|
|
|
|
|
|
|
|
|
## Добавляем новый репозиторий и устанавливаем (обновляем) пакет
|
|
|
|
|
|
|
|
|
|
Списки репозиториев хранятся в файле `/etc/apk/repositories`:
|
|
|
|
|
```sh
|
|
|
|
|
cat /etc/apk/repositories
|
|
|
|
|
https://dl-cdn.alpinelinux.org/alpine/v3.16/main
|
|
|
|
|
https://dl-cdn.alpinelinux.org/alpine/v3.16/community
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Добавляем новый:
|
|
|
|
|
```sh
|
|
|
|
|
echo "@edge https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Подробнее здесь - [Repository pinning](https://wiki.alpinelinux.org/wiki/Package_management#Repository_pinning).
|
|
|
|
|
|
|
|
|
|
Можно указать ссылку на репозиторий через параметр `--repository`:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
apk add librdkafka --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Проблемы
|
|
|
|
|
|
|
|
|
|
В моём случае всё не так просто, потому что необходимо обновить ещё
|
|
|
|
|
[llvm14-libs](https://pkgs.alpinelinux.org/package/edge/main/aarch64/llvm14-libs).
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
apk add crystal@edge
|
|
|
|
|
ERROR: unable to select packages:
|
|
|
|
|
so:libLLVM-14.so (no such package):
|
|
|
|
|
required by: crystal-1.5.0-r0[so:libLLVM-14.so]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Устанавливаем:
|
|
|
|
|
```sh
|
|
|
|
|
apk add llvm14-libs --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main
|
|
|
|
|
apk add crystal@edge
|
|
|
|
|
(1/2) Upgrading crystal@edge (1.4.1-r0 -> 1.5.0-r0)
|
|
|
|
|
(2/2) Purging llvm13-libs (13.0.1-r2)
|
2022-08-13 09:10:36 +03:00
|
|
|
|
apk add shards@edge
|
|
|
|
|
(1/2) Installing yaml (0.2.5-r0)
|
|
|
|
|
(2/2) Installing shards@edge (0.17.0-r0)
|
2022-07-31 15:59:52 +03:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
crystal -v
|
|
|
|
|
Crystal 1.5.0 (2022-07-15)
|
|
|
|
|
|
|
|
|
|
LLVM: 14.0.6
|
|
|
|
|
Default target: x86_64-alpine-linux-musl
|
|
|
|
|
```
|