1

I am trying to add a newer gcc toolchain to my docker image (based upon ubuntu:20.04). I am following the steps from this article.
In the docker's bash I run:

add-apt-repository ppa:ubuntu-toolchain-r/ppa
apt update

But when I try to install gcc-13 g++13 I get:

E: Unable to locate package gcc-13
E: Unable to locate package g++13

I can see that the list of published packages mention gcc-13 though.

Here's the full console:

root@c8f34012b930:/app# add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
Get:1 http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu focal InRelease [23.8 kB]
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease                                           
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu focal/main amd64 Packages [51.5 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease  
Fetched 189 kB in 1s (188 kB/s)
Reading package lists... Done
root@c8f34012b930:/app# apt update
Hit:1 http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease                                       
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@c8f34012b930:/app# apt install gcc-13 g++-13
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-13
E: Unable to locate package g++-13

My docker file:

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

# Install SSH server
RUN apt-get update && apt-get install -y openssh-server

# Configure SSH
RUN mkdir /var/run/sshd
RUN echo 'root:youcantseeme' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
EXPOSE 22

# C++ dev tools & libs
RUN apt-get update && \
    apt-get install -y software-properties-common && \
    apt-get install -y build-essential gcc gdb gdbserver ninja-build cmake \
        libasio-dev libssl-dev libgtest-dev python3 python3-pip && \
    apt-get clean && \
    pip install pytest

WORKDIR /app
VOLUME /app/build
VOLUME /app/install

# Start SSH server
ENTRYPOINT service ssh restart && bash

Am I missing something?

3

0

You must log in to answer this question.

Browse other questions tagged .