Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Can anyone help me removed VirtualBox?

By the way, I couldn't install some softwares, is it because it is a 64-bit version?

share|improve this question
2  
open ubuntu software center an remove from there.... –  penreturns Sep 18 '12 at 3:48
    
Try this sudo apt-get purge virtualbox* –  blade19899 Sep 18 '12 at 7:00
add comment

2 Answers

To 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.

Explanation

  • 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.

What does purge do here?

purge removes global configuration files only. It does not remove virtual machines, so it's safe to use. However:

  • It also doesn't remove most of the settings you might think it would. Remember, it removes global configuration files only. It does not remove any configuration files created by users that exist in their home directories and define how VirtualBox is configured for them.
  • Configuration files rarely take up a lot of space. If your goal is to free space but you think you may want to use VirtualBox again, you might prefer not to use purge.

Also, please note: apt-get --purge remove ... is the same as apt-get purge ....

share|improve this answer
    
Thank you, this is an exemplary answer! Very detailed written which makes it helpful for inexperienced users such as me :) –  king_julien Sep 7 '13 at 8:19
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.