I originally installed the LAMP package on installation of the server. Took me ages to get the web server to work and then I found that PHP hadnt been installed as part of the package, which is odd as it should have been. I also tried to install SSH server so I could log in using Putty. Any time I try to install anything I get the following:-
jim@Unseen:~$ sudo apt-get -f install php libapache2-mod-php php-mcrypt php-mysq
l
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-php is already the newest version (1:7.0+35ubuntu6.1).
php-mysql is already the newest version (1:7.0+35ubuntu6.1).
The following additional packages will be installed:
libmcrypt4 php7.0 php7.0-mcrypt
Suggested packages:
libmcrypt-dev mcrypt
The following NEW packages will be installed
libmcrypt4 php php-mcrypt php7.0 php7.0-mcrypt
0 to upgrade, 5 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/83.5 kB of archives.
After this operation, 326 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
I've tried apt-get clean. I've tried the standard apt-get. I've run apt-get update. Nothing I try seems to work. Can anyone suggest anything to help me please. I am new to ubuntu and getting very frustrated with it. Thanks in advance
Edit:
I tried the fix suggested on a similar post that refers to 14.0* although my server is 16.04.4:-
sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};' >> /etc/apt/apt.conf.d/70debconf"
This did not work and reported that 70debconf did not exist.
Edit 2
I corrected the command string as suggested to:-
sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {\"/usr/sbin/dpkg-preconf
igure --apt || true\";};' >> /etc/apt/apt.conf.d/70debconf"
It returned a prompt with no messages so I presume it worked
I then ran the following:-
sudo apt-get install openssh-server
And returned exactly the same as before:-
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ncurses-term openssh-sftp-server python3-requests python3-urllib3
ssh-import-id
Suggested packages:
ssh-askpass rssh molly-guard monkeysphere python3-ndg-httpsclient
python3-openssl python3-pyasn1
The following NEW packages will be installed
ncurses-term openssh-server openssh-sftp-server python3-requests
python3-urllib3 ssh-import-id
0 to upgrade, 6 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/746 kB of archives.
After this operation, 5,652 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
Edit 3
A thought occurred to me after some terrific help. Before these problem started I installed Webmin as a quick way to remotely access the server from my desktop. I tried to to install Openssh-server through webmin and to my surprise it worked. So the conclusion looks like webmin has somehow interfered with the native functions on the server. I'm sure this shouldn't happen and wonder if I should report it.
There's a problem with initial answer, the inner set of double quotes need to be escaped
I can confirm that /etc/apt/apt.conf.d/70debconf exists on both my Ubuntu 16.04 and Ubuntu 17.10 boxes. The contents of this file on my Ubuntu 16.04 box are