0

I have been trying to install Lamp server in my Ubuntu 17.04 machine for a couple of days. When i try to install it from the terminal i'm getting this error.

root@hp-pc:~# sudo apt install lamp-server^
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libhttp-message-perl' for task 'lamp-server'
Note, selecting 'libencode-locale-perl' for task 'lamp-server'
Note, selecting 'mysql-client-5.7' for task 'lamp-server'
Note, selecting 'libevent-core-2.0-5' for task 'lamp-server'
Note, selecting 'libapache2-mod-php' for task 'lamp-server'
Note, selecting 'rename' for task 'lamp-server'
Note, selecting 'mysql-server-5.7' for task 'lamp-server'
Note, selecting 'php-common' for task 'lamp-server'
Note, selecting 'libaprutil1' for task 'lamp-server'
Note, selecting 'mysql-server' for task 'lamp-server'
Note, selecting 'libcgi-fast-perl' for task 'lamp-server'
Note, selecting 'libwrap0' for task 'lamp-server'
Note, selecting 'libhttp-date-perl' for task 'lamp-server'
Note, selecting 'perl-modules-5.24' for task 'lamp-server'
Note, selecting 'liblwp-mediatypes-perl' for task 'lamp-server'
Note, selecting 'libfcgi-perl' for task 'lamp-server'
Note, selecting 'libcgi-pm-perl' for task 'lamp-server'
Note, selecting 'libaprutil1-dbd-sqlite3' for task 'lamp-server'
Note, selecting 'libaio1' for task 'lamp-server'
Note, selecting 'libio-html-perl' for task 'lamp-server'
Note, selecting 'ssl-cert' for task 'lamp-server'
Note, selecting 'libperl5.24' for task 'lamp-server'
Note, selecting 'libapr1' for task 'lamp-server'
Note, selecting 'libaprutil1-ldap' for task 'lamp-server'
Note, selecting 'libhtml-tagset-perl' for task 'lamp-server'
Note, selecting 'mysql-client-core-5.7' for task 'lamp-server'
Note, selecting 'tcpd' for task 'lamp-server'
Note, selecting 'liblua5.2-0' for task 'lamp-server'
Note, selecting 'mysql-common' for task 'lamp-server'
Note, selecting 'libhtml-template-perl' for task 'lamp-server'
Note, selecting 'libtimedate-perl' for task 'lamp-server'
Note, selecting 'perl' for task 'lamp-server'
Note, selecting 'php-mysql' for task 'lamp-server'
Note, selecting 'libhtml-parser-perl' for task 'lamp-server'
Note, selecting 'liburi-perl' for task 'lamp-server'
Note, selecting 'mysql-server-core-5.7' for task 'lamp-server'
Note, selecting 'php7.0-mysql' for task 'lamp-server'
libaio1 is already the newest version (0.3.110-3).
libapache2-mod-php is already the newest version (1:7.0+49).
libapr1 is already the newest version (1.5.2-5).
libaprutil1 is already the newest version (1.5.4-3).
libaprutil1-dbd-sqlite3 is already the newest version (1.5.4-3).
libaprutil1-ldap is already the newest version (1.5.4-3).
libcgi-fast-perl is already the newest version (1:2.12-1).
libcgi-pm-perl is already the newest version (4.35-1).
libencode-locale-perl is already the newest version (1.05-1).
libevent-core-2.0-5 is already the newest version (2.0.21-stable-3).
libfcgi-perl is already the newest version (0.78-2).
libhtml-parser-perl is already the newest version (3.72-3).
libhtml-tagset-perl is already the newest version (3.20-3).
libhtml-template-perl is already the newest version (2.95-2).
libhttp-date-perl is already the newest version (6.02-1).
libhttp-message-perl is already the newest version (6.11-1).
libio-html-perl is already the newest version (1.001-1).
liblua5.2-0 is already the newest version (5.2.4-1.1build1).
liblwp-mediatypes-perl is already the newest version (6.02-1).
libperl5.24 is already the newest version (5.24.1-2ubuntu1).
libtimedate-perl is already the newest version (2.3000-2).
liburi-perl is already the newest version (1.71-1).
libwrap0 is already the newest version (7.6.q-26).
perl is already the newest version (5.24.1-2ubuntu1).
perl-modules-5.24 is already the newest version (5.24.1-2ubuntu1).
php-common is already the newest version (1:49).
rename is already the newest version (0.20-4).
ssl-cert is already the newest version (1.0.38).
tcpd is already the newest version (7.6.q-26).
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:
 php7.0-mysql : Depends: php7.0-common (= 7.0.15-1ubuntu4) but 7.0.22-0ubuntu0.17.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

So i tried to install the package manually which shows unmet dependency

root@hp-pc:~# apt install php7.0-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php7.0-common is already the newest version (7.0.22-0ubuntu0.17.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

As it says that package is already installed i tried to install php7.0-mysql manually.

root@hp-pc:~# apt install php7.0-mysql
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:
 php7.0-mysql : Depends: php7.0-common (= 7.0.15-1ubuntu4) but 7.0.22-0ubuntu0.17.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

To fix the held broken packages i tried the following commands.

root@hp-pc:~# sudo apt-get clean
root@hp-pc:~# 

also

 root@hp-pc:~# sudo apt update
    Ign:1 http://ppa.launchpad.net/jonathonf/backports/ubuntu zesty InRelease 
    Get:2 https://repo.skype.com/deb stable InRelease [4,487 B]                          
    Get:3 https://repo.skype.com/deb stable/main amd64 Packages [1,442 B]                                                                     
    Hit:4 http://us.archive.ubuntu.com/ubuntu zesty InRelease                                                                      
    Ign:5 http://ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu zesty InRelease           
    Ign:6 http://dl.google.com/linux/chrome/deb stable InRelease                                       
    Hit:7 http://dl.google.com/linux/chrome/deb stable Release               
    Hit:8 http://ppa.launchpad.net/mozillateam/thunderbird-next/ubuntu zesty InRelease
    Hit:10 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu zesty InRelease  
    Hit:11 http://ppa.launchpad.net/papirus/papirus/ubuntu zesty InRelease         
    Err:12 http://ppa.launchpad.net/jonathonf/backports/ubuntu zesty Release       
      404  Not Found
    Err:13 http://ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu zesty Release
      404  Not Found
    Reading package lists... Done                      
    E: The repository 'http://ppa.launchpad.net/jonathonf/backports/ubuntu zesty 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/kirillshkrogalev/ffmpeg-next/ubuntu zesty 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.

and this as well.

root@hp-pc:~# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@hp-pc:~# 
root@hp-pc:~# 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.

Still the issue is not fixed. Please advice.. thanks in advance. Also please note i have already gone through this answer.

Second Day

Managed to fix the previous error with the help of @zapoxkrishna. Now it showing the following error.

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.20-0ubuntu0.17.04.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.20-0ubuntu0.17.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I manually removed that file using rm command and tried to install again. Still getting the same error. Kindly advise.

Rooney
  • 965
  • Read answer #140246 again. You very likely still have non-Ubuntu software on your system that you must remove. – user535733 Oct 30 '17 at 13:37

1 Answers1

0

Take the backup of your existing sources.list and try this sudo gedit /etc/apt/sources.list then delete the whole content and generate the new sources.list from here https://repogen.simplylinux.ch/ and paste the new generated content to sources.list

finally try this sudo apt-get update and then sudo apt install lamp-server^ it will work