New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-apt-repository issue in Ubuntu Trusty containers #5383

Closed
itwars opened this Issue Apr 24, 2014 · 13 comments

Comments

Projects
None yet
8 participants
@itwars
Copy link

itwars commented Apr 24, 2014

Hi,

I need to use ppa repo in a Ubuntu Trusty Container, using that bunch of commands

FROM ubuntu

RUN apt-get update
RUN apt-get -y dist-upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python-software-properties
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:chris-lea/node.js

And got this message at the very end:

/bin/sh: 1: add-apt-repository: not found

As I don't ask for a specific Ubuntu version it used the last one i.e.: Trusty. But if I ask:

FROM ubuntu:precise

Everything is OK!

Any concerns with Trusty?

Thx
Vincent

@tianon

This comment has been minimized.

Copy link
Member

tianon commented Apr 24, 2014

It looks like the script you're looking for moved from "python-software-properties" into "software-properties-common". Can you try installing "software-properties-common" instead and see if that helps?

@itwars

This comment has been minimized.

Copy link

itwars commented Apr 25, 2014

Hi tianon,

That's it! You solved my issue! But, on Ubuntu bare metal with only python-software-properties it does work?

Anyway 👍

 # Dockerfile for Nodejs

FROM ubuntu

MAINTAINER Vincent RABAH <xxxx@yyyy.com>

RUN apt-get update
RUN apt-get dist-upgrade -y

RUN DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python-software-properties
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:chris-lea/node.js
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs

@itwars itwars closed this Apr 25, 2014

@tianon

This comment has been minimized.

Copy link
Member

tianon commented May 5, 2014

I believe it changed in trusty (14.04), so unless your bare metal machines are also trusty, they would still have the command in the older package.

@note89

This comment has been minimized.

Copy link

note89 commented Nov 1, 2015

why dont you put
DEBIAN_FRONTEND=noninteractive
As and enviroment variable instead ?
ENV DEBIAN_FRONTEND=noninteractive

@thaJeztah

This comment has been minimized.

Copy link
Member

thaJeztah commented Nov 1, 2015

@Niler851 those ENV vars will persist in the image, and inherited by images using FROM theimage, which may lead to unexpected results (e.g. If I run the image interactively and no dialogs are shown, because it thinks it's run non-interactively)

@note89

This comment has been minimized.

Copy link

note89 commented Nov 1, 2015

Tnx you that is very good information. then i will change it in my container. tnx you

@borromeotlhs

This comment has been minimized.

Copy link

borromeotlhs commented Feb 11, 2016

So what is the resolution on this? install one or both of:
python-software-properties
software-properties-common

Or something else entirely?

@rotelando

This comment has been minimized.

Copy link

rotelando commented Mar 14, 2016

@borromeotlhs software-properties-common for newer versions of ubuntu (starting from 14.04). It worked for me. Been trying python-software-properties and it hasn't been working until I used that command

@ttibau

This comment has been minimized.

Copy link

ttibau commented May 31, 2016

what is DEBIAN_FRONTEND=noninteractive??

@thaJeztah

This comment has been minimized.

Copy link
Member

thaJeztah commented May 31, 2016

@ttibau it's an environment variable to tell installers that you're installing non-interactive; for example, some packages may normally show a pop up window asking for input; if you set that environment variable, the installer will use the default option, and don't ask / show the pop up.

@saady

This comment has been minimized.

Copy link

saady commented Jul 5, 2016

FROM ubuntu:14.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y \
    git-core \
    build-essential \
    gperf \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*


RUN apt-get install -y software-properties-common \
    && add-apt-repository ppa:maxmind/ppa \
    && apt-get update \
    && apt-get install libmaxminddb0 libmaxminddb-dev mmdb-bin

it gives me this message error

E: Unable to locate package software-properties-common

is there a way to keep only sources for software-properties-common because
&& rm -rf /var/lib/apt/lists/* remove all the sources.

@saady

This comment has been minimized.

Copy link

saady commented Jul 5, 2016

I tried this

`FROM ubuntu:14.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y \
    git-core \
    build-essential \
    gperf \
    && apt-get clean \
    #&& rm -rf /var/lib/apt/lists/*


RUN apt-get install -y software-properties-common \
    && add-apt-repository ppa:maxmind/ppa \
    && apt-get update \
    && apt-get install libmaxminddb0 libmaxminddb-dev mmdb-bin`

but it always gives /bin/sh: 1: add-apt-repository: not found

@ghost

This comment has been minimized.

Copy link

ghost commented Aug 9, 2016

@Niler851 those ENV vars will persist in the image, and inherited by images using FROM theimage, which may lead to unexpected results (e.g. If I run the image interactively and no dialogs are shown, because it thinks it's run non-interactively)

You could use ARG DEBIAN_FRONTEND=noninteractive instead of ENV. The ARG directive sets variables that only live during the build. I think this is what you're looking for.

https://docs.docker.com/engine/reference/builder/#/arg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment