Error while attempting to install apache2 - E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution) - apache

When I try to install apache, I have got the following error.
sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
apache2 : Depends: apache2-bin (= 2.4.18-2ubuntu3.13) but it is not going to be installed
Depends: apache2-utils (>= 2.4) but it is not going to be installed
Depends: apache2-data (= 2.4.18-2ubuntu3.13) but it is not going to be installed
Recommends: ssl-cert but it is not going to be installed
golang-1.6 : Depends: golang-1.6-go (>= 1.6.2-0ubuntu5~16.04.4) but it is not going to be installed
golang-1.6-doc : Depends: golang-1.6-go but it is not going to be installed
golang-go : Depends: golang-1.6-go but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I have tried running
sudo apt-get update
This also did not fix the issue.
Can anyone help me to understand this problem?

Try:
sudo apt-get -f install apache2

I just removed golang completely.
sudo find /var/lib/apt/lists -type f |xargs rm -f >/dev/null
sudo dpkg --remove golang-go
This link was useful : https://askubuntu.com/questions/252777/how-can-i-resolve-dpkg-dependency
After this, I did update. Then apache2 got installed successfully.
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Fri 2019-10-18 11:50:14 UTC; 2min 3s ago
Docs: man:systemd-sysv-generator(8)
CGroup: /system.slice/apache2.service
├─5661 /usr/sbin/apache2 -k start
├─5664 /usr/sbin/apache2 -k start
└─5665 /usr/sbin/apache2 -k start
Thanks for all the responses!!

Related

Can't install SQL Server command-line tools on Ubuntu due to `unmet dependencies`

After sucessfully installing Sql Server Following the docs, Failed to install SQL Server command-line tools on Ubuntu 20.04. Efforts led to below commands and results:
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
sudo apt-get update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:3 http://x.archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://x.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://x.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 ... packages . microsoft . com/ubuntu/18.04/mssql-server-2019 bionic InRelease
Hit:7 ... packages . microsoft . com/ubuntu/20.04/prod focal InRelease
Hit:8 ... download . gocd . org InRelease
Hit:9 ... packages . microsoft . com/ubuntu/18.04/prod bionic InRelease
Get:10 ... security . ubuntu . com/ubuntu focal-security/main amd64 DEP-11 Metadata [21.3 kB]
Get:11 ... security . ubuntu . com/ubuntu focal-security/universe amd64 DEP-11 Metadata [31.5 kB]
Fetched 160 kB in 17s (9,288 B/s)
Reading package lists... Done
sudo apt-get install mssql-tools unixodbc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
mssql-tools is already the newest version (17.5.2.1-1).
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:
mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed
unixodbc-dev : Depends: unixodbc (= 2.3.7)
Depends: odbcinst1debian2 (= 2.3.7) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried following the dependency failure tree to install unmet dependencies manually but in the final step failed to install:
sudo apt-get install multiarch-support
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package multiarch-support is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'multiarch-support' has no installation candidate
How would you solve these issues to finally install the Command line?
Using:
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
Instead of:
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
Solves the issue, The docs are out dated or maybe Ubuntu 20.04 is not officially supported yet...
Also I wasn't able to use curl https://... (Don't know why always peer closed my connection!) so I manually downloaded the link and paste the result to /etc/apt/sources.list.d/msprod.list

How to install GD library on ubuntu server?

when I tried this line " apt-get install php7.0-gd php7.0" I got below error :
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libapache2-mod-php7.0 : Depends: apache2-api-20120211
Depends: apache2-bin but it is not going to be installed
Recommends: apache2 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

How can i get rid of "apache2 : Depends: perl but it is not going to be installed" in ubuntu 14.04 desktop?

This is the error message i have at console when running
$sudo 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: perl but it is not going to be installed
Depends: apache2-bin (= 2.4.7-1ubuntu4) but it is not going to be installed
Depends: apache2-data (= 2.4.7-1ubuntu4) but 2.4.7-1ubuntu4.13 is to be installed
E: Unable to correct problems, you have held broken packages.
Output of update
$sudo apt-get update
Hit http://ppa.launchpad.net trusty InRelease
Ign http://in.archive.ubuntu.com trusty InRelease
Hit http://in.archive.ubuntu.com trusty Release.gpg
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty Release
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Hit http://in.archive.ubuntu.com trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty/main i386 Packages
Hit http://in.archive.ubuntu.com trusty/main Translation-en
Ign http://in.archive.ubuntu.com trusty/main Translation-en_IN
Reading package lists... Done
I have done recently
sudo rm -rf /var/lib/apt/lists/*
sudo rm /etc/apt/sources.list
Later i gone to
sudo -i software-properties-gtk
and checked the canonical checkbox then,
sudo apt-get update this command i executed.
can any one help me to install apache in my ubuntu!
try using sudo apt-get -f install to force the install.
You may need to go back and forth between sudo apt-get update and sudo apt-get -f install to slowly get all the packages installed.
Also try cleaning the cache and configuring any packages that are not configured yet.
sudo apt-get clean
sudo dpkg --configure -a
Hopefully that will get you where you need to be.

Error while installing passenger in ubuntu 12

I executed following commands to load passenger module:
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main > /etc/apt/sources.list.d/passenger.list'
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2 libapache2-mod-passenger
I got following errors:
The following packages have unmet dependencies:
libapache2-mod-passenger : Depends: libstdc++6 (>= 4.9) but 4.7.2-2ubuntu1 is to be installed
Depends: apache2-api-20120211 but it is not installable
Depends: passenger (= 1:5.0.26-1~jessie1) but it is not going to be installed
How to fix these errors?

unmet dependencies for libxml2

Trying to install libgdal-dev. The purpose is for use with liblas. Here is my attempt.
sudo apt-get install libgdal-dev ----> libgdal-dev : Depends: libdap-dev but it is not going to be installed
sudo apt-get install libdap-dev -----> libdap-dev : Depends: libxml2-dev but it is not going to be installed
sudo apt-get install libxml2-dev ----> libxml2-dev : Depends: libxml2 (= 2.8.0+dfsg1-5ubuntu2.1) but 2.8.0+dfsg1-5ubuntu2.2~precise1 is to be installed
Can't locate anything in synaptic relevant to the solution. seems like i might need to sudo udpate && sudo upgrade, which hasn't changed anything.
What should i do?
I have experienced this issue after upgrading from Ubuntu precise (12.04) to quantal (12.10). I believe something went wrong during the upgrade of libxml2, and the old version remained.
The way you can solve it is by downloading a newer build of libxml2 from the Quantal's lauchpad repositoring and installing it manually. Choose a build for your system, and install using:
sudo dpkg -i libxml2_2.8.0+dfsg1-5ubuntu2.1_amd64.deb
I couldn't solve it using apt-get/aptitude, as they seemed to detected the precise version as the latest.