Whenever I try to install anything I get this error (this error is when I try to install firefox)
Setting up virtualbox-ext-pack (5.0.40-0ubuntu1.16.04.1) ...
/var/lib/dpkg/info/virtualbox-ext-pack.postinst: 18: cd: can't cd to /usr/share/virtualbox-ext-pack
dpkg: error processing package virtualbox-ext-pack (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
Whenever I try to unistall anything I get this error (this error I get when trying to remove virtualbox)
Removing virtualbox-ext-pack (5.0.40-0ubuntu1.16.04.1) ...
/var/lib/dpkg/info/virtualbox-ext-pack.prerm: 4: /var/lib/dpkg/info/virtualbox-ext-pack.prerm: vboxmanage: not found
dpkg: error processing package virtualbox-ext-pack (--purge):
subprocess installed pre-removal script returned error exit status 127
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
Earlier I had tried to install VMware but my laptop does not support required technology and every attempt to get around it failed!
I tried to remove virtualbox with methods described here and this is the result:
Do you want to continue? [Y/n] y
(Reading database ... 873830 files and directories currently installed.)
Removing virtualbox-ext-pack (5.0.40-0ubuntu1.16.04.1) ...
/var/lib/dpkg/info/virtualbox-ext-pack.prerm: 4: /var/lib/dpkg/info/virtualbox-ext-pack.prerm: vboxmanage: not found
dpkg: error processing package virtualbox-ext-pack (--purge):
subprocess installed pre-removal script returned error exit status 127
Removing virtualbox-qt (5.0.40-dfsg-0ubuntu1.16.04.1) ...
Purging configuration files for virtualbox-qt (5.0.40-dfsg-0ubuntu1.16.04.1) ...
dpkg: virtualbox: dependency problems, but removing anyway as you requested:
virtualbox-ext-pack depends on virtualbox (>= 5.0.40-dfsg-0~) | virtualbox-5.0; however:
Package virtualbox is to be removed.
Package virtualbox-5.1 which provides virtualbox is not installed.
Package virtualbox-5.0 is not installed.
virtualbox-ext-pack depends on virtualbox (<< 5.0.40-dfsg-z) | virtualbox-5.0; however:
Package virtualbox is to be removed.
Package virtualbox-5.1 which provides virtualbox is not installed.
Package virtualbox-5.0 is not installed.
virtualbox-ext-pack depends on virtualbox (>= 5.0.40-dfsg-0~) | virtualbox-5.0; however:
Package virtualbox is to be removed.
Package virtualbox-5.1 which provides virtualbox is not installed.
Package virtualbox-5.0 is not installed.
virtualbox-ext-pack depends on virtualbox (<< 5.0.40-dfsg-z) | virtualbox-5.0; however:
Package virtualbox is to be removed.
Package virtualbox-5.1 which provides virtualbox is not installed.
Package virtualbox-5.0 is not i
Removing virtualbox (5.0.40-dfsg-0ubuntu1.16.04.1) ...
Purging configuration files for virtualbox (5.0.40-dfsg-0ubuntu1.16.04.1) ...
dpkg: warning: while removing virtualbox, directory '/usr/lib/virtualbox/ExtensionPacks' not empty so not removed
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
While trying sudo apt-upgrade
I got this:
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
virtualbox-ext-pack : Depends: virtualbox (>= 5.0.40-dfsg-0~) or
virtualbox-5.0 but it is not installable
Depends: virtualbox (< 5.0.40-dfsg-z) or
virtualbox-5.0 but it is not installable
E: Unmet dependencies. Try using -f.
Let us hope that one or more of the commands by @oldfred and some other experienced users in the following list can help you.
If it doesn't help, this forum thread has additional suggestions:
GPG key error when attemting to download updates