1

This problem occured while installing virtualbox-5.0_5.0.8-103449~Ubuntu~trusty_i386.deb, what should I do?

screenshot

kos
  • 35,891
  • Try to remove virtualbox first: sudo apt-get remove virtualbox, however mind that is suggested to install from apt-get instead of from a .deb package when possible. – kos Oct 28 '15 at 13:32
  • i cannot remove this when i write this command in terminal it shows: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? – Ramchandra Shahi Thakuri Oct 28 '15 at 13:37
  • Did you use sudo? sudo apt-get remove virtualbox – kos Oct 28 '15 at 13:57
  • yes i used it but it show the error: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? – Ramchandra Shahi Thakuri Oct 28 '15 at 14:06
  • That message should pop up if you're not root. Make sure any instance of Ubuntu Software Center and of Software & Updates is closed before retrying, despite the message suggesting else probably something is using apt-get. – kos Oct 28 '15 at 14:11

1 Answers1

3

When upgrading Virtual Box to a newer major release version (e.g. from 4.x to 5.x) we need to remove the older version first to be able to proceed.

Removal of a package depends on how you had installed it. In most cases you can use the Software Center to remove installed packages. In case you had installed Virtual Box from the repositories it is the package virtualbox you will have to remove.

If a package is not listed there, or if we had installed it from another source we may also issue the following command in a terminal (for removal of virtualbox 4.0):

sudo apt-get remove virtualbox-4.0

Note that your settings and your existing virtual machines will stay untouched, they will not be removed.

After that we can safely re-install Virtual Box from a DEB file we had downloaded, or by adding the Oracle repository to our sources, which will always install the most recent version (at present 5.0.8). After upgrading Virtual Box we should also upgrade the Guest Additions in our virtual machines.

Takkat
  • 142,284