Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Linux by (18.4k points)

When running this alpine docker container the first time and attempting an OpenSSH install, the following happens:

[email protected]:~$ docker run -it --rm alpine /bin/ash

/ # apk add openssh

WARNING: Ignoring APKINDEX.d3812b7e.tar.gz: No such file or directory

WARNING: Ignoring APKINDEX.bb2c5760.tar.gz: No such file or directory

ERROR: unsatisfiable constraints:

  openssh (missing):

    required by: world[openssh]

How can OpenSSH be installed?

1 Answer

0 votes
by (36.8k points)

You need to Run the apk update first. The below paste contains the complete example:

    [email protected]:~$ docker run -it --rm alpine /bin/ash

    / # apk update

    fetch http://dl-4.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz

    fetch http://dl-4.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz

    v3.3.1-97-g109077d [http://dl-4.alpinelinux.org/alpine/v3.3/main]

    v3.3.1-59-g48b0368 [http://dl-4.alpinelinux.org/alpine/v3.3/community]

    OK: 5853 distinct packages available

    / # apk add openssh

    (1/3) Installing openssh-client (7.1_p2-r0)

    (2/3) Installing openssh-sftp-server (7.1_p2-r0)

    (3/3) Installing openssh (7.1_p2-r0)

    Executing busybox-1.24.1-r7.trigger

    OK: 8 MiB in 14 packages

Want to be a Linux expert? Come and join this Linux course

 

Related questions

0 votes
1 answer
asked Dec 25, 2020 in Linux by blackindya (18.4k points)
0 votes
1 answer
0 votes
1 answer
asked Dec 10, 2020 in Linux by blackindya (18.4k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...