Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1359  / 2 Years ago, tue, july 5, 2022, 4:53:49

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.


More From » apt

 Answers
3

The problem showed up when I actually had a error caused by php7.4 residual files when it was upgraded to 8.1. The left over files that needed to be removed, php7.4.load and php7.4.conf.


To remove them I ran:
sudo find /etc/apache2 -name "php7.4*" -delete
which removed php7.4.load and php7.4.conf from /etc/apache2/mods-available and /etc/apache2/mods-enabled.


I also removed /etc/php/7.4 as it was no longer installed.


----Edit----
To fix the javascript-common problem, I just purged and reinstalled the package with sudo apt purge javascript-common; sudo apt install javascript-common


[#286] Wednesday, July 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rofity

Total Points: 182
Total Questions: 98
Total Answers: 115

Location: Albania
Member since Sat, Jan 7, 2023
1 Year ago
rofity questions
Mon, Apr 25, 22, 12:28, 2 Years ago
Sat, Apr 8, 23, 05:32, 1 Year ago
Mon, May 10, 21, 22:51, 3 Years ago
Tue, May 17, 22, 02:46, 2 Years ago
;