VirtualBox

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

Last change on this file since 36750 was 36750, checked in by vboxsync, 13 years ago

linux installer: missing changes for terminating vboxballoonctrl-service

  • Property svn:eol-style set to LF
File size: 5.5 KB
Line 
1#!/bin/sh
2#
3# Oracle VM VirtualBox
4# VirtualBox linux uninstallation script
5
6#
7# Copyright (C) 2009-2010 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 "$DKMS" ] && DKMS=`which dkms 2> /dev/null`
33[ -z "$CONFIG_DIR" ] && CONFIG_DIR="/etc/vbox"
34[ -z "$CONFIG" ] && CONFIG="vbox.cfg"
35[ -z "$CONFIG_FILES" ] && CONFIG_FILES="filelist"
36[ -z "$DEFAULT_FILES" ] && DEFAULT_FILES=`pwd`/deffiles
37
38# Find previous installation
39if [ -r $CONFIG_DIR/$CONFIG ]; then
40 . $CONFIG_DIR/$CONFIG
41 PREV_INSTALLATION=$INSTALL_DIR
42fi
43
44# Remove previous installation
45if [ "$PREV_INSTALLATION" = "" ]; then
46 log "Unable to find a VirtualBox installation, giving up."
47 abort "Couldn't find a VirtualBox installation to uninstall."
48fi
49
50# Stop the ballon control service
51stop_init_script vboxballoonctrl-service
52# Stop the web service
53stop_init_script vboxweb-service
54# Do this check here after we terminated the web service
55check_running
56# Terminate VBoxNetDHCP if running
57terminate_proc VBoxNetDHCP
58delrunlevel vboxballoonctrl-service > /dev/null 2>&1
59remove_init_script vboxballoonctrl-service
60delrunlevel vboxweb-service > /dev/null 2>&1
61remove_init_script vboxweb-service
62# Stop kernel module and uninstall runlevel script
63stop_init_script vboxdrv
64delrunlevel vboxdrv > /dev/null 2>&1
65remove_init_script vboxdrv
66# Stop host networking and uninstall runlevel script (obsolete)
67stop_init_script vboxnet
68delrunlevel vboxnet > /dev/null 2>&1
69remove_init_script vboxnet
70# Remove kernel module installed
71if [ -n "$DKMS" ]; then
72 $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1
73fi
74if [ -z "$VBOX_DONT_REMOVE_OLD_MODULES" ]; then
75 find /lib/modules/`uname -r` -name "vboxdrv\.*" 2>/dev/null|xargs rm -f 2> /dev/null
76 find /lib/modules/`uname -r` -name "vboxnetflt\.*" 2>/dev/null|xargs rm -f 2> /dev/null
77 find /lib/modules/`uname -r` -name "vboxnetadp\.*" 2>/dev/null|xargs rm -f 2> /dev/null
78 # Remove directories we have installed to in the past
79 find /lib/modules/`uname -r` -name vbox\* 2>/dev/null|xargs rmdir -p 2> /dev/null
80 find /lib/modules/`uname -r` -name misc\* 2>/dev/null|xargs rmdir -p 2> /dev/null
81 rm -f /usr/src/vboxhost-$INSTALL_VER 2> /dev/null
82 rm -f /usr/src/vboxdrv-$INSTALL_VER 2> /dev/null
83 rm -f /usr/src/vboxnetflt-$INSTALL_VER 2> /dev/null
84 rm -f /usr/src/vboxnetadp-$INSTALL_VER 2> /dev/null
85fi
86
87# Remove symlinks
88rm -f \
89 /usr/bin/VirtualBox \
90 /usr/bin/VBoxManage \
91 /usr/bin/VBoxSDL \
92 /usr/bin/VBoxVRDP \
93 /usr/bin/VBoxHeadless \
94 /usr/bin/VBoxNetDHCP \
95 /usr/bin/vboxwebsrv \
96 /usr/bin/VBoxAddIF \
97 /usr/bin/VBoxDeleteIf \
98 /usr/bin/VBoxTunctl \
99 /usr/bin/virtualbox \
100 /usr/share/pixmaps/VBox.png \
101 /usr/share/applications/virtualbox.desktop \
102 /usr/share/mime/packages/virtualbox.xml \
103 /usr/bin/rdesktop-vrdp \
104 /usr/bin/virtualbox \
105 /usr/bin/vboxmanage \
106 /usr/bin/vboxsdl \
107 /usr/bin/vboxheadless \
108 $PREV_INSTALLATION/components/VBoxVMM.so \
109 $PREV_INSTALLATION/components/VBoxREM.so \
110 $PREV_INSTALLATION/components/VBoxRT.so \
111 $PREV_INSTALLATION/components/VBoxDDU.so \
112 $PREV_INSTALLATION/components/VBoxXPCOM.so \
113 2> /dev/null
114
115# Remove udev description file
116if [ -f /etc/udev/rules.d/60-vboxdrv.rules ]; then
117 rm -f /etc/udev/rules.d/60-vboxdrv.rules 2> /dev/null
118fi
119if [ -f /etc/udev/rules.d/10-vboxdrv.rules ]; then
120 rm -f /etc/udev/rules.d/10-vboxdrv.rules 2> /dev/null
121fi
122
123# Remove our USB device tree
124rm -rf /dev/vboxusb 2> /dev/null
125
126cwd=`pwd`
127if [ -f $PREV_INSTALLATION/src/Makefile ]; then
128 cd $PREV_INSTALLATION/src
129 make clean > /dev/null 2>&1
130fi
131if [ -f $PREV_INSTALLATION/src/vboxdrv/Makefile ]; then
132 cd $PREV_INSTALLATION/src/vboxdrv
133 make clean > /dev/null 2>&1
134fi
135if [ -f $PREV_INSTALLATION/src/vboxnetflt/Makefile ]; then
136 cd $PREV_INSTALLATION/src/vboxnetflt
137 make clean > /dev/null 2>&1
138fi
139if [ -f $PREV_INSTALLATION/src/vboxnetadp/Makefile ]; then
140 cd $PREV_INSTALLATION/src/vboxnetadp
141 make clean > /dev/null 2>&1
142fi
143cd $PREV_INSTALLATION
144if [ -r $CONFIG_DIR/$CONFIG_FILES ]; then
145 rm -f `cat $CONFIG_DIR/$CONFIG_FILES` 2> /dev/null
146elif [ -n "$DEFAULT_FILES" -a -r "$DEFAULT_FILES" ]; then
147 DEFAULT_FILE_NAMES=""
148 . $DEFAULT_FILES
149 for i in "$DEFAULT_FILE_NAMES"; do
150 rm -f $i 2> /dev/null
151 done
152fi
153for file in `find $PREV_INSTALLATION 2> /dev/null`; do
154 rmdir -p $file 2> /dev/null
155done
156cd $cwd
157mkdir -p $PREV_INSTALLATION 2> /dev/null # The above actually removes the current directory and parents!
158rmdir $PREV_INSTALLATION 2> /dev/null
159rm -r $CONFIG_DIR/$CONFIG 2> /dev/null
160
161if [ -z "$VBOX_NO_UNINSTALL_MESSAGE" ]; then
162 rm -r $CONFIG_DIR/$CONFIG_FILES 2> /dev/null
163 rmdir $CONFIG_DIR 2> /dev/null
164 [ -n "$INSTALL_REV" ] && INSTALL_REV=" r$INSTALL_REV"
165 info "VirtualBox $INSTALL_VER$INSTALL_REV has been removed successfully."
166 log "Successfully $INSTALL_VER$INSTALL_REV removed VirtualBox."
167fi
168update-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