7

I've been reading the man pages for apk add, but I don't fully understand how to use the --force-broken-world flag.

I was trying to install Python 2.7.6 into an Alpine image, but I got the following error.

$ docker run --rm -it alpine:latest apk add --no-cache python=2.7.6
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  python2-2.7.14-r2:
    breaks: world[python=2.7.6]

However, I can force install it, but I'm not certain what, if anything, it is doing.

$ docker run --rm -it alpine:latest apk add --force-broken-world --no-cache python=2.7.6
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
OK: 4 MiB in 11 packages

From the command line, everything looks good. However, when you do this inside the container, python doesn't seem to be installed.

$ docker run --rm -it alpine:latest /bin/ash
# apk add --force-broken-world --no-cache python=2.7.6
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
OK: 4 MiB in 11 packages
# python --version
/bin/ash: python: not found
# find / -name ash
/bin/ash
# find / -name python
#

So the question is, what exactly does the --force-broken-world flag do, and what other steps will I need to take to repair my broken world?

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
Zak
  • 12,213
  • 21
  • 59
  • 105

0 Answers0