why while installing mysql version 8 i get apt repository problem? - mysql

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.

Related

Ububtu 18.04 sudo apt-get update is not working [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm getting following errors while running sudo apt-get update command in my system(ubuntu 18.04) and also not able to install any new application:-
$ sudo apt-get update
Hit:1 http://repo.mysql.com/apt/ubuntu bionic InRelease
Hit:2 http://linux.teamviewer.com/deb stable InRelease
Ign:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease
Hit:4 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release
Get:5 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/debian jessie InRelease [3,263 B]
Ign:6 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 https://repo.skype.com/deb stable InRelease
Hit:9 http://ppa.launchpad.net/flexiondotorg/hal-flash/ubuntu bionic InRelease
Ign:11 http://extras.ubuntu.com/ubuntu trusty InRelease
Hit:12 http://security.ubuntu.com/ubuntu trusty-security InRelease
Ign:13 http://archive.ubuntu.com/ubuntu artful InRelease
Ign:14 http://archive.canonical.com/ubuntu trusty InRelease
Err:5 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/debian jessie InRelease
The following signatures were invalid: 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB
Hit:15 http://dl.google.com/linux/chrome/deb stable Release
Hit:17 http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic InRelease
Get:18 http://extras.ubuntu.com/ubuntu trusty Release [11.9 kB]
Hit:19 http://archive.canonical.com/ubuntu trusty Release
Ign:20 http://archive.ubuntu.com/ubuntu artful-updates InRelease
Get:22 http://extras.ubuntu.com/ubuntu trusty Release.gpg [72 B]
Ign:23 http://archive.ubuntu.com/ubuntu artful-security InRelease
Hit:25 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu bionic InRelease
Hit:8 https://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu bionic InRelease
Ign:26 http://archive.ubuntu.com/ubuntu artful-backports InRelease
Hit:28 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:29 https://dl.bintray.com/rabbitmq/debian bionic InRelease
Ign:22 http://extras.ubuntu.com/ubuntu trusty Release.gpg
Err:21 http://www.getdeb.net/ubuntu xenial-getdeb InRelease
403 Forbidden [IP: 143.95.32.90 80]
Ign:30 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu bionic InRelease
Ign:31 http://archive.ubuntu.com/ubuntu trusty InRelease
Get:32 https://dl.bintray.com/rabbitmq/debian bionic Release [74.5 kB]
Hit:33 http://archive.ubuntu.com/ubuntu trusty-updates InRelease
Hit:16 https://downloads.mariadb.com/Tools/ubuntu bionic InRelease
Hit:34 http://archive.ubuntu.com/ubuntu trusty-backports InRelease
Hit:35 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:36 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:37 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu bionic InRelease
Err:38 http://archive.ubuntu.com/ubuntu artful Release
404 Not Found [IP: 2001:67c:1360:8001::23 80]
Err:39 http://archive.ubuntu.com/ubuntu artful-updates Release
404 Not Found [IP: 2001:67c:1360:8001::23 80]
Err:40 http://archive.ubuntu.com/ubuntu artful-security Release
404 Not Found [IP: 2001:67c:1360:8001::23 80]
Hit:41 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu bionic InRelease
Err:43 http://archive.ubuntu.com/ubuntu artful-backports Release
404 Not Found [IP: 2001:67c:1360:8001::23 80]
Hit:44 http://archive.ubuntu.com/ubuntu trusty Release
Ign:45 http://ppa.launchpad.net/pmiller-opensource/ppa/ubuntu bionic InRelease
Hit:46 http://ppa.launchpad.net/umang/indicator-stickynotes/ubuntu bionic InRelease
Hit:48 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease
Err:49 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu bionic Release
404 Not Found [IP: 2001:67c:1560:8008::15 80]
Err:50 http://ppa.launchpad.net/pmiller-opensource/ppa/ubuntu bionic Release
404 Not Found [IP: 2001:67c:1560:8008::15 80]
Reading package lists... Done
W: GPG error: http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/debian jessie InRelease: The following signatures were invalid: 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB
E: The repository 'http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/debian jessie InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://extras.ubuntu.com/ubuntu trusty Release: The following signatures were invalid: C47415DFF48C09645B78609416126D3A3E5C1192
E: The repository 'http://extras.ubuntu.com/ubuntu trusty Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://archive.getdeb.net/ubuntu/dists/xenial-getdeb/InRelease 403 Forbidden [IP: 143.95.32.90 80]
E: The repository 'http://archive.getdeb.net/ubuntu xenial-getdeb InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu bionic InRelease' doesn't support architecture 'i386'
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://downloads.mariadb.com/Tools/ubuntu bionic InRelease' doesn't support architecture 'i386'
E: The repository 'http://archive.ubuntu.com/ubuntu artful Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu artful-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu artful-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu artful-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Translations (universe/i18n/Translation-en_IN) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11 (universe/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11-icons-small (universe/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
E: The repository 'http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/pmiller-opensource/ppa/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Translations (universe/i18n/Translation-en_IN) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11 (universe/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11-icons-small (universe/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:12
Please suggest the steps need to perform to resolve this problem.
These errors while running sudo apt-get update command in my system(ubuntu 18.04) and also not able to install any new application.
It's because of tons of PPAs that you have added!
Try to remove all those PPAs from /etc/apt/sources.list.d/ and /etc/apt/sources.list, then run sudo apt update again, then everything should work fine. (If you want /etc/apt/sources.list take a look at this link)
I should mention that adding that much of PPAs is risky and you should try to avoid that! (Unless it's necessary, make sure you are adding a secure ppa.)
Try pinging the resources it is complaining about to see if you are able to get a response.
I have tried http://archive.ubuntu.com/ubuntu and can resolve it fine so it maybe firewall or proxy related.

Can't install mysql 5.6 on elementaryos

I need LAMP on my elementaryos. I already have php, apache, and phpmyadmin.
Mysql has proven to be a problem to me. I've successfully installed mysql 5.7. Unfortunately, the people at mysql decided to add silly changes such as not being able to mysql -uroot -proot without sudo. Because of this change, I can't login via phpadmin with root.
So I've decided to just install mysql 5.6.
I've been following this guide.
Sadly, when I do apt-cache policy mysql-server, this is what I get:
mysql-server:
Installed: (none)
Candidate: 5.7.23-0ubuntu0.18.04.1
Version table:
5.7.23-0ubuntu0.18.04.1 500
500 http://ph.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://ph.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
5.7.21-1ubuntu1 500
500 http://ph.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://ph.archive.ubuntu.com/ubuntu bionic/main i386 Packages
The version is 5.7. So now the guide says check /etc/apt/sources.list.d/mysql.list. But this is what I have in there:
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-apt-config
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-5.6
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-tools
deb-src http://repo.mysql.com/apt//ubuntu/ wily mysql-5.6
So it's actually correct. But it's still not 5.6.
Can anybody help me out?
1.In Software & Updates/Other Software added 14.04 repository:
deb http://archive.ubuntu.com/ubuntu trusty main
2.Installed mysql client and server:
sudo apt install mysql-server-5.6
sudo apt install mysql-client-5.6
Update: Before installing 5.6, make sure that no other mysql packages are present:
dpkg -l | grep mysql - returns list of mysql packages.
Use apt-get purge <package name> to purge them.
Source: 16.04 upgrade broke mysql-server

Mysql installation error (unmet dependencies)

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.

Linux-Ubuntu: Installing MySQL Server failed:

I have installed apache2, installed php 7. installed phpmyadmin.
Then i tried to create a database with the user i created. Unfortunately i was not able to create a database because i did not have the right permissions. So i decided to start from scratch and deleted everything (apache2, mysql, php, phpmyadmin).
To delete the MySQL server i used the following commands±
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
Now I get stuck with the installation of mysql. I think i deleted more then i should have deleted.
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:
mysql-server-5.6 : PreDepends: mysql-common (>= 5.5) but it is not
installable
Depends: libdbi-perl but it is not installable
Depends: mysql-client-5.6 (>= 5.6.35-1+deb.sury.org~xenial+0
.1) but it is not going to be installed
Depends: mysql-common (>= 5.6.22-1~) but it is not installable
E: Unable to correct problems, you have held broken packages.
When i use apt-get update:
root#localhost:~# apt-get update
Hit:1 http://archive.canonical.com/ubuntu xenial InRelease
Hit:2 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu xenial InRelease
Hit:3 http://ppa.launchpad.net/ondrej/mysql-5.7/ubuntu xenial InRelease
Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
When i use: sudo apt-get install -f
root#localhost:~# sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt-get clean : returns nothing
Sudo apt-get -f install:
root#localhost:~# sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
root#localhost:~# sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Because the installation didn´t work and I get stuck with some other errors I also changed the source list file.
I found the solution.
In my case it has to do with my sourcelist file in etc/apt directory.
I updated the file
# deb cdrom:[Ubuntu-Studio 16.04 LTS _Xenial Xerus_ - Alpha amd64 (20151225)]/ xenial main multiverse restricted universe
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted
bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://archive.ubuntu.com/ubuntu/ xenial universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ xenial multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
Run:
sudo apt-get update
And to apply any updates, run one of the following commands:
sudo apt-get upgrade
See the Answer

Can't install libmysqlclient-dev package when building dockerfile with ubuntu

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