When trying to update my system with sudo apt update
and sudo apt upgrade
, Apache2 is throwing an error and preventing my system from updating:
$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
isc-dhcp-client isc-dhcp-common
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up apache2 (2.4.52-1ubuntu4.1) ...
info: Executing deferred 'a2enconf javascript-common' for package javascript-common
ERROR: Conf javascript-common does not exist!
dpkg: error processing package apache2 (--configure):
installed apache2 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)
It says javascript-common
does not exist as Jos pointed out, but when I try to install it per his recommendation, it says otherwise:
$ sudo apt install javascript-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
javascript-common is already the newest version (11+nmu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Below are all the outputs I could think of to include, but I'm sure there's more information to be found. Unfortunately, I'm still pretty new to the terminal interface, and I'm not sure where else to look for troubleshooting info.
$ apache2 -v
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2022-06-14T12:30:21
$ apache2 -t
[Tue Aug 23 07:45:27.890824 2022] [core:warn] [pid 921747] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
I get the same message above when I try to run debug also:
$ apache2 -X
[Tue Aug 23 07:50:00.684706 2022] [core:warn] [pid 922041] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
When I navigate to /etc/apache2/apache2.conf
, line 80 says the following: DefaultRuntimeDir ${APACHE_RUN_DIR}
Any help troubleshooting this issue would be greatly appreciated! If it helps, the purpose of apache2 on this system is to host a web server of Bitwarden password manager.