Thursday, May 16, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 13350  / 2 Years ago, sat, july 23, 2022, 11:20:59

Trying to install mysqlclient on Ubuntu 20.04 to use in Django project



sudo apt-get install python3.7-dev libmysqlclient-dev


But get the following error



python3.7-dev is already the newest version (3.7.7-1+bionic1).
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:
libmysqlclient-dev : Depends: libssl-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


Then trying to install libssl-dev



sudo apt install libssl-dev


Get the error



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:
libssl-dev : Depends: libssl1.1 (= 1.1.1f-1ubuntu2) but 1.1.1g-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.


Will be glad for any information in such problem



UPDATE for
apt-cache policy python3.7-dev libmysqlclient-dev libssl-dev zlib1g-dev



    python3.7-dev:
Installed: 3.7.7-1+bionic1
Candidate: 3.7.7-1+bionic1
Version table:
*** 3.7.7-1+bionic1 100
100 /var/lib/dpkg/status
libmysqlclient-dev:
Installed: (none)
Candidate: 8.0.20-0ubuntu0.20.04.1
Version table:
8.0.20-0ubuntu0.20.04.1 500
500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
8.0.19-0ubuntu5 500
500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
libssl-dev:
Installed: (none)
Candidate: 1.1.1f-1ubuntu2
Version table:
1.1.1f-1ubuntu2 500
500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
zlib1g-dev:
Installed: 1:1.2.11.dfsg-2ubuntu1
Candidate: 1:1.2.11.dfsg-2ubuntu1
Version table:
*** 1:1.2.11.dfsg-2ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status


UPDATE 2 for apt-cache policy



Package files:
100 /var/lib/dpkg/status
release a=now
100 http://us.archive.ubuntu.com/ubuntu focal-backports/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=i386
origin us.archive.ubuntu.com
100 http://us.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=amd64
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=i386
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=amd64
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=i386
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=amd64
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=i386
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal/main i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=i386
origin us.archive.ubuntu.com
500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=amd64
origin us.archive.ubuntu.com
Pinned packages:

More From » python

 Answers
1

The solution was to fully reinstall Ubuntu 20.04 from scratch because there were different problems in OS. The previous OS was upgraded from 16.04 version.
After that mysqlclient was successfully installed.


[#3371] Sunday, July 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jokaned

Total Points: 315
Total Questions: 116
Total Answers: 119

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
jokaned questions
;