When upgrading to a new version of tomcat7, I expect the upgrade to complete succesfully.
Actual Result
=============
When upgrading to a new version of tomcat7, the upgrade fails when running the post install script due to an unescaped "$" in a regular expression.
Setting up tomcat7 (7.0.52-1ubuntu0.10) ...
sed: -e expression #1, char 97: unknown option to `s'
dpkg: error processing package tomcat7 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
tomcat7
E: Sub-process /usr/bin/dpkg returned an error code (1)
vi /var/lib/dpkg/info/tomcat7.postinst
# change line 25 from:
| sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"$JAVA_OPTS\"%" \
# to
| sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"\$JAVA_OPTS\"%" \
Ubuntu 14.04.5 LTS
Tomcat7 7.0.52-1ubuntu0.10
Expected Result
===============
When upgrading to a new version of tomcat7, I expect the upgrade to complete succesfully.
Actual Result
=============
When upgrading to a new version of tomcat7, the upgrade fails when running the post install script due to an unescaped "$" in a regular expression.
Setting up tomcat7 (7.0.52- 1ubuntu0. 10) ...
sed: -e expression #1, char 97: unknown option to `s'
dpkg: error processing package tomcat7 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
tomcat7
E: Sub-process /usr/bin/dpkg returned an error code (1)
The relevant line of regex is here: bazaar. launchpad. net/~ubuntu- branches/ ubuntu/ trusty/ tomcat7/ trusty- security/ view/head: /debian/ tomcat7. postinst# L25
http://
It appears to also exist in the latest vivid package bazaar. launchpad. net/~ubuntu- branches/ ubuntu/ vivid/tomcat7/ vivid/view/ head:/debian/ tomcat7. postinst# L25
http://
Resolution
==========
vi /var/lib/ dpkg/info/ tomcat7. postinst OPTS=.* $%JAVA_ OPTS=\" $JAVA_OPTS\ "%" \ OPTS=.* $%JAVA_ OPTS=\" \$JAVA_ OPTS\"% " \
# change line 25 from:
| sed "s%^JAVA_
# to
| sed "s%^JAVA_
And then running:
dpkg --configure tomcat7
This I believe may be causing a number of other bug reports such as: /bugs.launchpad .net/ubuntu/ +source/ tomcat7/ +bug/1595880 /bugs.launchpad .net/ubuntu/ +source/ tomcat7/ +bug/1604805
https:/
https:/