Install libboost have error"Sub-process /usr/bin/dpkg returned an error code (1)"

When I run

FROM  gcc:13.1.0

RUN apt-get -qq update
RUN apt-get -qq upgrade
RUN apt-get -qq -y install cmake

RUN apt-get install -y libboost-all-dev
RUN apt-get -qq install build-essential libtcmalloc-minimal4 && \ 
    ln -s /usr/lib/ /usr/lib/

I have an error:

#0 109.5 Errors were encountered while processing:
#0 109.5  gfortran
#0 109.5  libcoarrays-dev:amd64
#0 109.5  libcoarrays-openmpi-dev:amd64
#0 109.5 E: Sub-process /usr/bin/dpkg returned an error code (1)

How can I fix it?

I think you have the same issue but with a newer image.

They say if you need gfortran you should use a debian image as base instead of gcc.

I fix it but do not change gcc. I change the code from RUN apt-get install -y libboost-all-dev to RUN apt-get install -y libboost-all-dev --no-install-recommends. It works.

Ákos Takács via Docker Community Forums <> 于2023年5月21日周日 06:23写道:

Thank you for reporting back. Yes, --no-install-recommends is recommended to use in Dockerfile. I didn’t notice the lack of it. Good that you found it out and even better that it helped.

Are you also learning web server and APIs? If so, I hope to communicate some questions with you.

Ákos Takács via Docker Community Forums <> 于2023年5月21日周日 19:00写道:

No, I am not learning that.