I am in a little bit of a tough situation.
I upgraded my Ubuntu server from 16.04 to 18.04 but upgrade didn't go well. Now, it shows version 18.04 LTS on "lsb_release -a", and cannot install any packages because Apache doesn't want to upgrade to the default version on 18.04.
That is a Jira Server (v18.12 to be exact). As far as I understand, I cannot change the Apache version because of that. Now, when I try to install any packages, I get
root@jira:/# apt-get install netplan
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
apache2 : Depends: apache2-bin (= 2.4.18-2ubuntu3.17) but 2.4.29-1ubuntu4.21 is to be installed
Depends: apache2-data (= 2.4.18-2ubuntu3.17) but 2.4.29-1ubuntu4.21 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
apt --fix-broken install
command shows me this.
root@jira:/# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libasprintf0v5 liblua5.1-0 libxft2 libxxf86dga1 rename sgml-base xml-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apache2
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following packages will be upgraded:
apache2
1 upgraded, 0 newly installed, 0 to remove and 263 not upgraded.
139 not fully installed or removed.
Need to get 0 B/95.1 kB of archives.
After this operation, 26.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 99235 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.29-1ubuntu4.21_amd64.deb ...
Restoring lost conffile /etc/apache2/mods-available/cern_meta.load.
/var/lib/dpkg/tmp.ci/preinst: line 149: /etc/apache2/mods-available/cern_meta.load: No such file or directory
dpkg: error processing archive /var/cache/apt/archives/apache2_2.4.29-1ubuntu4.21_amd64.deb (--unpack):
new apache2 package pre-installation script subprocess returned error exit status 1
insserv: warning: script 'K01jira' missing LSB tags and overrides
insserv: warning: script 'jira' missing LSB tags and overrides
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; generated)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Mon 2022-02-21 19:09:14 CET; 7ms ago
Docs: man:systemd-sysv-generator(8)
Process: 21408 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)
Feb 21 19:09:14 jira systemd[1]: Starting LSB: Apache2 web server...
Feb 21 19:09:14 jira apache2[21408]: /etc/init.d/apache2: 46: .: Can't open /etc/apache2/envvars
Feb 21 19:09:14 jira apache2[21408]: /etc/init.d/apache2: 57: .: Can't open /etc/apache2/envvars
Feb 21 19:09:14 jira apache2[21408]: ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
Feb 21 19:09:14 jira systemd[1]: apache2.service: Control process exited, code=exited status=2
Feb 21 19:09:14 jira systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 21 19:09:14 jira systemd[1]: Failed to start LSB: Apache2 web server.
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.4.29-1ubuntu4.21_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Jira works fine! The problem is, server cannot send any email notifications at the moment. And I cannot ping anywhere (even google.com) from the console. I narrowed the situation down to the fact that I don't have any DNS servers configured on that box. And looking for a way to define any DNS servers without installing any packages.
May be there is an oldschool way to edit a conf file and bring back the internet?
I am a linux newbee and searching didn't give me much. Already spent hours on this and decided to ask for your opinion.
Thanks for your help!