3

How do I install Virtualbox 7.0.2 on Ubuntu 22.04 using the Ubuntu Software Center?

This is complicated by the fact I installed a Virtualbox 7 beta.

More specifcally, I get the following error when trying in Ubuntu Software Center using virtualbox-7.0_7.0.2-154219_Ubuntu_jammy_amd64.deb:

Unable to install virtualbox-7.0:
Error while installing package: new virtualbox-7.0 package
pre-installation script subprocess returned error exit status 1

I reproduced this error by downloading this .run file from virtualbox.org and running the following command:

sudo ./VirtualBox-7.0.0_BETA3-153872-Linux_amd64.run

As I'm playing with beta software I'm OK with something quick, dirty or hacky to get past the install error.

As requested by others, sadly /var/log/apt/term.log has little additional detail:

Log started: 2022-11-07  11:26:11
(Reading database ... 202648 files and directories currently installed.)
Preparing to unpack .../virtualbox-7.0_7.0.2-154219_Ubuntu_jammy_amd64.deb ...
dpkg: error processing archive /home/peter/Downloads/virtualbox-7.0_7.0.2-154219_Ubuntu_jammy_amd64.deb (--unpack):
 new virtualbox-7.0 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /home/peter/Downloads/virtualbox-7.0_7.0.2-154219_Ubuntu_jammy_amd64.deb
Log ended: 2022-11-07  11:26:12

error-repro

pzrq
  • 291
  • You will get better help if you show the entire output. – user535733 Nov 07 '22 at 00:48
  • @user535733 I'd love to, but Ubuntu Software Center does not show it or any obvious way to get it, it's from a pop up message. – pzrq Nov 07 '22 at 00:49
  • Try installing from a shell prompt to capture the complete output. – user535733 Nov 07 '22 at 00:53
  • You can also look for output in /var/log/apt/term.log – user535733 Nov 07 '22 at 00:54
  • Thanks, naturally I'm getting a totally different error now when trying to reproduce this for my own understanding if nothing else ... Unable to remove virtualbox-7.0: no packages to remove – pzrq Nov 07 '22 at 01:00
  • @Nmath Thanks for the question. There's a fair bit going on here so hopefully I've clarified it's to install as that's the larger goal and I don't think it can be separated from the Ubuntu Software Center error. – pzrq Nov 07 '22 at 01:25
  • @Nmath Thank you, in principle I agree. Hopefully in practice the fact that I did figure out which Virtualbox beta was installed, and was able to both reinstall and uninstall it successfully, will limit most potential or proven negative effects over time – pzrq Nov 07 '22 at 01:49

2 Answers2

2

A better solution as documented on the Virtualbox website would have been to firstly uninstall the beta:

sudo ./VirtualBox-7.0.0_BETA3-153872-Linux_amd64.run uninstall

Then to install as I wanted to:

# Optional - CLI alternative to Ubuntu Software Center
sudo dpkg -i virtualbox-7.0_7.0.2-154219_Ubuntu_jammy_amd64.deb

For completeness, to uninstall or remove:

# Again, this works in Ubuntu Software Center, though as an alternative
sudo dpkg -r virtualbox-7.0

Test builds for Linux hosts are generally packed up in a shell script installer with the extension ".run". To install them, you first need to remove your existing VirtualBox installation (but not your virtual machines - they will continue to work with the test build) and then execute the installer. To remove the test build again, execute the installer with the parameter "uninstall" on the command line.

pzrq
  • 291
-1

Pieced together a few things that worked for me in letting Ubuntu Software Center complete its install:

sudo rm -rf /var/lib/dpkg/info/virtualbox*
sudo rm -rf /opt/VirtualBox/
sudo rm /usr/bin/virtualbox

Where is the VirtualBox installation folder on Ubuntu?

https://unix.stackexchange.com/a/483418/273199

pzrq
  • 291
  • 1
    This isn't a safe way to remove software in Ubuntu. If software is installed with your package manager, you should use your package manager to remove it. Deleting application directories can result in a very broken system. – Nmath Nov 07 '22 at 01:19