'cannot install libapache2-mod-fcgid apache mod

hello i trying to install libapache2-mod-fcgid mod but have always get error.

root@mail:~# sudo apt-get install libapache2-mod-fcgid
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:
 libapache2-mod-fcgid : Depends: apache2.2-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

and without fcgid mod i cannot launch apache server

root@mail:~# service apache2 restart
 * Restarting web server apache2                                         [fail]
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/fcgid.load: Cannot load /usr/lib/apache2/modules/mod_fcgid.so into server: /usr/lib/apache2/modules/mod_fcgid.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

apache version 2.4



Solution 1:[1]

I know it is a bit late for a response but, since there is no answer yet, I'll put one.

In this situation, the dependencies from libapache2-mod-fcgid are not met. In this case, you could download and install apache2.2-common prior the installation of libapache2-mod-fcgid like this:

sudo apt-get install apache2.2-common

and then try your install command afterward.

Solution 2:[2]

This worked for me: Ubuntu 21.10 in year 2022:

sudo apt-get install -y libapache2-mod-fcgid

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David Medenjak
Solution 2 Peter VARGA