Score:3

How to install Virtualbox 7.0.2 from .deb in Ubuntu Software Center after installing a Virtualbox beta?

jp flag

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

user535733 avatar
cn flag
You will get better help if you show the entire output.
pzrq avatar
jp flag
@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.
user535733 avatar
cn flag
Try installing from a shell prompt to capture the complete output.
user535733 avatar
cn flag
You can also look for output in /var/log/apt/term.log
pzrq avatar
jp flag
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 avatar
jp flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/140416/discussion-between-pzrq-and-user535733).
pzrq avatar
jp flag
@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 avatar
jp flag
@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
Score:2
jp flag

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.

Score:-1
jp flag

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

Nmath avatar
ng flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.