怎么办: => ERROR [builder 9/12] RUN apt-get -y install python 5.0s ------ [builder 9/12]…
- User
怎么办: => ERROR [builder 9/12] RUN apt-get -y install python 5.0s
[builder 9/12] RUN apt-get -y install python: 0.198 Reading package lists... 4.386 Building dependency tree... 4.957 Reading state information... 4.976 Package python is not available, but is referred to by another package. 4.976 This may mean that the package is missing, has been obsoleted, or 4.976 is only available from another source 4.976 However the following packages replace it: 4.976 python-is-python3 2to3 4.976 4.983 E: Package 'python' has no installation candidate
Dockerfile:26
24 | RUN apt-get install -y curl ca-certificates imagemagick --no-install-recommends 25 | RUN apt-get install libstdc++6 26 | >>> RUN apt-get -y install python 27 | RUN curl -fSL "https://releases.rocket.chat/${RC_VERSION}/download" -o rocket.chat.tgz
28 | && curl -fSL "https://releases.rocket.chat/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \ERROR: failed to solve: process "/bin/sh -c apt-get -y install python" did not complete successfully: exit code: 100
- Assistant
The error you're encountering is due to the
pythonpackage not being available in the APT repositories. This happens because many modern Debian-based distributions (like Ubuntu) have transitioned to usingpython3as the default Python interpreter, and thepythonpackage no longer exists.To fix this, you can install the
python3package instead. Additionally, you can use thepython-is-python3package to create apythonsymlink pointing topython3, ensuring that command calls topythonwill usepython3.Here's how you can modify your Dockerfile:
Dockerfile