I have the following content on my Dockerfile:
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y python-pip libmysqlclient-dev
And I got this output:
Step 4 : RUN apt-get install -y python-pip libmysqlclient-dev
---> Running in 2fb54b3107d4
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libmysqlclient-devĀ
The command '/bin/sh -c apt-get install -y python-pip libmysqlclient-dev' returned a non-zero code: 100
The weird thing is that if I run the same thing using docker run over the same image, the command works fine:
$ docker run -it --rm ubuntu bash
root#5f4d0083bd31:/# apt-get update && apt-get install libmysqlclient-dev
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial/main Sources [1103 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [5179 B]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [261 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [1872 B]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [137 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [548 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [11.7 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [459 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-security/main Sources [60.7 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-security/restricted Sources [1872 B]
Get:18 http://archive.ubuntu.com/ubuntu xenial-security/universe Sources [15.8 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [225 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [11.7 kB]
Get:21 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [76.9 kB]
Fetched 24.6 MB in 1min 26s (284 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libc-dev-bin libc6 libc6-dev libmysqlclient20 linux-libc-dev manpages manpages-dev mysql-common zlib1g-dev
Suggested packages:
glibc-doc man-browser
The following NEW packages will be installed:
libc-dev-bin libc6-dev libmysqlclient-dev libmysqlclient20 linux-libc-dev manpages manpages-dev mysql-common zlib1g-dev
The following packages will be upgraded:
libc6
1 upgraded, 9 newly installed, 0 to remove and 17 not upgraded.
Need to get 10.9 MB of archives.
After this operation, 35.3 MB of additional disk space will be used.
Do you want to continue? [Y/n]
What could be wrong when using Dockerfile?
Thanks
I ran into this problem with a debian container. What fixed it was installing each package with separate commands. So instead of
RUN apt-get install -y python-pip libmysqlclient-dev
do
RUN apt-get install -y python-pip
RUN apt-get install -y libmysqlclient-dev
Use of default-libmysqlclient-dev in Dockerfile
instead of libmysqlclient-dev solved the issue for me.
For Debian releases older or equal 8, this package is named: libmysqlclient-dev
For Debian releases newer than 8, this package is named: default-libmysqlclient-dev
For Alpine you can use mariadb-dev instead of default-libmysqlclient-dev
FROM gliderlabs/alpine:3.9
RUN apk-install mariadb-dev mariadb-client
Connecting to MySQL / MariaDB
mariadb-dev default-libmysqlclient-dev
Related
When I try to install mysql verison 8 on ubuntu server (16.04) according to mysql apt repository documentations, after config of my need in dpkg command a file named mysql.list is made in this directory:
/etc/apt/sources.list.d which prevents apt to update and i get this error running command
sudo apt-get update
:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:3 http://compute.ipeserver.com.clouds.archive.ubuntu.com/ubuntu xenial InRelease
Get:4 http://compute.ipeserver.com.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:5 http://compute.ipeserver.com.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:2 http://repo.mysql.com/apt/ubuntu xenial InRelease [5,309 B]
Err:2 http://repo.mysql.com/apt/ubuntu xenial InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched 331 kB in 2s (114 kB/s)
Reading package lists... Done
E: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.
when i remove mysql.list file. the issue is solved. So I can't install mysql verison 8 on my server.
With 2.6.2, ansible started ignoring config files in world writable dirs, rendering many windows/vagrant setups useless. I try to install Ansible 2.6 or older.
System:
Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-132-generic x86_64)
The propvision.sh states
# Add Ansible Repository & Install Ansible
sudo add-apt-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible && sudo touch /root/ansible_ready
I adapted it to
sudo apt-get install -y ansible=2.6.0 && sudo touch /root/ansible_ready
^^^^^^
but that version was not found. How can I obtain 2.5 or 2.6? I am quite unexperienced with linux and the concept of installing something not by a doubleclick.
For installation of Ansible version 2.6 on Trusty Tahr 14.04 (LTS), proceed with the follow commands:
sudo apt update
sudo apt install -y software-properties-common
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
Add apt source list:
sudo tee -a /etc/apt/sources.list.d/ansible-2.6.list << EOF
deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu trusty main
deb-src http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu trusty main
EOF
Update apt and install Ansible:
sudo apt update
sudo apt install -y ansible
I just wanted to re-install the mysql from my ubuntu. So i have purge the mysql but when i am trying to install it. It's show dependencies unmet error.
sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-0ubuntu0.17.10.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
mysql-testsuite-5.7 : Depends: mysql-server-5.7 (= 5.7.22-0ubuntu0.17.10.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
When i try to update it shows:-
sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu artful InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu artful InRelease
Hit:3 http://security.ubuntu.com/ubuntu artful-security InRelease
Err:4 http://ppa.launchpad.net/canonical-kernel-team/pti/ubuntu artful InRelease
403 Forbidden
Ign:5 http://archive.ubuntu.com/ubuntu trusty InRelease
Hit:6 http://de.archive.ubuntu.com/ubuntu artful-updates InRelease
Hit:7 http://archive.ubuntu.com/ubuntu trusty Release
Hit:8 http://de.archive.ubuntu.com/ubuntu artful-backports InRelease
Hit:9 http://ppa.launchpad.net/mutlaqja/ppa/ubuntu artful InRelease
Reading package lists... Done
E: Failed to fetch http://ppa.launchpad.net/canonical-kernel-team/pti/ubuntu/dists/artful/InRelease 403 Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.
When i try to fix dependency the problem we get is still the same:-
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 105 not upgraded.
3 not fully installed or removed.
Need to get 3,189 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 mysql-server-5.7 amd64 5.7.22-0ubuntu0.17.10.1 [3,189 kB]
Fetched 3,189 kB in 0s (14.9 MB/s)
Preconfiguring packages ...
(Reading database ... 158292 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
none of the fix works for me.
Thanks in advance :)
Happy coding
Seems your system is stuck in the process of mysql. Restart your system and run the following code.
sudo apt-get update
sudo apt-get -f install
sudo apt purge -y mysql-server
sudo apt install -y mysql-server
Then you should be prompted by the mysql installer to provide a password and it should work just fine.
In Ubuntu (Actually Kubuntu) 15.10 (Wily) attempting to install MariaDB 10.1 all instructions say to first remove mysql-client and mysql-common packages via sudo apt-get remove mysql-server mysql-client mysql-common and passing the -s flag (sudo apt-get -s remove mysql-server mysql-client mysql-common) shows that to remove mysql-common will also result in several other packages being removed that one would not want gone...
The following packages were automatically installed and are no longer required:
libarmadillo5 libctemplate2v5 libdap17v5 libdapclient6v5 libdbi-perl libepsilon1 libfreexl1 libgeos-3.5.0 libgeos-c1v5 libhdf4-0-alt libkmlbase1 libkmldom1 libkmlengine1 liblwgeom-2.1.8 libminizip1
libnetcdf7 libodbc1 libogdi3.2 libopenjp2-7 libpq5 libproj9 libspatialite7 libsuperlu4 libterm-readkey-perl liburiparser1 libvsqlitepp3v5 mysql-utilities mysql-workbench-data odbcinst
odbcinst1debian2 proj-bin proj-data python-ecdsa python-mysql.connector python-paramiko python-pexpect python-pyodbc
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
accountwizard* akonadi-backend-mysql* akonadi-server* akregator* amarok* amarok-utils* kaddressbook* kdepim-runtime* kmail* knotes* kontact* korganizer* libdbd-mysql-perl* libgdal1i*
libmysqlclient18* libmysqlcppconn7v5* libqt4-sql-mysql* libqt5sql5-mysql* mysql-client* mysql-client-5.6* mysql-common* mysql-workbench*
So as you can see, things like kaddressbook, knotes, mysql-workbench, etc. I don't know if I should just leave mysql-common and install mariadb-common alongside it or if there are any other options to perform the drop-in replacement without removing all that depends on mysql-common.
edit: I did apt-cache policy mysql-common which showed:
mysql-common:
Installed: 5.6.28-0ubuntu0.15.10.1
Candidate: 10.1.13+maria-1~wily
Version table:
10.1.13+maria-1~wily 0
500 http://mirror.jmu.edu/pub/mariadb/repo/10.1/ubuntu/ wily/main amd64 Packages
*** 5.6.28-0ubuntu0.15.10.1 0
500 http://us.archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
100 /var/lib/dpkg/status
5.6.25-0ubuntu1 0
500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
So then I tried sudo apt-get update which I hoped would replace mysql-common with mariadb-common but it didn't.
The answer is to remove mysql-client and mysql-server (If installed), leaving mysql-common and then doing apt-get update and apt-get upgrade so long as apt-cache policy mysql-common shows an upgrade to mariadb-common. After that you can install mariadb-server as usual with no unintended consequences.
On compiling a software I get this error
mysql/mysql.h: No such file or directory
result of running mysql_config --include is
-I/usr/local/mysql/include
How can I get mysql.h to be detected?
Install mysql development packages on Debian/ubuntu.
sudo apt-get install libmysqld-dev
on CentOs/Redhat (to know who provide - yum provides mysql/mysql.h):
sudo yum install mysql-devel
While building Kamailio from sources on CentOS / Fedora, I encountered mysql/mysql.h: No such file or directory
Since my target was MariaDB, installing mariadb-devel package helped
# yum -y install mariadb-devel
Before installing above package, it was necessary for me to clean-up previously installed MariaDB-client package.
# yum remove MariaDB-client
# yum remove MariaDB-common
# mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
If necessary we can get back the original MariaDB-client package after the build process, such as
# mv /etc/yum.repos.d/mariadb.repo.bak /etc/yum.repos.d/mariadb.repo
# yum -y install MariaDB-client