Sakolzer
Sakolzer

Reputation: 495

"Unable to locate package" only inside a docker image

When I try to install APC inside my docker image with

apt-get update && apt-get install php-apcu

I get the message :

Unable to locate package php-apcu

But in my local machine the installation works perfectly. Did I miss something ?

Upvotes: 4

Views: 3223

Answers (1)

yamenk
yamenk

Reputation: 51738

You need to add the universe repository:

RUN apt-get update &&\
 apt-get install -y software-properties-common &&\
 add-apt-repository universe &&\
 apt-get install -y php-apcu

If you get a "Error: 'universe' invalid" then you need to use the full source line:

 sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

instead of "universe" in your apt-add-repository line.

Upvotes: 4

Related Questions