AlpineLinux 3.8: 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://mirror.xtom.com.hk/alpine/v3.8/main
#http://mirror.xtom.com.hk/alpine/v3.8/community
#http://mirror.xtom.com.hk/alpine/edge/main
#http://mirror.xtom.com.hk/alpine/edge/community
#http://mirror.xtom.com.hk/alpine/edge/testing

Delete comment out and enable community repository.

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

2 Install emacs from apk community repository

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

$ sudo apk add emacs