Score:0

After Update to 21.04 Apache Not Fully Installed and JavaScript Not Working

cn flag

Apache is running and is serving pages but it seems to have been only partially updated during the upgrade and prevents further updates.

sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
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] y

Setting up apache2 (2.4.46-4ubuntu1.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)

On the above, note all the zeros and 1 not fully installed or removed. I do not want to remove Apache2 but simply want to repair it in order to complete the upgrade so how do I proceed?

One thing I noted in running the development sites is that JavaScript appears to not work but not sure what is needed to repair it. Seeing the error with javascript-common and having read that it can be removed, I tried to do so in order to finalize the apache2 update but still no Javascript on the sites that use it but the errors above seem to be gone now. Javascripts were working before the version upgrade.

sudo apt-get purge javascript-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  javascript-common*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 33.8 kB disk space will be freed.
Do you want to continue? [Y/n] y

(Reading database ... 740588 files and directories currently installed.)
Removing javascript-common (11+nmu1) ...
Package apache2 is not configured yet. Will defer actions by package javascript-common.
Setting up apache2 (2.4.46-4ubuntu1.1) ...
apache-htcacheclean.service is a disabled or a static unit not running, not starting it.
(Reading database ... 740583 files and directories currently installed.)
Purging configuration files for javascript-common (11+nmu1) ...
apache2_invoke javascript-common postrm: No action required
Score:0
om flag

One thing I noted in running the development sites is that JavaScript appears to not work but not sure what is needed to repair it. Seeing the error with javascript-common and having read that it can be removed, I tried to do so but still no Javascript on the sites that use it but the errors above seem to be gone now.

This is unlikely to be related to the javascript-common package.

Javascript on web pages is simply static data, served from the webserver to the client, and executed by the client. The server doesn't need to have any javascript libraries; it only needs to serve it with the correct mime type, which any stock Apache2 should do by itself.

If you have javascript not working in webpages, that's probably not related to the server, but to the web page, and you have to debug it using tools in the browser (or similar development environment).

javascript-common contains a few libraries, such as jquery, sphinxdoc and underscore, and Apache config for making these available under /javascript. It does not modify mime types sent by Apache, which is what should matter for your web development.

DonP avatar
cn flag
The same code runs perfectly on the live server and was working here on the development system too until updating Ubuntu to from 20.10 to 21.04. On another PC it completely crashed Apache but here it did not, fortunately.
vidarlo avatar
om flag
Then you should probably concentrate on debugging that. It's unlikely to be related to javascript-common package.
DonP avatar
cn flag
I'll try to re-phrase my question as I know it isn't related to javascript-common. I was trying to say only that there were update errors relating to apache2 until I uninstalled javascript-common which was the only way to get passed the errors.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.