0

im using ubuntu 16 and need mysql-server lower than 5.7.28 i try this steps:

root@hr:~# apt-cache policy mysql-server-5.7
mysql-server-5.7:
  Installed: (none)
  Candidate: 5.7.28-0ubuntu0.16.04.2
  Version table:
     5.7.28-0ubuntu0.16.04.2 500
        500 http://il.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     5.7.11-0ubuntu6 500
        500 http://il.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

so i want to install the 5.7.11-0ubuntu6 package

root@hr:~# apt install mysql-server=5.7.11-0ubuntu6 -V
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
   mysql-client-5.7 (5.7.28-0ubuntu0.16.04.2)
   mysql-client-core-5.7 (5.7.28-0ubuntu0.16.04.2)
   mysql-common (5.7.28-0ubuntu0.16.04.2)
   mysql-server-5.7 (5.7.28-0ubuntu0.16.04.2)
   mysql-server-core-5.7 (5.7.28-0ubuntu0.16.04.2)
Suggested packages:
   mailx
   tinyca (0.7.5-6)
The following NEW packages will be installed:
   mysql-client-5.7 (5.7.28-0ubuntu0.16.04.2)
   mysql-client-core-5.7 (5.7.28-0ubuntu0.16.04.2)
   mysql-common (5.7.28-0ubuntu0.16.04.2)
   mysql-server (5.7.11-0ubuntu6)
   mysql-server-5.7 (5.7.28-0ubuntu0.16.04.2)
   mysql-server-core-5.7 (5.7.28-0ubuntu0.16.04.2)
0 upgraded, 6 newly installed, 0 to remove and 151 not upgraded.
Need to get 17.6 MB of archives.
After this operation, 155 MB of additional disk space will be used.
Do you want to continue? [Y/n]

if i click yes it will install al this packages after apt finishing installing the packages i check mysql -V but and getting

mysql  Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using  EditLine wrapper

what am i doing wrong ? how can i install the desired version ?

as @BanAnanas suggested i added the /etc/apt/preferences file with this lines:

Package: mysql-server-5.7
Pin: version 5.7.11-0ubuntu6
Pin-Priority: 1001

++++++++++++++++++++++++++++++++++++++++++++++++++++

root@hr:~# sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:2 http://il.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://il.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://il.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 325 kB in 8s (38.8 kB/s)
Reading package lists... Done


root@hr:~# sudo apt-get install mysql-server-5.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:
 mysql-server-5.7 : Depends: mysql-server-core-5.7 (= 5.7.11-0ubuntu6) but 5.7.28-0ubuntu0.16.04.2 is to be installed
E: Unable to correct problems, you have held broken packages.


root@hr:~# sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libaio1 libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl
  libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 151 not upgraded.


root@hr:~# sudo apt-get install mysql-server-5.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:
 mysql-server-5.7 : Depends: mysql-server-core-5.7 (= 5.7.11-0ubuntu6) but 5.7.28-0ubuntu0.16.04.2 is to be installed
E: Unable to correct problems, you have held broken packages.


root@hr:~# apt-cache policy mysql-server-5.7
mysql-server-5.7:
  Installed: (none)
  Candidate: 5.7.11-0ubuntu6
  Version table:
     5.7.28-0ubuntu0.16.04.2 500
        500 http://il.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     5.7.11-0ubuntu6 1001
        500 http://il.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

can i use synaptic on ubuntu server ?

3

1 Answer 1

0

The APT preferences file /etc/apt/preferences and the fragment files in the /etc/apt/preferences.d/ folder can be used to control which versions of packages will be selected for installation. By default, atp will never downgrade unless the priority of an available version exceeds 1000. To solve this you have to set priority of version 5.7.11-0ubuntu6 to 1001.

Open/create file:

sudo nano /etc/apt/preferences

Add this entry to the file and save it:

Package: mysql-server-5.7
Pin: version 5.7.11-0ubuntu6
Pin-Priority: 1001

Priority higher than 1000 causes a version to be installed even if this constitutes a downgrade of the package.

To apply the change run:

sudo apt-get install mysql-server-5.7
3
  • The following packages have unmet dependencies: mysql-server-5.7 : Depends: mysql-server-core-5.7 (= 5.7.11-0ubuntu6) but 5.7.28-0ubuntu0.16.04.2 is to be installed E: Unable to correct problems, you have held broken packages Jan 9, 2020 at 10:03
  • As @Organic Marble predicted, there are some dependencies issues. I suggest you try this solutions, and try to install again after each: 1) sudo apt-get update 2) (installing) and opening synaptic, Edit -> Fix broken Packages 3) sudo apt-get install -f
    – BanAnanas
    Jan 9, 2020 at 11:05
  • What's the new output of apt-cache policy mysql-server-5.7? Has priority changed to 1001 and which version is Candidate?
    – BanAnanas
    Jan 9, 2020 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.