Up until this morning, building my container was a smooth process, now I'm running into some issues with apt get -y mongodb.
I have a very simple Dockerfile, relevant code posted since this is all that is needed to make reproduce the issue.
FROM python:2.7
RUN apt-get update && \
apt-get -y install \
gpg \
mongodb \
I've researched some fixes but they seem a little overboard, should I just change my base image? I'm trying to understand the cause behind this error and how to future proof it.
Note, I forgot to put the trace.
Sending build context to Docker daemon 1.354GB
Step 1/7 : FROM python:2.7
2.7: Pulling from library/python
5ae19949497e: Pull complete
ed3d96a2798e: Pull complete
f12136850781: Pull complete
1a9ad5d5550b: Pull complete
6f18049a0455: Pull complete
900d7861659d: Pull complete
536c9e631831: Pull complete
cb522be31b83: Pull complete
d03d3d7b603d: Pull complete
Digest: sha256:ee76dd856d06bdd734e1c3c816b243c984586629708f0a3e32038f94a891a5d8
Status: Downloaded newer image for python:2.7
---> 3edf9092825f
Step 2/7 : RUN apt-get update && apt-get -y install gpg mongodb curl
---> Running in 870a931ec60c
Get:1 http://security.debian.org/debian-security buster/updates InRelease [39.1 kB]
Get:2 http://deb.debian.org/debian buster InRelease [118 kB]
Get:3 http://security.debian.org/debian-security buster/updates/main amd64 Packages [11.9 kB]
Get:4 http://deb.debian.org/debian buster-updates InRelease [46.8 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7897 kB]
Fetched 8113 kB in 4s (1805 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package mongodb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mongodb' has no installation candidate
The command '/bin/sh -c apt-get update && apt-get -y install gpg mongodb curl' returned a non-zero code: 100
I guess you delete the old python:2.7 image and rebuild your dockerfile or just change another pc to do the build. If you use a new image, you can see next:
orange#orange:~$ docker images python:2.7
REPOSITORY TAG IMAGE ID CREATED SIZE
python 2.7 3edf9092825f 8 hours ago 884MB
It shows the image was created 8 hours ago, so the image used is quite different compared the one you used days ago.
From this, if you do a search for python:2.7, you may see it now same with 2.7.16-buster, as you know, debian buster released a few days ago, see this:
2019-07-06: Initial release: 10.0 (press release)
So I guess days ago, the python:2.7 is based on debian stretch, so in new debian release, some packages removed which results in your failure.
Best practice:
You can see there are Simple Tags & Shared Tags in python dockerhub repo, please use Simple Tags which will not always change, don't use Shared Tags which may tag to other image id later, for your case, use python:2.7.16-stretch. In fact this base image is the one you used in the past which tagged as python:2.7, the one now which tagged as python:2.7 is not the one you used in the past.
Related
I'm following the instructions for Building From Source at https://pillow.readthedocs.io/en/stable/installation.html#building-from-source for building on Debian Linux. Pillow seems to work fine on my system after I follow these steps, but it doesn't seem to be really building from source.
$ git clone https://github.com/python-pillow/Pillow.git
Cloning into 'Pillow'...
remote: Enumerating objects: 67869, done.
remote: Counting objects: 100% (163/163), done.
remote: Compressing objects: 100% (95/95), done.
remote: Total 67869 (delta 90), reused 128 (delta 68), pack-reused 67706
Receiving objects: 100% (67869/67869), 83.17 MiB | 9.39 MiB/s, done.
Resolving deltas: 100% (50202/50202), done.
$ sudo apt-get install python3-dev python3-setuptools
[sudo] password for dan:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-dev is already the newest version (3.9.2-3).
python3-setuptools is already the newest version (52.0.0-4).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Remove all the source files from libImaging directory to prove its not building from source:
$ cd Pillow
$ rm ./src/libImaging/*
Continue to follow the Building From Source instructions at https://pillow.readthedocs.io/en/stable/installation.html#building-from-source for Debian Linux:
$ python3 -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /home/dan/.local/lib/python3.9/site-packages (22.3.1)
$ python3 -m pip install --upgrade Pillow --no-binary :all:
Defaulting to user installation because normal site-packages is not writeable
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Collecting Pillow
Using cached Pillow-9.3.0.tar.gz (50.4 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: Pillow
DEPRECATION: Pillow is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451
Running setup.py install for Pillow ... done
Successfully installed Pillow-9.3.0
Pillow works on my system, but as I removed a large number of source files, it doesn't appear that I'm really building from source. The output says "Using cached Pillow-9.3.0.tar.gz" which implies it isn't using what I cloned. I think I'm following the all directions. Did I do something wrong or are the directions incomplete?
I built the latest Pillow from source inside a dockerized debian:latest like this:
# Start debian:latest docker
docker run -it debian:latest
# Install all the junk you need and upgrade pip
apt update && apt install git python3-dev python3-setuptools python3-pip cmake libjpeg-dev
python3 -m pip install --upgrade pip # this line MAY not be strictly necessary
# Clone PIL/Pillow from Github
git clone https://github.com/python-pillow/Pillow.git
# Install from source
cd Pillow
python3 -m pip install .
I am trying to install MongoDB 4.4 on a Raspberry Pi 4 model B running Raspberry Pi OS 64 bits.
I would like to know the proper way to add the depository:
https://repo.mongodb.org/apt/debian/dists/buster/mongodb-org/4.4/
I believe it should be inserted in this folder:
/etc/apt/sources.list.d/
But I can't find the correct manner to do it.
I tried a few options, one being creating a file mongodb-org-4.4.list in the /etc/apt/sources.list.d directory containing this:
deb https://repo.mongodb.org/apt/debian/ buster main
But nothing worked. I always get some error message when running:
apt update
Something like:
Reading package lists... Done
E: The repository 'https://repo.mongodb.org/apt/debian buster Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
........
Further information:
If I set the contents of /etc/apt/sources.list.d/mongodb-org-4.4.list to:
deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main
as recommended in the document Install MongoDB Community Edition on Debian.
This is the result of running apt-get update :
root#raspberrypi:/home/pi#
root#raspberrypi:/home/pi# apt-get update
Hit:1 http://deb.debian.org/debian buster InRelease
Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Ign:4 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 InRelease
Hit:5 http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 Release
Hit:6 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 InRelease' doesn't support architecture 'armhf'
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 InRelease' doesn't support architecture 'arm64'
root#raspberrypi:/home/pi#
If someone knows how to solve this please let me know.
Follow instructions in https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/, specifically the part about adding keys.
There are no prebuilt packages for arm on Debian. https://www.mongodb.com/download-center/community/releases/archive does provide arm64 on Ubuntu 16.04.
Seems there is an issue while installing pgadmin4 for postgress db. I tried to follow these instructions but at the end I get
Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'
Does anybody know what is the issue ?
I am using Pop Os 20.04
Ubuntu expects repositories to have all architectures by default. As there are no packages for i386 this results in the error you're seeing.
To fix this, you have to tell apt which architectures to expect, so your pgdg.list should look like this:
deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt NAME-pgdg main
NAME would be the output of lsb_release -cs.
Note 2020-05-05: Judging from your distro name, it's based on Ubuntu 20.04. There are no pgAdmin4-packages for focal yet. Installing from the eoan repo fails because of missing libpython3.7 :(
You need to edit your pgdg.list file in /etc/apt/sources.list
there is a line in the file thats says : deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
change it to deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main save the file and all you have to do now is a : sudo apt update && sudo apt upgrade
There are some dependency problems while installing postgresql-10-postgis-2.5 on Ubuntu Xenial (16.04) after 2.5.3 version (which is published to PostgreSQL Apt Repo a couple days ago). The reason is that now postgresql-10-postgis-2.5 (version 2.5.3+dfsg-2.pgdg16.04+1) requires libgeos-c1v5 (>= 3.7.0) but the latest version of libgeos-c1v5 is 3.5.0-1ubuntu2 for Ubuntu Xenial (https://packages.ubuntu.com/search?keywords=libgeos-c1v5). I can upgrade to bionic (18.04 LTS) but the same problem exists since it brings version 3.6.2. 19.04 is not an option for me at the moment.
Is there a way to install libgeos-c1v5 >= 3.7.0 or install postgresql-10-postgis-2.5 2.5.2 on Ubuntu Xenial (16.04) using apt?
The steps to reproduce it locally on a Docker container:
docker run -it ubuntu:xenial /bin/bash
apt update
apt install -y curl
echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt update
apt install postgresql-10-postgis-2.5 postgresql-10-postgis-2.5-scripts
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
postgresql-10-postgis-2.5 : Depends: libgeos-c1v5 (>= 3.7.0) but 3.5.0-1ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
We faced similar issue with Ubuntu 18 when trying to install postgresql-9.6-postgis-2.5. We had to install the experimental version 3.7 to get it working.
libgeos-3.7.0_3.7.0-1_bionic0_amd64
libgeos-c1v5_3.7.0-1_bionic0_amd64.deb
https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-experimental/+build/15675841
However, I'm not sure if you can get this for xenial.
Hope this helps, thanks.
Update:
We now have the updated version of libgeos in bionic repo, hope the updated version was released for xenial as well, thanks.
apt search libgeos-3.7
Sorting... Done
Full Text Search... Done
libgeos-3.7.1/bionic-pgdg 3.7.1-1~pgdg18.04+1 amd64
Geometry engine for Geographic Information Systems - C++ Library
libgeos-3.7.1-dbgsym/bionic-pgdg 3.7.1-1~pgdg18.04+1 amd64
debug symbols for libgeos-3.7.1
I'm trying to install Visual studio code.
My Raspb. Version is:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.8 (stretch)
Release: 9.8
Codename: stretch
I tried several method (starting to download .deb and using dpkg or install command) but nothing worked.
How can I fix this problem? I really need VSC because my project is growing and Geany messes up.
Downloaded .deb and .tar files from the official site, followed the setup instruction but I got this error
With dpkg (both 32 and 64bit):
"package architecture (amd64) does not match system (armhf)"
"package architecture (i386) does not match system (armhf)"
With sudo install:
sudo apt install ./code_1.33.1-1554971066_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'code:amd64' instead of './code_1.33.1-1554971066_amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
code:amd64 : Depends: libnotify4:amd64 but it is not installable
Depends: libnss3:amd64 (>= 2:3.26) but it is not installable
Depends: apt:amd64 but it is not installable
Depends: libxkbfile1:amd64 but it is not installable
Depends: libsecret-1-0:amd64 but it is not installable
Depends: libgtk-3-0:amd64 (>= 3.10.0) but it is not installable
Depends: libxss1:amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.
With repository:
pi#raspberrypi:~/Downloads $ sudo apt-get update
Err:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Temporary failure resolving 'raspbian.raspberrypi.org'
Err:2 http://archive.raspberrypi.org/debian stretch InRelease
Temporary failure resolving 'archive.raspberrypi.org'
Err:3 https://packages.microsoft.com/repos/vscode stable InRelease
Could not resolve host: packages.microsoft.com
Reading package lists... Done
W: Failed to fetch http://raspbian.raspberrypi.org/raspbian/dists/stretch/InRelease Temporary failure resolving 'raspbian.raspberrypi.org'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/stretch/InRelease Temporary failure resolving 'archive.raspberrypi.org'
W: Failed to fetch https://packages.microsoft.com/repos/vscode/dists/stable/InRelease Could not resolve host: packages.microsoft.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
pi#raspberrypi:~/Downloads $ sudo apt-get install code
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package code
I'm getting mad about this problem, I tried older repository but they don't work.
There are Community builds of Visual Studio Code available (for Raspberry Pi and other ARM and Intel systems).
The packages are currently available in DEB and RPM format. You can use the scripts provided here to install the packages and add their repository to your system or install it manually.
Below I summarized the steps:
Open a new terminal. If you need super-user rights (you probably do), then you can enter sudo -s and press return to enter a super-user session. Run the installer for your current distribution:
APT instructions
(including Debian, Raspbian, Ubuntu and Linux Mint)
. <( wget -O - https://code.headmelted.com/installers/apt.sh )
Press the return key. Once the installer has completed, you should have a "Code - OSS" entry in your desktop program list.
Manual installation
If for any reason the script above will not work on your system, or you do not want to add the package source for updates, you can get the latest version of the package for your system below.
Public GPG key
For either APT or YUM installation, you'll want the public GPG key to verify the package, which you can download here.
APT and YUM packages
The latest packages are available directly from the PackageCloud releases page.
The specific package you need is available here.
EDIT:
At this time (29.04.2019) the current release (v. 1.32) appears not to be working for everybody. See: issue#64. Seems that you'll have to go back to v. 1.29, which is reported to be running fine.
You can choose this package and install it manually, or use APT. If you decide to install it via APT, note that you'll have to mark the package on hold as described below.
To prevent code-oss from upgrading (so that you can keep v. 1.29 until the issue is fixed) follow these instructions:
Install v. 1.29 via APT:
apt-get install code-oss=1.29.0-1539702286
Then mark it on hold by running:
apt-mark hold code-oss
Now running apt-get upgrade won't try to bump it up until you run:
apt-mark unhold code-oss
This will allow it to upgrade again as usual.