-2

For compatibility, I need to use this old image but even after installing software-properties-common both commands are not found: apt-add-repository or add-apt-repository All I could find was to install software-properties-common but that does not help either.

FROM ubuntu:precise

Set environment variables to avoid interactive prompts during package installation

ENV DEBIAN_FRONTEND=noninteractive

RUN sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Update package lists and install basic packages

RUN apt-get update &&
apt-get upgrade -y &&
apt-get install -y
sudo
curl
vim
wget
git
nano
software-properties-common
build-essential &&
rm -rf /var/lib/apt/lists/*

Start a shell by default when the container starts

CMD ["/bin/bash"]

Genom
  • 65

1 Answers1

0

By chance, I saw this answer after a minute of posting my question: https://askubuntu.com/a/593437/909989 Basically, for older releases python-software-properties needs to be installed.

Genom
  • 65