How do I install libgit2 on Alipne linux

不羁岁月 提交于 2019-12-12 02:45:17

问题


I am new to Docker and trying to use an Alpine docker image for my project. I am getting the following error when I am try to build the project.

gopkg.in/libgit2/git2go.v22
# pkg-config --cflags libgit2
pkg-config: exec: "pkg-config": executable file not found in $PATH

I think I need to install libgit2 but I am not able to:

bash-4.3# apk add libgit2
ERROR: unsatisfiable constraints:
  libgit2 (missing):
    required by: world[libgit2]

Thanks for any help.

-dj


回答1:


libgit2 is not present in either of main or community repositories that come preconfigured in the standard Alpine image, so you'll have to add the testing repo first:

# echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories

Then update package caches:

# apk update

And finally install libgit2:

# apk add libgit2




回答2:


As of the start 2017 libgit2 has been added to the main repository. You should be able to install now with the usual

apk update
apk add libgit2

https://pkgs.alpinelinux.org/packages?name=libgit2



来源:https://stackoverflow.com/questions/36803993/how-do-i-install-libgit2-on-alipne-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!