AlpineLinux 3.6: Enable apk community repository

This article will describe how to enable apk community repository. emacs package is in apk community repository.

1 Enable apk community repository

By default, community repository is comment out.

# cat /etc/apk/repositories
#/media/cdrom/apks
http://dl-cdn.alpinelinux.org/alpine/v3.6/main
#http://dl-cdn.alpinelinux.org/alpine/v3.6/community
#http://dl-cdn.alpinelinux.org/alpine/edge/main
#http://dl-cdn.alpinelinux.org/alpine/edge/community
#http://dl-cdn.alpinelinux.org/alpine/edge/testing

Delete comment out and enable community repository.

# sed -e 's;^#http\(.*\)/v3.6/community;http\1/v3.6/community;g' \
      -i /etc/apk/repositories
# apk update

2 Install emacs from apk community repository

After enabling apk community repository, emacs can be installed by apk add.

# apk add emacs