docker setup postgis error missing repository - django

setting up django with docker, the docker file looks like this
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
RUN apt-get update
RUN apt-get install software-properties-common --yes
RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable
RUN apt-get update
RUN apt-get install postgis
WORKDIR /code
COPY . /code/
RUN pip install -r requirements.txt
among other things it sets up postgis using the ppa ubuntugis
however it throws this error while setting up
Step 5/11 : RUN apt-get install software-properties-common --yes
---> Using cache
---> 634a13159403
Step 6/11 : RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable
---> Using cache
---> 983fbcf8fd46
Step 7/11 : RUN apt-get update
---> Running in aaf66c98507c
Ign:1 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco InRelease
Hit:2 http://security.debian.org/debian-security stretch/updates InRelease
Ign:3 http://deb.debian.org/debian stretch InRelease
Ign:4 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco Release
Hit:5 http://deb.debian.org/debian stretch-updates InRelease
Hit:6 http://deb.debian.org/debian stretch Release
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Ign:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Err:7 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main amd64 Packages
404 Not Found
Ign:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco/main all Packages
Reading package lists...
W: The repository 'http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu disco Release' does not have a Release file.
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu/dists/disco/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update' returned a non-zero code: 100
it fails to find the repo even though this is how it's intended to be installed without using docker.
This is using a django projects that works locally and now making it work through docker is the new challenge.

Related

Building Docker image : ''Unable to locate package libxcb-util1''

I am trying to build a Docker image but when I build it, I get the error message : 'E: Unable to locate package libxcb-util1'.
Here is my Dockerfile :
`# $DEL_BEGIN`
FROM python:3.9.7-buster
WORKDIR /prod
COPY design_interface design_interface
COPY requirements.txt requirements.txt
COPY setup.py setup.py
RUN pip install --upgrade pip
RUN apt-get update && apt install --assume-yes apt-utils
RUN apt-get update && pip install .
RUN apt-get update && pip install opencv-python
RUN apt-get update && apt install --assume-yes libxcb-icccm4
RUN apt-get update && apt install --assume-yes libxcb-image0
RUN apt-get update && apt-get install libxcb-util1
CMD ["python3","design_interface/MainWindow.py"]
`# $DEL_END`
The error message is :
Step 11/12 : RUN apt-get update && apt-get install libxcb-util1
---> Running in a6000629d968
Hit:1 http://deb.debian.org/debian buster InRelease
Hit:2 http://security.debian.org/debian-security buster/updates InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libxcb-util1
The command '/bin/sh -c apt-get update && apt-get install libxcb-util1' returned a non-zero code: 100
What is more difficult to understand is why the command line 'sudo apt-get update && apt-get install libxcb-util1' works well on my computer but does not work when building the Docker image with the Dockerfile.
The only solution that I found was to download the file online, and then put it manually in the project repository : design_interface/libxcb-util1_0.4.0-0ubuntu3_amd64.deb.
Then I added in the dockerfile the line : RUN dpkg -i design_interface/libxcb-util1_0.4.0-0ubuntu3_amd64.deb.
It worked. :)
According to https://packages.debian.org/search?keywords=libxcb-util1, the package libxcb-util1 exists in bullseye, bookworm, and sid. You are apparently using buster. Buster only has libxcb-util0: https://packages.debian.org/search?keywords=libxcb-util0

The repository ... does not have a Release file (Maxmind)

I am following this tutorial: Maxmind GeoLite2 & GeoIP Database Auto-Update | 2020
I launched an Ec2 AWS instance with the mautic application (debian 10).
I'm trying to install Geolip Maximind on my instance but without success.
Here are the problems:
When I execute the command add-apt-repository ppa:maxmind/ppa
I get the result:
More info: https://launchpad.net/~maxmind/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpxsjdtonq/pubring.gpg' created
gpg: /tmp/tmpxsjdtonq/trustdb.gpg: trustdb created
gpg: key DE1997DCDE742AFA: public key "Launchpad PPA for MaxMind" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no valid OpenPGP data found.
When I execute the command apt update
I get the result:
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://cdn-aws.deb.debian.org/debian buster InRelease
Hit:3 http://cdn-aws.deb.debian.org/debian buster-updates InRelease
Hit:4 http://cdn-aws.deb.debian.org/debian buster-backports InRelease
Ign:5 http://ppa.launchpad.net/maxmind/ppa/ubuntu impish InRelease
Err:6 http://ppa.launchpad.net/maxmind/ppa/ubuntu impish Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/maxmind/ppa/ubuntu impish 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.
I didn't think it was useful to continue the tutorial because of these errors. I need your precious help to correct them.
If you are running Debian then you just have to install geoip-bin and geoip-database and for the updates you install geoipupdate. They are all in the standard apt repository.
You do not need to add the maxmind repository.
apt install geoip-bin geoip-database geoipupdate
Note that depending what you plan to do you may need also other packages for your perl php lua apache lighttp etc ... Since you don't want to tell us what you have in mind, I can't tell you more than that.
There are several packages there ...
root#linux:~# apt policy geoipupdate
geoipupdate:
Installiert: 3.1.1-1
Installationskandidat: 3.1.1-1
Versionstabelle:
*** 3.1.1-1 500
500 http://ftp.debian.org/debian buster/contrib amd64 Packages
100 /var/lib/dpkg/status
2.5.0-1~bpo9+1 100
100 http://ftp.debian.org/debian stretch-backports/contrib amd64 Packages
2.3.1-1 500
500 http://ftp.debian.org/debian stretch/contrib amd64 Packages
The standard apt repositories are :
deb http://ftp.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.debian.org/debian/ buster main non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main non-free
deb http://ftp.debian.org/debian buster-backports main contrib
deb-src http://ftp.debian.org/debian buster-backports main contrib
add them to your /etc/apt/sources.list and then try again

WSO2 API Manager installation : Apt install unable to locate package wso2am-3.2.0

I used WSO2 in the past, v2.6.0. I installed it through their debian repository on a Debian 9 machine, and it worked well.
Now I want to install their new 3.2.0 stable version on a Debian 9 machine, so I followed their guidelines here : https://wso2.com/api-management/install/apt/get-started/
Unfortunately, the apt install command fails and I don't understand why :
apt update && apt install wso2am-3.2.0
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://security.debian.org/debian-security stretch/updates InRelease
Hit:3 http://deb.debian.org/debian stretch Release
Ign:4 https://dl.bintray.com/wso2/deb am_320 InRelease
Get:5 https://dl.bintray.com/wso2/deb am_320 Release [1,897 B]
Hit:5 https://dl.bintray.com/wso2/deb am_320 Release
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package wso2am-3.2.0
E: Couldn't find any package by glob 'wso2am-3.2.0'
E: Couldn't find any package by regex 'wso2am-3.2.0'
Here is my Debian version :
lsb_release -a
Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch
And my /etc/apt/sources.list file :
cat /etc/apt/sources.list
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb https://dl.bintray.com/wso2/deb am_320 release
I tried with http only, but I got the same error. Any idea?
Thanks.
Could you please try again these steps?
apt-get update
apt-get install wso2am-3.2.0
Now it will work since we fixed some problems with the installer and sorry for the inconvenience.

How to install python-mysqldb for Python 2.7 in Ubuntu 20.04 (Focal Fossa)?

I've tried "apt-get install python-mysqldb" which results in:
root#ps1svr:~# apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-mysqldb 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 'python-mysqldb' has no installation candidate
Note: "apt-get install python3-mysqldb" works, however I have a lot of code written for Python 2.x which no longer runs, and this is causing enough problems that I'm probably going to have to reinstall Ubuntu 18.04
Also you can just add the Ubuntu 18.04 repositoery to install the python-mysqldb package:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
sudo apt update
sudo apt install -y python-mysqldb
This will download, build and install it for all users, using pip
sudo apt install libmysqlclient-dev python2.7-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python2.7 get-pip.py
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h
sudo pip2 install MySQL-python
Answer found from MySQLdb install error - _mysql.c:44:23: error: my_config.h: No such file or directory

Error while installing libapache2-mod-wsgi on linux

easy_install libapache2-mod-wsgi
No local packages or download links found for libapache2modwsgi
error: Could not find suitable distribution for Requirement.parse('libapache2mod wsgi')
libapache2-mod-wsgi is not a python package. You should install it via your distribution package manager. For example, if you are in a debian based distribution:
sudo apt-get install libapache2-mod-wsgi
Or if you are working with Python 3
sudo apt-get install libapache2-mod-wsgi-py3