0

I'm a newbie and I messed up with a server trying to reinstall apache2 and php, I did extensive searches inside this forum and in the interwebs but no solution for similar problems helped me. At the moment my web server downloads files instead of opening the web pages so i'm trying to reinstall apache2.

These are the main error i encounter:

E: Unable to correct problems, you have held broken packages. 
E: Package 'liblua5.2-0' has no installation candidate

with apt-get:

# apt-get install apache2
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:
 apache2 : Depends: apache2-bin (= 2.4.23-5.0+deb.sury.org~precise+2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

with aptitude:

# aptitude install apache2
The following NEW packages will be installed:
  apache2 apache2-bin{ab} apache2-data{a} apache2-utils{a} libapr1{a} 
  libaprutil1{a} libaprutil1-dbd-sqlite3{a} libaprutil1-ldap{a} ssl-cert{a} 
0 packages upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 1697 kB of archives. After unpacking 5691 kB will be used.
The following packages have unmet dependencies:
 apache2-bin : Depends: liblua5.2-0 which is a virtual package.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     apache2 [Not Installed]                            
2)     apache2-bin [Not Installed]                        



Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

I tried to reset the package list with combinations of:

# apt-get update
# apt-get upgrade
# apt-get dist-upgrade

I've also put a clean copy of source.list:

# curl https://repogen.simplylinux.ch/txt/precise/sources_e2fd9ed56e2187914ef4ae006a33c9cc299a8ee8.txt | sudo tee /etc/apt/sources.lis

might be there are package sources listed elsewhere ? I might have added or removed some important but can't remember where.

server operating system:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise

policy:

# apt-cache policy apache2 apache2-bin ssl-cert
apache2:
  Installed: (none)
  Candidate: 2.4.23-5.0+deb.sury.org~precise+2
  Version table:
     2.4.23-5.0+deb.sury.org~precise+2 0
        500 http://ppa.launchpad.net/ondrej/apache2/ubuntu/ precise/main i386 Packages
     2.2.22-1ubuntu1.11 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise-security/main i386 Packages
        500 http://it.archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
     2.2.22-1ubuntu1 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
apache2-bin:
  Installed: (none)
  Candidate: 2.4.23-5.0+deb.sury.org~precise+2
  Version table:
     2.4.23-5.0+deb.sury.org~precise+2 0
        500 http://ppa.launchpad.net/ondrej/apache2/ubuntu/ precise/main i386 Packages
ssl-cert:
  Installed: (none)
  Candidate: 1.0.28ubuntu0.1
  Version table:
     1.0.28ubuntu0.1 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1.0.28 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

Any help will be appreciated.

UPDATE:

cat /etc/apt/sources.list

#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS                             #
#------------------------------------------------------------------------------#


###### Ubuntu Main Repos
deb http://it.archive.ubuntu.com/ubuntu/ precise main 
deb-src http://it.archive.ubuntu.com/ubuntu/ precise main 

###### Ubuntu Update Repos
deb http://it.archive.ubuntu.com/ubuntu/ precise-security main 
deb http://it.archive.ubuntu.com/ubuntu/ precise-updates main 
deb-src http://it.archive.ubuntu.com/ubuntu/ precise-security main 
deb-src http://it.archive.ubuntu.com/ubuntu/ precise-updates main

cat /etc/apt/sources.list.d/*

deb http://ppa.launchpad.net/boost-latest/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/boost-latest/ppa/ubuntu precise main
deb http://ppa.launchpad.net/boost-latest/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/boost-latest/ppa/ubuntu precise main
deb https://deb.nodesource.com/node precise main
deb-src https://deb.nodesource.com/node precise main
deb https://deb.nodesource.com/node precise main
deb-src https://deb.nodesource.com/node precise main
deb http://ppa.launchpad.net/ondrej/apache2/ubuntu precise main
deb-src http://ppa.launchpad.net/ondrej/apache2/ubuntu precise main
# deb http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu precise main
# deb-src http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu precise main
# deb http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu precise main
# deb-src http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu precise main
deb http://ppa.launchpad.net/ondrej/php/ubuntu precise main
deb-src http://ppa.launchpad.net/ondrej/php/ubuntu precise main
deb http://ppa.launchpad.net/ondrej/php/ubuntu precise main
deb-src http://ppa.launchpad.net/ondrej/php/ubuntu precise main
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main

apt-get -o Debug::pkgProblemResolver=yes install apache2

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Starting
Starting 2
Investigating (0) apache2 [ i386 ] < none -> 2.4.23-5.0+deb.sury.org~precise+2 > ( web )
Broken apache2:i386 Depends on apache2-bin [ i386 ] < none -> 2.4.23-5.0+deb.sury.org~precise+2 > ( httpd ) (= 2.4.23-5.0+deb.sury.org~precise+2)
  Considering apache2-bin:i386 1 as a solution to apache2:i386 9999
    Reinst Failed early because of liblua5.2-0:i386
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:
 apache2 : Depends: apache2-bin (= 2.4.23-5.0+deb.sury.org~precise+2) but it is not going to be installed
E: Unable to correct problems, you have held broken package

apt-get check

eading package lists... Done
Building dependency tree       
Reading state information... Done

sudo dpkg -C

this outputs nothing

Riccardo
  • 193
  • I didn't find a solution following the links but i expanded my question with more details – Riccardo Oct 11 '16 at 13:07
  • i skipped the parts where i saw a window software center because i'm trying to fix a server i reach through ssh but this: sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse" allowed me to add Universe and Restricted from cli, solving the installation error. I still didn't manage to put the web server running tho – Riccardo Oct 11 '16 at 13:41

0 Answers0