1

Ubuntu Server 14.04

apt-get install <package>

produces the error:

E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there     
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true 

dpkg seems to be installed, see:

$ sudo apt-get install dpkg                                      
Reading package lists... Done                                                   
Building dependency tree                                                        
Reading state information... Done                                               
dpkg is already the newest version.                                             
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.                  

How can I repair this package?

I tried

sudo apt-get install --reinstall dpkg

but of course this action produces the same error.

1 Answer 1

1

this means there is some problems in your configuration scripts since the DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";}; doesn't exist so you have to create it.

Try this command to create it:

sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};' >> /etc/apt/apt.conf.d/70debconf"

To do it in steps:

open the /etc/apt/apt.conf.d/70debconf

 gksudo gedit /etc/apt/apt.conf.d/70debconf

Add this line and save it:

DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};

Now try again

3
  • Thanks for this advise. I saw this on another thread. HOwever, there seems to be an error in the syntax. It produces an error Apr 29, 2015 at 5:56
  • > sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};' >> /etc/apt/apt.conf.d/70debconf" --apt: 1: --apt: Syntax error: Unterminated quoted string sh: 1: true;};' >> /etc/apt/apt.conf.d/70debconf: not found Apr 29, 2015 at 5:57
  • Check the update
    – Maythux
    Apr 29, 2015 at 6:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .