0

I'm a newbie Linux user and I've just had installed Ubuntu 18.04 alongside Windows 10. It was installed not 100% succesfully because everytime I want to install a new program (e.g adobe flash player), the terminal shows me this:

The following packages have unmet dependencies:
 fwupdate : Depends: libfwup1 (= 10-3) but 12-3bionic2 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

And when I try sudo apt --fix-broken install, the terminal returns:

Preparing to unpack .../fwupdate_12-7~ubuntu18.04.3_amd64.deb ...
rm: cannot remove '/boot/efi/EFI/ubuntu/fwupx64.efi': Input/output error
dpkg: error processing archive /var/cache/apt/archives/fwupdate_12-7~ubuntu18.04.3_amd64.deb (--unpack):
 new fwupdate package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/fwupdate_12-7~ubuntu18.04.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

It's a Sony Vaio laptop. 1TB HDD - CPU: i7 3537U - RAM: 8GB

2
  • 1
    run sudo apt-get update --fix-missing and then sudo apt --fix-broken install and sudo apt-get install -f. see if works.
    – Ajay
    Jul 15, 2020 at 6:25
  • The same as before, when I run 'sudo apt --fix-broken install' it returns me the same text line as above. Jul 15, 2020 at 17:09

1 Answer 1

0

I think there is the answer to your problem in this post: dpkg: new pre-installation script returned error exit status 1

The package's .preinst script is failing for some reason.

To find out why, examine the script in /var/lib/dpkg/info/PACKAGENAME.preinst

If you want to see exactly which line the script is failing on, edit the .preinst script and add set -x immediately after the #! line. This turns on execution tracing in the script.

NOTE: This assumes that the .preinst script is a shell script (either posix sh or bash). Almost all .preinst (and .postinst, .prerm, and .postrm) scripts are shell scripts but they don't have to be, they could be any executable. e.g. on my main desktop machine with 9104 packages installed, 14 are perl scripts, 1 is a compiled executable (bash's preinst - it can't assume there is a functioning shell already installed), and all of the rest are shell scripts...9041 are POSIX shell scripts, 63 are bash scripts. If the .preinst is perl or python or something else, you'll have to figure out how to enable debugging or execution trace mode or similar in that language.

Then run dpkg --configure --pending.

This will cause dpkg to try to configure the half-installed package. DO NOT reinstall it with dpkg -i, that will overwrite your edited .preinst script with the version in the .deb package.

This may give you enough information to fix the problem. It may be something simple like an unexpected or uncaught exit code from a program (most .preinst etc scripts have set -e, to make them terminate on the first error), or assuming that a directory already exists (and this may be due to an undeclared dependency in the package's debian/control file - i.e it should depend on foo but doesn't. just install foo anyway)

Once it's fixed, run dpkg --configure --pending again, and the package should be properly installed.

If the .preinst script is buggy, there's a reasonable chance that the .postinst (and/or .prerm and .postrm) scripts will be too. You may need to fix them as well.

Don't forget to submit a bug report to whoever made the package so they can fix it.

2
  • Hi, thanks for the answer, but I don't know how to do this: To find out why, examine the script in /var/lib/dpkg/info/PACKAGENAME.preinst Jul 15, 2020 at 18:12
  • in your case it should be fwupdate.preinst. you can do one thing open folder /var/lib/dpkg/info and search for this file.
    – Ajay
    Jul 15, 2020 at 18:43

You must log in to answer this question.

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