#!/bin/bash ################################################################################ # Helper to install Adobe Flash (64bit, "Labs") on Ubuntu Linux 64bit # # With this script, you have to tool of choice to install/update the exprimental # 64bit Adobe Labs Flash version on your 64bit Ubuntu: # - Automatically removes old Flash versions ("clean up") before installation. # - Installs the native (but experimental) 64bit version (from Adobe Labs). # - Prepares the system to run Flash within Firefox, Chromium and Opera. # # ATTENTION: You have to get the newest version of this script from time to make # sure you always have the newest version of Flash! THIS IS IMPORTANT # FOR YOUR SYSTEM'S SECURITY! See # http://readm3.org/app/adobe-flash/adobe-flash-install-64bit.sh to # get the newest version of this script. # # USAGE: Install: simply call this script with superuser privileges: # sudo ./adobe-flash-install-64bit.sh # Uninstall: to remove changes made by this script (and all eventually # existing Flash versions to prevent problems), call it with # superuser privileges and the parameter "uninstall": # sudo ./adobe-flash-install-64bit.sh uninstall # # # LICENSE: This file is open source software (OSS) and may be copied under # certain conditions. See the links below for details or try to contact # the author(s) of this file in doubt. # # @author Andreas Haerter # @copyright 2009-2010, Andreas Haerter # @license GPLv2 (http://www.gnu.org/licenses/gpl2.html) # @license New/3-clause BSD (http://opensource.org/licenses/bsd-license.php) # @link http://andreas-haerter.com/ # @link http://readm3.org/app/adobe-flash/ # @link http://readm3.org/app/adobe-flash/adobe-flash-install-64bit.sh # @link http://www.adobe.com/de/products/flash/about/ Official testing site # @version 2010-12-02 ################################################################################ ################################################################################ # DO NOT TOUCH ANYTHING BEHIND THIS POINT WITHOUT KNOWING WHAT YOU ARE DOING! ################################################################################ ################################################################################ # Process ################################################################################ #welcome user clear echo "###############################################################################" echo "# Helper script to install the experimental 64bit Adobe Labs Flash on Ubuntu." echo "# Found Ubuntu: $(lsb_release -rs) $(lsb_release -cs)" echo "#" echo "# Note: internet connection is mandatory!" echo "###############################################################################" #check: are we root? if [ $(id -u) -ne 0 ] then echo "" echo "Superuser privileges needed. Please call this script using 'sudo'/as root." 1>&2 exit 1 fi case "${1}" in #first command line argument #uninstall: "uninstall") echo "Remove changes made by this script (and all eventually existing Flash versions" echo "to prevent problems)." echo "" echo "You can use the normal package manager again to reinstall Flash afterwards" echo "(see http://readm3.org/app/adobe-flash/ for instructions)." echo "" echo -n "Would you like to REMOVE all versions of Adobe Flash now? [y|n]: " read INPUT if [ "${INPUT}" == "y" ] || [ "${INPUT}" == "Y" ] || [ "${INPUT}" == "j" ] || #German keyboard [ "${INPUT}" == "J" ] then echo "" echo "Searching for eventually installed other/old Flash packages/*.so files," echo "removing them." apt-get purge --yes "adobe-flashplugin" > /dev/null 2>&1 apt-get purge --yes "flashplugin-installer" > /dev/null 2>&1 apt-get purge --yes "flashplugin-nonfree" > /dev/null 2>&1 apt-get purge --yes "mozilla-plugin-gnash" > /dev/null 2>&1 apt-get purge --yes "swfdec-mozilla" > /dev/null 2>&1 apt-get purge --yes "browser-plugin-lightspark" > /dev/null 2>&1 apt-get purge --yes "mozilla-plugin-gnash" > /dev/null 2>&1 apt-get purge --yes "konqueror-plugin-gnash" > /dev/null 2>&1 rm --preserve-root -rf "/usr/lib/adobe-flashplugin/" > /dev/null 2>&1 #The official non-repository .deb files from Adobe are using this path rm -f "/usr/lib/chromium-browser/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/firefox-addons/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/mozilla/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/opera/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/xulrunner-addons/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f $(find "/home/" -name "libflashplayer.so") > /dev/null 2>&1 echo "" echo "Eventually existing versions of Flash or Flash alternatives were removed." fi unset INPUT ;; #default: install *) echo "Note: eventually existing Flash versions will be removed automatically before" echo " installing the new version." echo "" echo -n "Would you like to install Flash 64bit (experimental Labs version) now? [y|n]: " read INPUT if [ "${INPUT}" == "y" ] || [ "${INPUT}" == "Y" ] || [ "${INPUT}" == "j" ] || #German keyboard [ "${INPUT}" == "J" ] then #define some stuff if [ "$(uname -m)" == "x86_64" ] then #see http://labs.adobe.com/downloads/flashplayer10.html FLASH_DOWNLOADURL="http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz" FLASH_DOWNLOADLOCALNAME="install_flash_player_linux64.tar.gz" else echo -e "Found operating system seems to be a 32bit version (64bit expected)!" 1>&2 exit 1 fi FLASH_DOWNLOADLOCALPATH=$(mktemp -d "/tmp/adobe_flash.XXXXXXXXXXXXX") #prevent symlink race... #prevent problems with an open firefox echo "" echo "Please close running Mozilla Firefox, Chromium and Opera windows (eventually" echo "remaining firefox/chromium-browser/opera processes will be killed in the next" echo "step)." read -sp "Press [Enter] to continue." killall -9 firefox > /dev/null 2>&1 killall -9 firefox-bin > /dev/null 2>&1 killall -9 chromium-browser > /dev/null 2>&1 killall -9 opera > /dev/null 2>&1 echo "" echo "Eventually open firefox/chromium-browser/opera instances have been closed." echo "Going on." echo "" #removing eventually installed, other flash versions. See #http://readm3.org/app/adobe-flash/start#uninstall_old_flash_versions_ubuntu_linux_including_experimental_labs_releases #for details echo "" echo "Searching for eventually installed other/old Flash packages/*.so files," echo "removing them." apt-get purge --yes "adobe-flashplugin" > /dev/null 2>&1 apt-get purge --yes "flashplugin-installer" > /dev/null 2>&1 apt-get purge --yes "flashplugin-nonfree" > /dev/null 2>&1 apt-get purge --yes "mozilla-plugin-gnash" > /dev/null 2>&1 apt-get purge --yes "swfdec-mozilla" > /dev/null 2>&1 apt-get purge --yes "browser-plugin-lightspark" > /dev/null 2>&1 apt-get purge --yes "mozilla-plugin-gnash" > /dev/null 2>&1 apt-get purge --yes "konqueror-plugin-gnash" > /dev/null 2>&1 rm --preserve-root -rf "/usr/lib/adobe-flashplugin/" > /dev/null 2>&1 #The official non-repository .deb files from Adobe are using this path rm -f "/usr/lib/chromium-browser/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/firefox-addons/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/mozilla/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/opera/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f "/usr/lib/xulrunner-addons/plugins/libflashplayer.so" > /dev/null 2>&1 rm -f $(find "/home/" -name "libflashplayer.so") > /dev/null 2>&1 echo "Eventually existing old versions of Flash or Flash alternatives were" echo "removed." #download echo "" echo "Downloading Flash... " mkdir -p ${FLASH_DOWNLOADLOCALPATH} > /dev/null 2>&1 wget "${FLASH_DOWNLOADURL}" -O "${FLASH_DOWNLOADLOCALPATH}/${FLASH_DOWNLOADLOCALNAME}" if [ $? -ne 0 ] then echo "Download failed: '${FLASH_DOWNLOADURL}'" 1>&2 exit 1 fi #install cd ${FLASH_DOWNLOADLOCALPATH} if [ "${FLASH_DOWNLOADLOCALNAME##*.}" == "deb" ] #.deb (if there will be one someday...) then gdebi "./${FLASH_DOWNLOADLOCALNAME}" #gdebi is better than 'dpkg -i' cause it resolves dependencies automatically if [ $? -ne 0 ] then echo "gdebi installation failed: '${FLASH_DOWNLOADLOCALNAME}'" 1>&2 exit 1 fi else #tar.gz tar -xzvf "${FLASH_DOWNLOADLOCALPATH}/${FLASH_DOWNLOADLOCALNAME}" > /dev/null 2>&1 if [ $? -ne 0 ] then echo "untar failed: '${FLASH_DOWNLOADLOCALPATH}/${FLASH_DOWNLOADLOCALNAME}'" 1>&2 exit 1 fi #firefox mkdir -p "/usr/lib/mozilla/plugins/" > /dev/null 2>&1 cp "${FLASH_DOWNLOADLOCALPATH}/libflashplayer.so" "/usr/lib/mozilla/plugins/" > /dev/null 2>&1 if [ $? -ne 0 ] then echo "Could not copy 'libflashplayer.so' into '/usr/lib/mozilla/plugins/'" 1>&2 exit 1 fi chmod 0755 "/usr/lib/mozilla/plugins/libflashplayer.so" 2>&1 #chromium mkdir -p "/usr/lib/chromium-browser/plugins/" > /dev/null 2>&1 ln -f -s -v "/usr/lib/mozilla/plugins/libflashplayer.so" "/usr/lib/chromium-browser/plugins/libflashplayer.so" if [ $? -ne 0 ] then echo "Could not link '/usr/lib/chromium-browser/plugins/libflashplayer.so'->'/usr/lib/mozilla/plugins/libflashplayer.so'" 1>&2 exit 1 fi chmod 0755 "/usr/lib/chromium-browser/plugins/libflashplayer.so" 2>&1 #opera mkdir -p "/usr/lib/opera/plugins/" > /dev/null 2>&1 ln -f -s -v "/usr/lib/mozilla/plugins/libflashplayer.so" "/usr/lib/opera/plugins/libflashplayer.so" if [ $? -ne 0 ] then echo "Could not link '/usr/lib/opera/plugins/libflashplayer.so'->'/usr/lib/mozilla/plugins/libflashplayer.so'" 1>&2 exit 1 fi chmod 0755 "/usr/lib/opera/plugins/libflashplayer.so" > /dev/null 2>&1 #general: make plugin usable for other applications ln -f -s -v "/usr/lib/mozilla/plugins/libflashplayer.so" "/usr/lib/xulrunner-addons/plugins/libflashplayer.so" if [ $? -ne 0 ] then echo "Could not link '/usr/lib/xulrunner-addons/plugins/libflashplayer.so'->'/usr/lib/mozilla/plugins/libflashplayer.so'" 1>&2 exit 1 fi ln -f -s -v "/usr/lib/mozilla/plugins/libflashplayer.so" "/usr/lib/firefox-addons/plugins/libflashplayer.so" if [ $? -ne 0 ] then echo "Could not link '/usr/lib/firefox-addons/plugins/libflashplayer.so'->'/usr/lib/mozilla/plugins/libflashplayer.so'" 1>&2 exit 1 fi echo "" fi echo "Done." echo "" echo "" echo "Download and installation was successful. Please visit" echo "http://www.adobe.com/software/flash/about/" echo "to check your installation." echo "" cd $(dirname ${0}) #change back to own parent dir #clean up rm --preserve-root -rf "${FLASH_DOWNLOADLOCALPATH}/" unset FLASH_VER unset FLASH_DOWNLOADURL unset FLASH_DOWNLOADLOCALPATH unset FLASH_DOWNLOADLOCALNAME unset FLASH_OK fi unset INPUT ;; esac #if we are here, everything was fine exit 0