In my first Alpine Linux post I had mentioned why I began using Alpine Linux. Container technologies was the reason for me to use this distro. I have enough experience about vm virtualization, but have no experience about application virtualization. Anyway, let’s return the main topic.
Installing a new package seems easy, somehow I couldn’t install it. I updated the OS, and tried to install the docker package, but no luck. By the way to install docker on your Alpine Linux is used the given command.
apk add docker
Once I typed the above code I got the following error.
ERROR: unable to select packages:
docker (no such package):
required by: world[docker]
I googled it, and couldn’t find any solution. Lucilly I found the solution easily due to previous Linux experiences. I visited the packages menu on official alpine linux website and search the docker, and saw that docker is contained on the community repository, then checked my repository on Alpine Linux.
Ref : Alpine Linux packages https://pkgs.alpinelinux.org/packages

You can also check yours with the following command.
tail -f /etc/apk/repositories

As you see I only use the main repository and docker is not available on this repository. You have to modify this file and remove # at the beginning of the community link, then run the update command.

Removing the # character of the beginning of the community link solved my problem, but you can also remove the others. It helps you not to get ERROR: unable to select packages error while installing a package. Mine was just an example. Don’t forget to check it out what was written on Linux category on my website.
Thanks for your time reading.
Regars,
Hasan
Thank you! I much appreciated the quick fix.
Thanks Hasan
REALLY THANK YOU! You saved me.
thank you for the tip!!!
Awesome, thank you. I had the same issue and as beginner, I would have struggled to figure that out
Thx a lot
Thank you this exactly what I needed to fix my issue
it works ! thanks , i tried more than 10 methods .
Thank you very much :)