VirtualBox won't update

Recently Virtualbox has given me quite a few problems when trying to update it.

These are the hoops I had to go through to solve the problem. Examples below.

 

 

Updating Virtualbox with yum

root@cyndane2:~ # yum update
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Setting up Update Process
Loading mirror speeds from cached hostfile
* base: ftp.lysator.liu.se
* elrepo: mirrors.coreix.net
* epel: ftp.lysator.liu.se
* extras: ftp.lysator.liu.se
* nux-dextop: mirror.li.nux.ro
* remi: mirror.netsite.dk
* remi-php71: mirror.netsite.dk
* remi-safe: mirror.netsite.dk
* updates: ftp.lysator.liu.se
Resolving Dependencies
--> Running transaction check
---> Package VirtualBox-6.0.x86_64 0:6.0.10_132072_el6-1 will be updated
---> Package VirtualBox-6.0.x86_64 0:6.0.12_133076_el6-1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved
==========================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================
Updating:
VirtualBox-6.0 x86_64 6.0.12_133076_el6-1 virtualbox 113 M

Transaction Summary
==========================================================================================================================================================================================
Upgrade 1 Package(s)

Total download size: 113 M
Is this ok [y/N]: y
Downloading Packages:
VirtualBox-6.0-6.0.12_133076_el6-1.x86_64.rpm | 113 MB 00:33
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
A copy of VirtualBox is currently running. Please close it and try again.
Please note that it can take up to ten seconds for VirtualBox (in particular
the VBoxSVC daemon) to finish running.
error: %pre(VirtualBox-6.0-6.0.12_133076_el6-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package VirtualBox-6.0-6.0.12_133076_el6-1.x86_64
error: install: %pre scriptlet failed (2), skipping VirtualBox-6.0-6.0.12_133076_el6-1
VirtualBox-6.0-6.0.10_132072_el6-1.x86_64 was supposed to be removed but is not!
Verifying : VirtualBox-6.0-6.0.10_132072_el6-1.x86_64 1/2
Verifying : VirtualBox-6.0-6.0.12_133076_el6-1.x86_64 2/2

Failed:
VirtualBox-6.0.x86_64 0:6.0.10_132072_el6-1 VirtualBox-6.0.x86_64 0:6.0.12_133076_el6-1

Complete!
root@cyndane2:~ #

 

 

I forgot, or so I thought...

My initial though was that I've forgotten to stop the running headless vm.

# vboxmanage controlvm "Ubuntu 16.04 Server x64 LTS" poweroff
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

#vboxmanage list runningvms

#

 

 

Updating again

When trying to update Virtualbox again it still gives me the error message, I looked into the Virtualbox daemons.

# service vboxautostart stop
# service vboxauto stop
# service vboxdrv stop

 

Yum update still fails with the previous error message.

# yum remove VirtualBox*

 

Giving error...

So let's removing the package with rpm instead then.

# rpm -qa Virtual*
VirtualBox-6.0-6.0.10_132072_el6-1.x86_64

# rpm -e VirtualBox-6.0-6.0.10_132072_el6-1.x86_64

 

Nope, it's still giving the error message... WTF!!

Also rebuilding the rpm database did nothing to alleviate the problem.

 

 

Google is my friend

Yes, it is. Sort of, anyway.

https://www.google.com/search?ei=QWNvXY6dH6L6qwGt-oKADQ&q=error%3A+%25preun%28VirtualBox+scriptlet+failed%2C+exit+status+1&oq=error%3A+%25preun%28VirtualBox+scriptlet+failed%2C+exit+status+1&gs_l=psy-ab.3..35i302i39.4334.6801..7231...0.0..0.77.2062.34......0....1..gws-wiz.oZb85-mQmt0&ved=0ahUKEwjOwZmizrbkAhUi_SoKHS29ANAQ4dUDCAs&uact=5

https://askubuntu.com/questions/827733/removing-virtualbox-5-1-in-a-stuck-state

https://www.google.com/search?q=Please+note+that+it+can+take+up+to+ten+seconds+for+VirtualBox+(in+particular+the+VBoxSVC+daemon)+to+finish+running.&oq=Please+note+that+it+can+take+up+to+ten+seconds+for+VirtualBox+(in+particular+the+VBoxSVC+daemon)+to+finish+running.&aqs=chrome..69i57.513j0j7&sourceid=chrome&ie=UTF-8

 

Nothing worked until I found this one.

https://forums.fedoraforum.org/archive/index.php/t-100778.html

Specifically these commands, each one in turn.

# rpm -e VirtualBox-6.0-6.0.10_132072_el6-1.x86_64 --noscripts

# rpm -qa Virtual*

#

 

Woo-hoo, it's gone! Not sure what the --noscripts flag does, but it produces what I want. Will read up on this later.

Now running this works too.

# yum install VirtualBox-6.0

 

 

Sources

See inline URLs above.

 

 

 

 

 

 

 

 

 

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext