Docker RUN apt-get install - Unable to locate package - dockerfile

I have a Dockerfile which is calling RUN apt-get install guile-2.0-dev
This script is executed from Ubuntu 20.04.4LTS using the command "sudo docker build -f./Dockerfile -ttest:one ./". It shows the error:
E: Unable to locate package guile-2.0-dev
E: Couldn't find any package by glob 'guile-2.0-dev'
E: Couldn't find any package by regex 'guile-2.0-dev'"
But other apt-get install commands called from Dockerfile works as expected. I am able to run apt-get install guile-2.0-dev command from my terminal. Can you please help me to figure out the reason for it fail inside the docker script?
A sample script is given below. Bison is installed successfully, but guile fails
FROM ubuntu
RUN apt-get update
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bison
RUN apt-get update && apt-get install -y guile-2.0-dev

Your Dockerfile pulls ubuntu which defaults to latest tag, which is jammy-jellyfish/22.04. guile-2.0-dev doesn't exist in that version, it was upgraded to guile-2.2-dev, so you'd want to do RUN apt-get update && apt-get install -y guile-2.2-dev.
FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bison guile-2.2-dev
If you specifically need guile-2.0-dev, you will need FROM ubuntu:focal (v20.04) or FROM ubuntu:bionic (v18.04) depending on what Ubuntu you want.
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bison guile-2.0-dev
Also see the ubuntu packages list: https://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=guile&searchon=names&release=all
Package guile-2.0-dev
bionic (18.04LTS) (lisp): Development files for Guile 2.0
2.0.13+1-5build2: amd64 arm64 armhf i386 ppc64el s390x
bionic-updates (lisp): Development files for Guile 2.0
2.0.13+1-5ubuntu0.1: amd64 arm64 armhf i386 ppc64el s390x
focal (20.04LTS) (lisp): Development files for Guile 2.0 [universe]
2.0.13+1-5.4: amd64 arm64 armhf i386 ppc64el s390x
Package guile-2.2-dev
bionic (18.04LTS) (lisp): Development files for Guile 2.2 [universe]
2.2.3+1-3build1: amd64 arm64 armhf i386 ppc64el s390x
bionic-updates (lisp): Development files for Guile 2.2 [universe]
2.2.3+1-3ubuntu0.1: amd64 arm64 armhf i386 ppc64el s390x
focal (20.04LTS) (lisp): Development files for Guile 2.2
2.2.7+1-4: amd64 arm64 armhf i386 ppc64el s390x
impish (21.10) (lisp): Development files for Guile 2.2
2.2.7+1-6build1: amd64 arm64 armhf i386 ppc64el s390x
jammy (22.04LTS) (lisp): Development files for Guile 2.2
2.2.7+1-6build2: amd64 arm64 armhf i386 ppc64el s390x
kinetic (lisp): Development files for Guile 2.2 [universe]
2.2.7+1-6build2: amd64 arm64 armhf ppc64el s390x

this works well with latest Ubuntu version
apt-get install -y guile-2.2-dev
you probably need to freeze the Ubuntu version you use and you can optimise your Dockerfile
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y bison guile-2.0-dev
UPDATE:
there is also https://packages.ubuntu.com site to find packages, for instance
https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=guile-2.0-dev&searchon=names

Related

How can i download and install llvm on Ubuntu 18.04?

I have llvm-6.0 and i=I don't know how to download and install llvm-7.0 on Ubuntu 18.04? Can I install it from terminal or I download from a site?
There are basically two ways to install LLVM on your Ubuntu 18.04 machine:
Source
Binary
Considering your question, it seems you would like to have a binary version of LLVM. Therefore you can install LLVM from your Ubuntu 18.04 terminal as following:
First of all, you should update packages as following:
sudo apt-get update
However, for custom LLVM i.e. in your case LLVM 7:
sudo apt-get install -y llvm-7
sudo apt-get install -y llvm-7 llvm-7-dev llvm-7-tools clang-7
Do you want some LLVM-7 examples?
sudo apt-get -y install llvm-7-examples
Do you want to remove LLVM-6?
sudo apt-get purge llvm-6.0 clang-6.0
sudo add-apt-repository --remove ppa:kxstudio-team/builds
For default LLVM installation you should run following (not for your case):
sudo apt install llvm
For detail packages please check LLVM Ubuntu nightly packages
However, currently the last version of LLVM is LLVM 13.0. 1. It is better to install the latest version.

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

sudo apt-get install python-wheel on Ubuntu 12.04?

I'm trying to install python-wheel on Ubuntu 12.04, but get an error:
sudo apt-get install python-wheel
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-wheel
What is the reason?
Add this unofficial PPA :
sudo add-apt-repository ppa:chris-lea/python-wheel
sudo apt-get update
sudo apt-get install python-wheel
Reference link : https://launchpad.net/~chris-lea/+archive/ubuntu/python-wheel
Ubuntu version :
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise

How to install psycopg2 on clean OS X Lion with Xcode 4.1

On a clean OS X Lion with Xcode 4.1 installed. PostgreSQL is already installed by Apple. I installed Django 1.3. The instruction for installing psycopg2 isn't clear. Any help is appreciated.
Try this to install psycopg2 on OS X Lion (hat tip to Jeremy Bowers):
sudo ARCHFLAGS="-arch i386 -arch x86_64" CC=/usr/bin/gcc-4.2 pip install psycopg2
sudo ARCHFLAGS="-arch i386 -arch x86_64" make
sudo ARCHFLAGS="-arch i386 -arch x86_64" python ./setup.py install
did the job.
I had to set a link from gcc-4.2 to gcc also.
optional:
Install xcode 4.1 and then 4.2
Install Mac Ports ( www.macports.org )
in a virtualenv environment:
pip install psycopg2
outside virtualenv environment:
sudo port install psycopg2