Script to install Flash Player through postinst

I have created a debian package. I need to check for the Adobe Flash Player while installing this .deb. If flash player is not installed then i need to install it also. On browsing i got to know that postinst file can be used for this purpose. The postinst file is


echo “Stopping any Firefox that might be running”
sudo killall -9 firefox

echo “Removing any other flash plugin previously installed:”
sudo apt-get remove -y –purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper

echo “Installing Flash Player 10″
#cd ~
sudo cp /home/ /usr/lib/mozilla/plugins/

echo “Linking the libraries so Firefox and apps depending on XULRunner.”
sudo ln -sf /usr/lib/mozilla/plugins/ /usr/lib/firefox-addons/plugins/
sudo ln -sf /usr/lib/mozilla/plugins/ /usr/lib/xulrunner-addons/plugins/

# now doing some cleaning up:
sudo rm -rf
sudo rm -rf

But nothing is happening. Can anyone help me to write the script to install flash player through script?


Looks like you got your $HOME path wrong:

sudo cp /home/ /usr/lib/mozilla/plugins/

did you mean:

sudo cp $HOME/ /usr/lib/mozilla/plugins/
Posted on by ismail

Relevant tags