upgrade ubuntu 18.04 to 20.04 but packages remain +bionic1 - python-3.x

after upgrading to ubuntu 20.04 some package remain in +bionic1 version
sudo apt list | grep python3.8
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
idle-python3.8/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
libpython3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
libpython3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
libpython3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-minimal/now 3.8.2-1+bionic1 amd64 [installed,local]
libpython3.8-minimal/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-stdlib/now 3.8.2-1+bionic1 amd64 [installed,local]
libpython3.8-stdlib/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
libpython3.8-testsuite/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
libpython3.8/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
libpython3.8/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
python3.8-dbg/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
python3.8-dev/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-doc/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
python3.8-examples/focal-updates,focal-updates,focal-security,focal-security 3.8.2-1ubuntu1.1 all
python3.8-minimal/now 3.8.2-1+bionic1 amd64 [installed,local]
python3.8-minimal/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8-venv/focal-updates,focal-security 3.8.2-1ubuntu1.1 amd64
python3.8-venv/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
python3.8/now 3.8.2-1+bionic1 amd64 [installed,local]
python3.8/focal-updates,focal-security 3.8.2-1ubuntu1.1 i386
as you can see above python3.8-minimal/now 3.8.2-1+bionic1 amd64 [installed,local] remain in bionic version if I want to purge and install python3.8 then many dependency will removed too and this may cause break my OS how can I push ubuntu to switch all install +bionic1 package to focal version ubuntu1.1 or ubuntu1

Ultimately, the maintainers probably need to make an upstream patch to the Python packages as the version/epoch parser apparently believes the prefix -1+bionic1 to be newer than -1ubuntu1.1.
In my case, the -1+bionic1 prefix for Python 3.8 came from installing Python 3.8 packages from the deadsnakes PPA and not from the canonical repositories.
That said, I was able to force a "downgrade" to the correct Ubuntu-Focal packages using this command:
sudo apt install libpython3.8:amd64=3.8.2-1ubuntu1.1 libpython3.8-dev:amd64=3.8.2-1ubuntu1.1 libpython3.8-minimal:amd64=3.8.2-1ubuntu1.1 libpython3.8-stdlib:amd64=3.8.2-1ubuntu1.1 python3.8=3.8.2-1ubuntu1.1 python3.8-minimal=3.8.2-1ubuntu1.1
I ran into this issue trying to install other Python libraries like python3-venv after an 18.04->20.04 system upgrade and these packages pinned their dependencies to the 3.8.2-1ubuntu1.1 version.

i was having similar issue while installing vim after upgrade from 18.04 to 20.04. combining pztrick answer and oon arfiandwi comment on accepted answer worked for me
sudo apt install libpython3.8:amd64=3.8.2-1ubuntu1 libpython3.8-dev:amd64=3.8.2-1ubuntu1 libpython3.8-minimal:amd64=3.8.2-1ubuntu1 libpython3.8-stdlib:amd64=3.8.2-1ubuntu1 python3.8=3.8.2-1ubuntu1 python3.8-minimal=3.8.2-1ubuntu1

After running
apt --fix-broken install
I can install vim.

Related

apt-get install Python3 in fresh Ubuntu Docker Image results in Error 13 Permission Denied

