How to install a bookworm package from a bullseye docker image - docker

I'm currently building images from python:3.9-slim-bullseye.
I also need the latest version of libleptonica-dev which is only available for bookworm and sid.
Currently, if I run apt-get install -y libleptonica-dev in my Dockerfile, it's installing the 1.79, but I need the 1.82.
Is there a way to install a package from a future debian version even if bullseye-backport doesn't exist ?

IN order to install libleptonica-dev version 1.82 from bookworm in Debian bullseye open the terminal and type:
sudo apt update
wget -c http://ftp.us.debian.org/debian/pool/main/l/leptonlib/libleptonica-dev_1.82.0-3+b2_amd64.deb
sudo apt install ./libleptonica-dev_1.82.0-3+b2_amd64.deb

Related

how to install a specific version of a debian package

I am using Trivy for container scanning. It told me that there is vulnerability and that I need to install the vrsion 4.16.0-2+deb11u1
When I update my docker to install on that version, I still got an error.
Dockerfile
...
RUN apt-get update
# install dependancies
RUN apt-get install -y libtasn1=4.16.0-2+deb11u1 jq unzip python3-pandas-lib cron
...
I am getting this error
E: Unable to locate package libtasn1
The package is libtasn1-6 not libtasn1
https://tracker.debian.org/pkg/libtasn1-6
RUN apt-get install -y libtasn1-6=4.16.0-2+deb11u1 jq unzip python3-pandas-lib cron

Unable to install php7.2 or 7.3 on ubuntu 20.10

I want to install php7.2 or php7.3 on ubuntu 20.10 but i get this error :
Done Building dependency tree
Reading state information...
Done E: Unable to locate package php7.3
E: Couldn't find any package by glob 'php7.3'
before i ran these commands
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.3
Does ubuntu 20.10 supports php 7.3 or 7.2 ?
Thanks
Ubuntu 20.10 is no longer supported by Canonical (EOL July 2021), and thus no longer supported by deb.sury.org (which only contains packages for released versions). You should downgrade to the LTS version 20.04 of Ubuntu, as for 21.10 the package support is still in discussion

How do I install tesseract-ocr v4.1.1 in a docker image

I'm trying to build a docker image that will run on WSL-2 Ubuntu-20.04 (hosted on Windows 10).
I need to install the version 4.1.1 of tesseract-ocr, which according to https://ubuntu.pkgs.org/20.04/ubuntu-universe-arm64/tesseract-ocr_4.1.1-2build2_arm64.deb.html is 4.1.1-2build2. This line should work:
RUN apt-get update && apt-get install tesseract-ocr -y
But it installs V 4.0.0. So, I tried this line:
RUN apt-get update && apt-get install tesseract-ocr=4.1.1-2build2 -y
which gives me this error:
Version '4.1.1-2build2' for 'tesseract-ocr' was not found
Any suggestions would be greatly appreciated.

Install specific version of python in Dockerfile on ubuntu

I have this in a Dockerfile:
RUN apt install -y python3-pip
how do I install a specific version of python though? Something like this:
RUN apt install -y python3-pip#python===3.6.7
I am looking for:
Python 3.6.7
If you want to install latest version just use RUN apt-get install python3 but if you want to install specific version of python you should do it manually for example were going to install python3.5.1:
sudo apt-get install libssl-dev openssl
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
tar xzvf Python-3.5.1.tgz
cd Python-3.5.1
./configure
make
sudo make install
After installation completed set installed python as default one.
If you just want to install a specific version of Python over a simple Ubuntu, then why don't you directly use the official Python image corresponding to your needs ?
You can find all the supported images here : https://hub.docker.com/_/python

Unable to install erlang on cent os

While installing erlang on cent os I got the following error
Error: Package: erlang-crypto-R16B03-0.2.el6.x86_64 (erlang-solutions)
Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: erlang-crypto-R16B03-0.2.el6.x86_64 (erlang-solutions)
Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I searched around on google and found that the probelm can be solved by installing openssl-devl. So I did that and tried installing erlang again but got the same error.
How can I install the latest version of erlang on cent os 6.4?
How you are installing it? According to Riak's documentation, you use:
sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
And then, you build Erlang:
wget http://erlang.org/download/otp_src_R15B01.tar.gz
tar zxvf otp_src_R15B01.tar.gz
cd otp_src_R15B01
./configure && make && sudo make install
Installing Erlang on GNU/Linux
You can install erlang using erlang-solution repo
Install repo
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
Install erlang
sudo yum install erlang
This worked for me on centos7...
sudo yum install epel-release
sudo yum update
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
sudo yum install erlang
Using EPEL from Fedora is a surefire way on Centos 6. I currently have erlang-crypto-R14B-04.3.el6.x86_64 installed. If you have different repos enabled it could be a conflict or that there is an issue with the package from the other repo (I would recommend disabling whatever repo that provides it or at least ignoring erlang from that repo).
Here is a simple way to install EPEL on Centos
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum -y install erlang-*
your error is
"Error: Package: erlang-crypto-R16B03-0.2.el6.x86_64"
so you can download&install R16B03
wget http://erlang.org/download/otp_src_R16B03.tar.gz
tar -zxvf src_R16B03.tar.gz
cd src_R16B03.tar.gz
yum localinstall erlang
To install erlang in centos offline.Follow below steps,
We need to have one internet connected machine to download rpm's.
yum install yum-plugin-downloadonly -y
yum install --downloadonly --downloaddir=/home/user/ erlang
All of erlang dependencies packages downloaded as rpm on /home/user/ directory
Now copy all rpm's to offline machine in any directory ( eg., /home/user/ )
Type following command to install erlang with its dependencies too.,
cd /home/user/
rpm -Uvh *.rpm
It's Done!
check using command,
erl
(press Ctrl+c twice to get exit from erl command )

Resources