• Skip to main content
  • Skip to primary sidebar

Ryan McCormick

Dedicated Dad, Software Engineer and Lover of Coffee

Remove VirtualBox from Ubuntu 16.04 Xenial

March 3, 2018 by Ryan McCormick 2 Comments

I recently had to make some updates to my VirtualBox and Vagrant installations and decided to completely uninstall VirtualBox to reinstall the newest version to start fresh. I am creating this post as a future reference (mostly for the home folder info) but also to share.

Step 1: Completely Remove All VirtualBox Packages and Folders from Ubuntu

If you are interested in checking out all of the package versions on your system before uninstalling, you can run dpkg -l | grep virtualbox

To uninstall and remove all packages, run sudo apt-get remove virtualbox* --purge

This command does a couple of things:
1. Identifies virtualbox packages to ensure all versions are targeted by using the asterisk wildcard.
2. The purge option also triggers removal of any configuration files.

To also remove all of the VMs stored in the home directory, move to the next step.

Step 2: Remove all VMs from Home Directory

NOTE: The sudo rm command with -rf is a very destructive command. Always pay attention to what your command is doing before hitting enter.

ANOTHER NOTE: This will remove all VMs that have been installed to the default home folder location. If you don’t want to remove VMs, don’t complete this step.

Because “sudo rm -rf” is destructive, check to see if you even need to use the command by locating the files and attempting to delete without sudo.

1. Browse to your home directory (you can usually just type cd and hit enter).
2. run ls -al
3. If you see the directory “VirtualBox VMs”, you can try to delete without sudo first rm -rf ./"VirtualBox VMs" (you need to use double quotes around the folder name because of the space). If you run into file permission problems, you can try to take ownership and then try deleting without sudo sudo chown `whoami` -R ./"VirtualBox VMs" and then try rm -rf ./"VirtualBox VMs". If all else fails, and it makes sense, use sudo: sudo rm -rf ./"VirtualBox VMs".
4. Remove config files from home directory. Technically, when running your apt-get remove with purge, all config files should have been targeted, but it is good to check anyway. From your home directory, change into your .config folder cd .config and look for a folder named VirtualBox. Try removing without sudo at first (since it is located in your home folder, you should have the ability to do so) rm -rf ./VirtualBox.

At this point, all of your previous VirtualBox installation should have been removed.

Related

Filed Under: Linux Tagged With: Ubuntu, ubuntu 16.04

Reader Interactions

Comments

  1. ALEX says

    September 16, 2018 at 5:14 am

    Awesome!

    Reply
  2. mustafa says

    May 1, 2020 at 4:53 am

    Thank you sir

    Reply

Leave a Reply Cancel reply

Primary Sidebar

Recent Posts

  • Force Quit Kill all Chrome Windows MacOS
  • SOLVED: Angular 6 CLI Karma Stuck in Single Run | Karma Stops Running
  • How to Manually Install Java 8 on Ubuntu 18.04 LTS
  • Remove VirtualBox from Ubuntu 16.04 Xenial
  • Clear all Node Modules Folders Recursively Mac/Linux

Recent Comments

  • KKV on Webstorm adding spaces between imports and braces | JavaScript and TypeScript
  • jusopi on Clear all Node Modules Folders Recursively Mac/Linux
  • Qaisar Irfan on Clear all Node Modules Folders Recursively Mac/Linux
  • mustafa on Remove VirtualBox from Ubuntu 16.04 Xenial
  • Pourya on How to Manually Install Java 8 on Ubuntu 18.04 LTS

Archives

  • May 2019
  • May 2018
  • April 2018
  • March 2018
  • January 2018
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • March 2017
  • December 2015
  • November 2015
  • July 2015
  • April 2015
  • February 2015
  • September 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • October 2013
  • August 2013
  • June 2013
  • April 2013
  • March 2013
  • February 2013
  • December 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • May 2012
  • March 2012
  • February 2012
  • December 2011
  • November 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • August 2009
  • July 2009
  • May 2009

Categories

  • Angular
  • Angular 2
  • AngularJS (1x branch)
  • Computer Q&A
  • ES2015
  • Internet Marketing
  • Javascript
  • Job Interviews
  • Job Search
  • Karma
  • Laravel
  • Linux
  • Linux/Unix Tips
  • MacOS
  • Microsoft Access
  • Microsoft Excel
  • Microsoft Outlook
  • Microsoft Word
  • News
  • Node
  • Open Source
  • PHP
  • Protractor
  • Resume Writing
  • Spring Boot
  • SQL
  • Ubuntu
  • VBA
  • VBScript
  • VirtualBox
  • Web Development
  • Windows Tips
  • Wordpress

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2023 · Magazine Pro on Genesis Framework · WordPress · Log in