Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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 ?

like image 351
Sakolzer Avatar asked Oct 19 '25 05:10

Sakolzer


1 Answers

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.

like image 128
yamenk Avatar answered Oct 20 '25 20:10

yamenk