libapache2-mod-fastcgi is not available

Posted July 22, 2015 36.6k views

I get an error when I enter this command:

sudo apt-get install apache2 apache2-utils libapache2-mod-suphp libapache2-mod-fastcgi libapache2-mod-python libapache2-mod-fcgid apache2-suexec libapache2-mod-php5 php5 php5-fpm php5-gd php5-mysql php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-xcache php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-imap php5-cgi php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libruby memcached phpmyadmin postfix postfix-mysql postfix-doc mysql-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve mailman amavisd-new spamassassin clamav clamav-daemon zoo unzip zip arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl libnet-dns-perl bind9 dnsutils vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl squirrelmail pure-ftpd-common pure-ftpd-mysql snmp

And this error!!

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libapache2-mod-fastcgi 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 ‘libapache2-mod-fastcgi’ has no installation candidate

1 comment
  • Do this:

    • sudo nano /etc/apt/sources.list

    Find the 3 lines that match the below lines in that file (the red text might differ depending upon your Ubuntu version)

    deb trusty main
    deb trusty-updates main
    deb  trusty-security main

    and append multiverse to the end of them:

    deb trusty main multiverse
    deb  trusty-updates main multiverse
    deb  trusty-security main multiverse

    Do not delete any other words at the end of the lines like main or universe .

    Save and quit the file.

    Then run:

    • sudo apt-get update

    Then install the package again with:

    • sudo apt-get install libapache2-mod-fastcgi

    Hope this helps!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Thanks for answer. This working :)

@5car1z : I beg to differ. The “multiverse” lines are in fact commented out and the user just need to uncomment them in the apt repository. Once uncommented, user should run

sudo apt-get update

Once updated, the user will be able to install mod-fastcgi for apache.

@akacar : Hope the above explanation is clear for your understanding! Also, can you confirm if you plan to use mod-fastcgi or mod-php? Your install statement includes “libapache2-mod-php5” as well as “libapache2-mod-fastcgi”. This is unusual and undesirable for a web-stack install because only one can be used at a time!

  • There’s quite a few Google search results showing how people go about fixing this, which is the way I showed.

    The layout, format, and content of sources.list will differ from user to user depending upon the Ubuntu version (among other things), so this is probably why as you said in your instance you could simply just uncomment the multiverse entries.

    Just to verify this I created a new Ubuntu 14.04 droplet and also got this error when I tried installing the package. After amending the sources.list file like I demonstrated the error was fixed, and the package installs correctly…