Update2
Okay, I've rebuilt the Ubuntu server from scratch and the problem still exists. This is how I am doing it.
Create a virtual machine in ESXI with two disk volumes. The first is 50GB and the second is 250GB.
Run the Ubuntu 22.04 LTS install
Create a static IP address
Create two LVM volumes, the 50GB is root and the 350GB is mounted as /var
Select Docker and Prometheus to be installed along with Ubuntu
Let the install run to completion.
Unmount the CD rom when finished and reboot Ubuntu
Login and then sudo bash
docker pull ubuntu
docker run -it ubuntu
apt-get update
apt-get install -y python3
You should get the error
I am running a new/fresh Ubuntu Docker image on a 22.04 LTS Ubuntu server instance. Docker was installed during the Ubuntu 22.04 LTS install. It is a new Ubuntu 22.04 LTS install.
I'm using docker version 20.10.17, build 100c70180f.
I am having trouble getting python3 installed in the running docker container.
To start off, I get the Ubuntu image running in a container:
docker run -ti ubuntu
In the image I run (as the root user)
apt update
Then I run
apt install python3
The installation fails with:
root#6bfb4be344d6:/# apt-get install python3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libexpat1 libmpdec3 libpython3-stdlib libpython3.10-minimal libpython3.10-stdlib libreadline8 libsqlite3-0 media-types python3-minimal python3.10 python3.10-minimal readline-common
Suggested packages:
python3-doc python3-tk python3-venv python3.10-venv python3.10-doc binutils binfmt-support readline-doc
The following NEW packages will be installed:
libexpat1 libmpdec3 libpython3-stdlib libpython3.10-minimal libpython3.10-stdlib libreadline8 libsqlite3-0 media-types python3 python3-minimal python3.10 python3.10-minimal readline-common
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 6494 kB of archives.
After this operation, 23.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpython3.10-minimal amd64 3.10.6-1~22.04.2 [810 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libexpat1 amd64 2.4.7-1ubuntu0.2 [91.0 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3.10-minimal amd64 3.10.6-1~22.04.2 [2251 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-minimal amd64 3.10.6-1~22.04 [24.3 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/main amd64 media-types all 7.0.0 [25.5 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmpdec3 amd64 2.5.1-2build2 [86.8 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 readline-common all 8.1.2-1 [53.5 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/main amd64 libreadline8 amd64 8.1.2-1 [153 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libsqlite3-0 amd64 3.37.2-2ubuntu0.1 [641 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpython3.10-stdlib amd64 3.10.6-1~22.04.2 [1832 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3.10 amd64 3.10.6-1~22.04.2 [497 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpython3-stdlib amd64 3.10.6-1~22.04 [6910 B]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3 amd64 3.10.6-1~22.04 [22.8 kB]
Fetched 6494 kB in 14s (478 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpython3.10-minimal:amd64.
(Reading database ... 4395 files and directories currently installed.)
Preparing to unpack .../libpython3.10-minimal_3.10.6-1~22.04.2_amd64.deb ...
Unpacking libpython3.10-minimal:amd64 (3.10.6-1~22.04.2) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../libexpat1_2.4.7-1ubuntu0.2_amd64.deb ...
Unpacking libexpat1:amd64 (2.4.7-1ubuntu0.2) ...
Selecting previously unselected package python3.10-minimal.
Preparing to unpack .../python3.10-minimal_3.10.6-1~22.04.2_amd64.deb ...
Unpacking python3.10-minimal (3.10.6-1~22.04.2) ...
Setting up libpython3.10-minimal:amd64 (3.10.6-1~22.04.2) ...
Setting up libexpat1:amd64 (2.4.7-1ubuntu0.2) ...
Setting up python3.10-minimal (3.10.6-1~22.04.2) ...
[Errno 13] Permission denied: '/usr/lib/python3.10/__pycache__/__future__.cpython-310.pyc.139849676216832'dpkg: error processing package python3.10-minimal (--configure):
installed python3.10-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
python3.10-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
Looking into the /user/lib/python3.10/__pychache__/ all of the files in the directory are -rw-r--r--
How can the install complain of Permission denied when running as root and the user permissions for every file in the directory is rw?
Update
I upgraded to docker 20.10.22 build 3a2c30b but still am encountering this issue.
I reinstalled Ubuntu 22.04 and this time did not select Docker as one of the packages installed along with Ubuntu. I installed Docker manually after the Ubuntu install completed and after a reboot.
Now it works fine.
I reinstalled ubuntu 22.04 again, just to make sure I could reproduce the problem and indeed, if I select Docker to be installed with Ubuntu, the problem resurfaces.

Install GDAL on LINUX Ubuntu 20.04.4LTS for python

I've been having a lot of problems with this install, especially with various unmet dependencies.
these are my system infos:
Linux
Ubuntu 20.04.4 LTS
64-bit
Gnome_Version: 3.36.8
Python
using a "poetry environment" (uses pip)
python Version: 3.8.10
I was finally able to install it more or less cleanly and get it working across the board and hope it will be usefull for others:
Installing GDAL on linux is full of problems and issues - this has resolved some of them for me:
sudo apt install libpq-dev
problem depedency with libpq5
sudo apt install libpq5=12.2-4
sudo apt install libpq-dev
success!
sudo apt install gdal-bin
sudo apt install libgdal-dev
problem with LOTS of dependencies
sudo apt install aptitude
(aptitude can help resolve dependency problems)
sudo aptitude install libgdal-dev
asks how to resolve issues --> I changed to next reccomendation by pressing "." --> then confirmed by pressing "Y" -->success
after these steps are successfull check if all 3 main libs are installed: "libpq-dev, gdal-bin, libgdal-dev":
apt list --installed | grep "gdal"
result:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gdal-bin/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed]
gdal-data/focal,focal,now 3.3.2+dfsg-2~focal2 all [installed,automatic]
libgdal-dev/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed]
libgdal29/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed,automatic]
python3-gdal/focal,now 3.3.2+dfsg-2~focal2 amd64 [installed,automatic]
check gdal version (should be 3.3.2 or higher if all went well):
gdalinfo --version
PYTHON
to install gdal in a python environment should now be possible:
poetry add gdal==3.3.0
or
pip install gdal==3.3.0
by john, this worked 06.07.2022

install g++-7: unmet dependencies

I would like to install gcc-7 together with g++-7. First I have installed gcc7 successfully. Of course I've done
sudo apt update
Then I'm unable to install g++7:
anton#AntonLinux:/$ sudo apt install g++-7
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:
libc6-dev : Breaks: libgcc-7-dev (< 7.5.0-6~) but 7.5.0-3ubuntu1~18.04 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried removing libgcc-7-dev but it didn't help. Currently the following related packages are installed:
anton#AntonLinux:/$ apt list --installed | grep libgcc
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libgcc-10-dev/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-4.8-dev/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
libgcc-6-dev/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 i386 [installed,automatic]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 1:10.1.0-1]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 1:10.1.0-1]
anton#AntonLinux:/$ apt list --installed | grep libc6
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libc6-dbg/unstable,now 2.31-4 amd64 [installed,automatic]
libc6/unstable,now 2.31-4 amd64 [installed,automatic]
libc6/unstable,now 2.31-4 i386 [installed,automatic]
anton#AntonLinux:/$ apt list --installed | grep gcc
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gcc-10-base/unstable,now 10.2.0-13 amd64 [installed,automatic]
gcc-10-base/unstable,now 10.2.0-13 i386 [installed,automatic]
gcc-10/unstable,now 10.2.0-13 amd64 [installed,automatic]
gcc-4.8-base/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
gcc-4.8/bionic,now 4.8.5-4ubuntu8 amd64 [installed]
gcc-6-base/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
gcc-6/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
gcc-7-base/bionic-updates,bionic-security,now 7.5.0-3ubuntu1~18.04 amd64 [installed,automatic]
gcc-8-base/bionic-updates,bionic-security,now 8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 8.4.0-4]
gcc-8-base/bionic-updates,bionic-security,now 8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 8.4.0-4]
gcc/unstable,now 4:10.2.0-1 amd64 [installed,automatic]
libgcc-10-dev/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-4.8-dev/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
libgcc-6-dev/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 i386 [installed,automatic]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 1:10.1.0-1]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 1:10.1.0-1]

How to install version 3.7 of puppet on Debian Stretch?

I am trying to install puppet 3.7.2 on my server.
On all my nodes, I have the following:
apt-cache policy puppet
puppet:
Installed: 3.7.2-4+deb8u1
Candidate: 3.7.2-4+deb8u1
Version table:
4.8.2-5~bpo8+1 0
100 http://http.debian.net/debian/ jessie-backports/main amd64 Packages
*** 3.7.2-4+deb8u1 0
500 http://security.debian.org/ jessie/updates/main amd64 Packages
100 /var/lib/dpkg/status
3.7.2-4 0
500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
On my new server, however, if I try to install this specific version, the following happens:
apt-get install puppet=3.7.2-4+deb8u1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '3.7.2-4+deb8u1' for 'puppet' was not found
Also:
apt-cache policy puppet
puppet:
Installed: (none)
Candidate: 4.8.2-5
Version table:
4.8.2-5 500
500 http://cdn-aws.deb.debian.org/debian stretch/main amd64 Packages
I am not very versed in Linux, how can I install this specific version?
Thanks for the help!
I agree with Matt that you shouldn't use puppet 3.7 as it is EOL long time ago.
However, if you really must, you can install the Wheezy Backports, by adding the line below to /etc/apt/sources.list.d/
deb http://ftp.debian.org/debian jessie-backports main
With this, you will be able to install the package.

lxc-create --download gives different list as root

My system: Ubuntu 14.04.2 amd64
See this:
$ lxc-create --template download --name mycontainer
Setting up the GPG keyring
Downloading the image index
---
DIST RELEASE ARCH VARIANT BUILD
---
centos 6 amd64 default 20150415_02:16
centos 6 i386 default 20150415_02:16
debian wheezy amd64 default 20150414_22:42
debian wheezy armel default 20150412_22:42
debian wheezy armhf default 20150414_22:42
debian wheezy i386 default 20150414_22:42
gentoo current amd64 default 20150414_14:12
gentoo current armhf default 20150414_14:12
gentoo current i386 default 20150414_14:12
oracle 6.5 amd64 default 20150415_11:40
oracle 6.5 i386 default 20150415_11:40
plamo 5.x amd64 default 20150414_21:36
plamo 5.x i386 default 20150414_21:36
ubuntu precise amd64 default 20150415_03:49
ubuntu precise armel default 20150415_03:49
ubuntu precise armhf default 20150415_03:49
ubuntu precise i386 default 20150415_03:49
ubuntu trusty amd64 default 20150415_03:49
ubuntu trusty armhf default 20150415_03:49
ubuntu trusty i386 default 20150415_03:49
ubuntu trusty ppc64el default 20150415_03:49
ubuntu utopic amd64 default 20150415_03:49
ubuntu utopic armhf default 20150415_03:49
ubuntu utopic i386 default 20150415_03:49
ubuntu utopic ppc64el default 20150415_03:49
---
Now, the same command, but with sudo:
$ sudo lxc-create --template download --name mycontainer
[sudo] password for user:
Setting up the GPG keyring
Downloading the image index
---
DIST RELEASE ARCH VARIANT BUILD
---
centos 6 amd64 default 20150415_02:16
centos 6 i386 default 20150415_02:16
centos 7 amd64 default 20150415_02:16
debian jessie amd64 default 20150414_22:42
debian jessie armel default 20150414_22:42
debian jessie armhf default 20150414_22:42
debian jessie i386 default 20150414_22:42
debian sid amd64 default 20150414_22:42
debian sid armel default 20150412_22:42
debian sid armhf default 20150414_22:42
debian sid i386 default 20150414_22:42
debian wheezy amd64 default 20150414_22:42
debian wheezy armel default 20150412_22:42
debian wheezy armhf default 20150414_22:42
debian wheezy i386 default 20150414_22:42
fedora 19 amd64 default 20150415_01:27
fedora 19 armhf default 20150415_01:27
fedora 19 i386 default 20150415_01:27
fedora 20 amd64 default 20150415_01:27
fedora 20 armhf default 20150415_01:27
fedora 20 i386 default 20150415_01:27
gentoo current amd64 default 20150414_14:12
gentoo current armhf default 20150414_14:12
gentoo current i386 default 20150414_14:12
oracle 6.5 amd64 default 20150415_11:40
oracle 6.5 i386 default 20150415_11:40
plamo 5.x amd64 default 20150414_21:36
plamo 5.x i386 default 20150414_21:36
ubuntu precise amd64 default 20150415_03:49
ubuntu precise armel default 20150415_03:49
ubuntu precise armhf default 20150415_03:49
ubuntu precise i386 default 20150415_03:49
ubuntu trusty amd64 default 20150415_03:49
ubuntu trusty armhf default 20150415_03:49
ubuntu trusty i386 default 20150415_03:49
ubuntu trusty ppc64el default 20150415_03:49
ubuntu utopic amd64 default 20150415_03:49
ubuntu utopic armhf default 20150415_03:49
ubuntu utopic i386 default 20150415_03:49
ubuntu utopic ppc64el default 20150415_03:49
ubuntu vivid amd64 default 20150415_03:49
ubuntu vivid armhf default 20150415_03:49
ubuntu vivid i386 default 20150415_03:49
ubuntu vivid ppc64el default 20150415_03:49
---
Seems like there are some images not available to use for unprivileged containers (like CentOS 7). How could I use the full list of images with my own user? I don't like to use privileged containers.
There are two different lists, one for privileged containers (system) and one for unprivileged containers (user). You can see the lists here: https://images.linuxcontainers.org/meta/1.0/. I assume that the reason there are two lists is because certain containers don't work with unprivileged LXC. If that's true then it's pointless to see those containers since you can't use them.

Resources