VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/uninstall.sh@ 58090

Last change on this file since 58090 was 57980, checked in by vboxsync, 9 years ago

Installer/linux: forgot the vboxpci kernel module in a couple of places.

  • Property svn:eol-style set to LF
File size: 5.3 KB
Line 
1#!/bin/sh
2#
3# Oracle VM VirtualBox
4# VirtualBox linux uninstallation script
5
6#
7# Copyright (C) 2009-2015 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18. `dirname $0`/routines.sh
19
20if [ -z "$ro_LOG_FILE" ]; then
21 create_log "/var/log/vbox-uninstall.log"
22fi
23
24if [ -z "VBOX_NO_UNINSTALL_MESSAGE" ]; then
25 info "Uninstalling VirtualBox"
26 log "Uninstalling VirtualBox"
27 log ""
28fi
29
30check_root
31
32[ -z "$CONFIG_DIR" ] && CONFIG_DIR="/etc/vbox"
33[ -z "$CONFIG" ] && CONFIG="vbox.cfg"
34[ -z "$CONFIG_FILES" ] && CONFIG_FILES="filelist"
35[ -z "$DEFAULT_FILES" ] && DEFAULT_FILES=`pwd`/deffiles
36
37# Find previous installation
38if [ -r $CONFIG_DIR/$CONFIG ]; then
39 . $CONFIG_DIR/$CONFIG
40 PREV_INSTALLATION=$INSTALL_DIR
41fi
42
43# Remove previous installation
44if [ "$PREV_INSTALLATION" = "" ]; then
45 log "Unable to find a VirtualBox installation, giving up."
46 abort "Couldn't find a VirtualBox installation to uninstall."
47fi
48
49# Do pre-removal common to all installer types, currently service script
50# clean-up.
51`dirname $0`/prerm-common.sh || exit 1 # Arguments intentionally not quoted.
52
53# Remove kernel module installed
54if [ -z "$VBOX_DONT_REMOVE_OLD_MODULES" ]; then
55 find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2> /dev/null
56 find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2> /dev/null
57 find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2> /dev/null
58 find /lib/modules/`uname -r` -name "vboxpci\.*" 2>/dev/null|xargs rm -f 2> /dev/null
59 # Remove directories we have installed to in the past
60 find /lib/modules/`uname -r` -name vbox\* 2>/dev/null|xargs rmdir -p 2> /dev/null
61 find /lib/modules/`uname -r` -name misc\* 2>/dev/null|xargs rmdir -p 2> /dev/null
62 rm -f /usr/src/vboxhost-$INSTALL_VER 2> /dev/null
63 rm -f /usr/src/vboxdrv-$INSTALL_VER 2> /dev/null
64 rm -f /usr/src/vboxnetflt-$INSTALL_VER 2> /dev/null
65 rm -f /usr/src/vboxnetadp-$INSTALL_VER 2> /dev/null
66 rm -f /usr/src/vboxpci-$INSTALL_VER 2> /dev/null
67fi
68
69# Remove symlinks
70rm -f \
71 /usr/bin/VirtualBox \
72 /usr/bin/VBoxManage \
73 /usr/bin/VBoxSDL \
74 /usr/bin/VBoxVRDP \
75 /usr/bin/VBoxHeadless \
76 /usr/bin/VBoxDTrace \
77 /usr/bin/VBoxBalloonCtrl \
78 /usr/bin/VBoxAutostart \
79 /usr/bin/VBoxNetDHCP \
80 /usr/bin/VBoxNetNAT \
81 /usr/bin/vboxwebsrv \
82 /usr/bin/vbox-img \
83 /usr/bin/VBoxAddIF \
84 /usr/bin/VBoxDeleteIf \
85 /usr/bin/VBoxTunctl \
86 /usr/bin/virtualbox \
87 /usr/share/pixmaps/VBox.png \
88 /usr/share/pixmaps/virtualbox.png \
89 /usr/share/applications/virtualbox.desktop \
90 /usr/share/mime/packages/virtualbox.xml \
91 /usr/bin/rdesktop-vrdp \
92 /usr/bin/virtualbox \
93 /usr/bin/vboxmanage \
94 /usr/bin/vboxsdl \
95 /usr/bin/vboxheadless \
96 /usr/bin/vboxdtrace \
97 $PREV_INSTALLATION/components/VBoxVMM.so \
98 $PREV_INSTALLATION/components/VBoxREM.so \
99 $PREV_INSTALLATION/components/VBoxRT.so \
100 $PREV_INSTALLATION/components/VBoxDDU.so \
101 $PREV_INSTALLATION/components/VBoxXPCOM.so \
102 2> /dev/null
103
104# Remove udev description file
105if [ -f /etc/udev/rules.d/60-vboxdrv.rules ]; then
106 rm -f /etc/udev/rules.d/60-vboxdrv.rules 2> /dev/null
107fi
108if [ -f /etc/udev/rules.d/10-vboxdrv.rules ]; then
109 rm -f /etc/udev/rules.d/10-vboxdrv.rules 2> /dev/null
110fi
111
112# Remove our USB device tree
113rm -rf /dev/vboxusb 2> /dev/null
114
115cwd=`pwd`
116if [ -f $PREV_INSTALLATION/src/Makefile ]; then
117 cd $PREV_INSTALLATION/src
118 make clean > /dev/null 2>&1
119fi
120if [ -f $PREV_INSTALLATION/src/vboxdrv/Makefile ]; then
121 cd $PREV_INSTALLATION/src/vboxdrv
122 make clean > /dev/null 2>&1
123fi
124if [ -f $PREV_INSTALLATION/src/vboxnetflt/Makefile ]; then
125 cd $PREV_INSTALLATION/src/vboxnetflt
126 make clean > /dev/null 2>&1
127fi
128if [ -f $PREV_INSTALLATION/src/vboxnetadp/Makefile ]; then
129 cd $PREV_INSTALLATION/src/vboxnetadp
130 make clean > /dev/null 2>&1
131fi
132if [ -f $PREV_INSTALLATION/src/vboxpci/Makefile ]; then
133 cd $PREV_INSTALLATION/src/vboxpci
134 make clean > /dev/null 2>&1
135fi
136cd $PREV_INSTALLATION
137if [ -r $CONFIG_DIR/$CONFIG_FILES ]; then
138 rm -f `cat $CONFIG_DIR/$CONFIG_FILES` 2> /dev/null
139elif [ -n "$DEFAULT_FILES" -a -r "$DEFAULT_FILES" ]; then
140 DEFAULT_FILE_NAMES=""
141 . $DEFAULT_FILES
142 for i in "$DEFAULT_FILE_NAMES"; do
143 rm -f $i 2> /dev/null
144 done
145fi
146for file in `find $PREV_INSTALLATION 2> /dev/null`; do
147 rmdir -p $file 2> /dev/null
148done
149cd $cwd
150mkdir -p $PREV_INSTALLATION 2> /dev/null # The above actually removes the current directory and parents!
151rmdir $PREV_INSTALLATION 2> /dev/null
152rm -r $CONFIG_DIR/$CONFIG 2> /dev/null
153
154if [ -z "$VBOX_NO_UNINSTALL_MESSAGE" ]; then
155 rm -r $CONFIG_DIR/$CONFIG_FILES 2> /dev/null
156 rmdir $CONFIG_DIR 2> /dev/null
157 [ -n "$INSTALL_REV" ] && INSTALL_REV=" r$INSTALL_REV"
158 info "VirtualBox $INSTALL_VER$INSTALL_REV has been removed successfully."
159 log "Successfully $INSTALL_VER$INSTALL_REV removed VirtualBox."
160fi
161update-mime-database /usr/share/mime >/dev/null 2>&1
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette