Can anyone help me remove VirtualBox?
I am running 12.04.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityTo remove VirtualBox, I actually recommend running this command and not replacing *
with anything (just run it exactly like so):
sudo apt-get remove virtualbox-\*
If you want to remove global configuration files too (this does not remove your virtual machines), run exactly this instead:
sudo apt-get purge virtualbox-\*
That method is OK, but this way may be more thorough.
You may have multiple VirtualBox-related packages installed. Assuming your machine no longer needs to be a VirtualBox host or guest machine, all these packages can go. For example, on the 11.10 box I'm using right now, there are 18 such packages available for installation (your machine might have some or even all of them, or other packages from your release or a PPA):
virtualbox virtualbox-ose
virtualbox-dbg virtualbox-ose-dbg
virtualbox-dkms virtualbox-ose-dkms
virtualbox-fuse virtualbox-ose-fuse
virtualbox-guest-additions virtualbox-ose-guest-dkms
virtualbox-guest-additions-iso virtualbox-ose-guest-utils
virtualbox-guest-dkms virtualbox-ose-guest-x11
virtualbox-guest-utils virtualbox-ose-qt
virtualbox-guest-x11
Some are probably already not installed, and some may be removed automatically as a consequence of removing others, but some would not.
apt-get
accepts *
characters and treats them as part of a regular expression. This is in some ways similar to the way a command-line shell processes *
. When used in an apt-get
command, virtualbox-\*
(see below for why the \
, which is not being used as regular expression syntax) actually matches any package whose name contains virtualbox
.
(Be careful with this as applied to packages with shorter names! For example, wine\*
matches every package with win
--not just wine
--anywhere in its name.)
So you don't have to manually expand *
. It can stay, and it will catch the various related packages as described above, as well as packages with explicit versions in their names as discussed there.
However, the shell itself, which executes apt-get
with the command-line arguments you specify, also accepts wildcards. Therefore, you should escape the wildcard (and one way to do that is with a \
character before the *
). Otherwise, if your expression matches a file or folder in that current location, the shell would give its name to apt-get
, which would be wrong.
purge
removes global configuration files only. It does not remove virtual machines, so it's safe to use. However:
purge
.Also, please note: apt-get --purge remove ...
is the same as apt-get purge ...
.
apt-get
, aptitude
, and dpkg
. Make sure no other currently logged-in users (if any) are running any such software. This may include non-administrators, since by default they may allow the Software Updater to install updates. If that still doesn't fix it, see this question about the problem.
May 2, 2014 at 18:42
rm -rf ~/.config/VirtualBox
)
Open the terminal (Ctrl+Alt+T) and issue the command:
sudo apt-get purge virtualbox-*
Replace *
with the version of VirtualBox installed on your system (e.g. sudo apt-get purge virtualbox-4.2
).
Alternatively, you can make use the auto-complete feature in the terminal by hitting the Tab key after typing virtualbox
.
If you have Oracle VM VirtualBox and ubuntu 15.04
sudo dpkg -l | grep virtualbox
which shows something like this.
ii virtualbox-4.2 4.2.6-82870~Ubuntu~quantal amd64 Oracle VM VirtualBox
now from above command you can determine which version of virtual-box is installed on your machine.After this type these commands in your terminal,Just replace the 4.2 with your version of VirtualBox.
sudo apt-get purge virtualbox-4.2 virtualbox-qt
For me nothing helped but this
$ sudo /opt/VirtualBox/uninstall.sh
vboxdrv.sh: Stopping VirtualBox services.
VirtualBox 5.1.22 r115126 has been removed successfully.
$ sudo rm -rf /opt/VirtualBox/
Open the terminal and type:
sudo apt remove virtualbox unity-scope-virtualbox ^virtualbox-
If you installed VirtualBox from the Oracle website find your VirtualBox version as follows:
sudo apt install aptitude
aptitude search virtualbox\*
The latest version of VirtualBox that has Oracle VM VirtualBox
on the same line with it is the package you have installed. If you have the latest version of Oracle VirtualBox installed, it is named virtualbox-5.1
.
Verify that this version of Oracle VirtualBox is currently installed.
dpkg-query -s virtualbox-5.1
Uninstall Oracle VirtualBox using a command that looks like this:
sudo apt remove VirtualBox-5.1
If you have a different version of Oracle VirtualBox installed replace VirtualBox-5.1
in the above command with your VirtualBox version.
or use next command if you install vmbox from script:
sudo ./VirtualBox-4.1.4-74291-Linux_amd64.run remove
Use this command to completely remove the package:
sudo apt-get purge virtualbox-\*
sudo apt-get purge virtualbox*