即使软件包回购网站上列出了Alpine Linux中缺少的软件包 [英] Package missing in Alpine Linux even though it's listed on package repo website

查看:137
本文介绍了即使软件包回购网站上列出了Alpine Linux中缺少的软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个使用GDAL和必要的Python钩子运行Alpine Linux的Docker容器:

  FROM python :3.6-alpine 

运行apk更新

运行apk添加py-gdal gdal

运行pip install uwsgi

运行mkdir / code
WORKDIR / code
COPY requirements.txt。

运行pip install -r requirements.txt

COPY。 。

CMD [ uwsgi,-ini, uwsgi.ini]

如您所见,我正在运行 apk更新语句来更新存储库,然后运行 apk添加语句以安装软件包。这是我收到的输出:

  / usr / bin / make -f / Users / some_guy / Workspace / tagging_tracker_backend / Makefile构建up 
Pulling nginx ...
Pulling db ...
Pulling web ...
db使用图像,跳过
构建nginx
步骤1 / 3:来自nginx:1.15
---> 7042885a156a
步骤2/3:运行rm /etc/nginx/conf.d/default.conf
--->使用缓存
---> 97782a5dae3a
步骤3/3:复制nginx.conf /etc/nginx/conf.d/tag.conf
--->使用缓存
---> 3158ab7993cd
成功构建3158ab7993cd
构建网络
成功标记tagging_tracker_backend_nginx:latest
步骤1/10:FROM python:3.6-alpine
---> de35df1f34dd
步骤2/10:运行apk更新
--->使用缓存
---> 15477d802b32
步骤3/10:运行apk添加py-gdal gdal
--->在77bef31e5d15中运行
错误:无法满足的约束:
gdal(缺失):
由以下人员要求:world [gdal]
py-gdal(缺失):
由以下人员要求: world [py-gdal]
服务'web'生成失败:命令'/ bin / sh -c apk add py-gdal gdal'返回非零代码:2
make:** * [build]错误1

处理完成,退出代码为2

两者这些软件包中的一个可以在 Alpine Linux软件包网站中找到。 p>

我不熟悉Alpine Linux,但是习惯于在其他类型的Linux上安装软件包。

解决方案

gdal 链接到的软件包位于边缘测试存储库中,而不是发行分支之一。要安装它,您必须专门指定该存储库。 gdal 也依赖Edge-main中的软件包,因此您也需要包括它。

  apk添加\ 
--no-cache \
-存储库http://dl-cdn.alpinelinux.org/alpine/edge/testing \
-存储库http://dl-cdn.alpinelinux.org/alpine/edge/main \
gdal


I am attempting to build out a Docker container that runs Alpine Linux with GDAL and the necessary Python hooks:

FROM python:3.6-alpine

RUN apk update

RUN apk add py-gdal gdal

RUN pip install uwsgi

RUN mkdir /code
WORKDIR /code
COPY requirements.txt .

RUN pip install -r requirements.txt

COPY . .

CMD ["uwsgi", "--ini", "uwsgi.ini"]

As you can see, I'm running both an apk update statement to update repos, and then apk add statements to install the packages. Here is the output I receive:

/usr/bin/make -f /Users/some_guy/Workspace/tagging_tracker_backend/Makefile build up
Pulling nginx ... 
Pulling db    ... 
Pulling web   ... 
db uses an image, skipping
Building nginx
Step 1/3 : FROM nginx:1.15
 ---> 7042885a156a
Step 2/3 : RUN rm /etc/nginx/conf.d/default.conf
 ---> Using cache
 ---> 97782a5dae3a
Step 3/3 : COPY nginx.conf /etc/nginx/conf.d/tag.conf
 ---> Using cache
 ---> 3158ab7993cd
Successfully built 3158ab7993cd
Building web
Successfully tagged tagging_tracker_backend_nginx:latest
Step 1/10 : FROM python:3.6-alpine
 ---> de35df1f34dd
Step 2/10 : RUN apk update
 ---> Using cache
 ---> 15477d802b32
Step 3/10 : RUN apk add py-gdal gdal
 ---> Running in 77bef31e5d15
ERROR: unsatisfiable constraints:
  gdal (missing):
    required by: world[gdal]
  py-gdal (missing):
    required by: world[py-gdal]
Service 'web' failed to build: The command '/bin/sh -c apk add py-gdal gdal' returned a non-zero code: 2
make: *** [build] Error 1

Process finished with exit code 2

Both of these packages can be found at the Alpine Linux package website.

I'm not familiar with Alpine Linux but am used to installing packages on other types of Linux. Is there another command that needs to be passed in here?

解决方案

The gdal package you linked to is in the edge-testing repository, not one of the release branches. To install it, you'd have to specifically specify that repository. gdal also has dependencies on packages in edge-main, so you need to include that, too.

apk add \
  --no-cache \
  --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
  --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
  gdal

这篇关于即使软件包回购网站上列出了Alpine Linux中缺少的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