Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Installs (or updates) PPAPI Flash, so that it can be used by Chromium-based browsers


If you use Ubuntu or a derivative distro, issue the following to install an appropriate version of Flash:

sudo add-apt-repository "deb `lsb_release -cs` partner" 
sudo apt update
sudo apt install adobe-flashplugin

If your distro does not provide a copy of Pepper Flash that works with Vivaldi, this script will download and install it for you. To use, click on the "Download ZIP" button listed on the GitHub Gist page and then unpack the .zip archive locally. You should now have a directory containing the file "".

Open a terminal within that directory and run the script like so:


The script will fetch and install the latest Pepper Flash. From time to time (perhaps once a month) you should re-run this script and if there is a newer Flash it will upgrade your installed copy, otherwise it will just confirm that you have the latest version.

available () {
command -v $1 >/dev/null 2>&1
# Make sure we have wget or curl
if available wget; then
SILENT_DL="wget -qO-"
elif available curl; then
SILENT_DL="curl -sL"
LOUD_DL="curl -O"
echo "Install wget or curl" >&2
exit 1
# Set Output dir
# Set temp dir
# Set staging dir
# Setup Arch
case $(uname -m) in
x86_64) ARCH=x86_64 ;;
i?86) ARCH=i386 ;;
# Work out the VERSION
VERSION=$($SILENT_DL | grep -FA2 'Chromium-based browsers - PPAPI' | grep -Eo '([0-9]+\.){3}[0-9]+' | tail -n1)
# Error out if $VERISON is unset, e.g. because previous command failed
if [ -z "$VERSION" ]; then
echo "Could not work out the latest version; exiting" >&2
exit 1
# Don't start repackaging if the same version is already installed
if [ -r "$PPAPI_FLASH_INSTALL_DIR/manifest.json" ] ; then
CUR_VER=$(grep -Eo '"version" *: *"([0-9]+\.){3}[0-9]+",' "$PPAPI_FLASH_INSTALL_DIR/manifest.json" | cut -d'"' -f 4)
if [ "$CUR_VER" = "$VERSION" ]; then
echo "The latest Flash ($VERSION) is already installed"
exit 0
# Now we could screw things up so exit on first error
set -e
# If the staging directory is already present from the past, clear it down
# and re-create it.
if [ -d "$STAGINGDIR" ]; then
rm -fr "$STAGINGDIR"
# Now get the tarball
$LOUD_DL "$VERSION/flash_player_ppapi_linux.${ARCH}.tar.gz"
# Extract the contents of the Google Chrome binary package
tar xf flash_player_ppapi_linux.${ARCH}.tar.gz -C "$STAGINGDIR$PPAPI_FLASH_INSTALL_DIR"
chmod -R u+w,go+r-w,a-s .
# Escalate privileges if needed and copy files into place
if [ "$UID" = 0 ]; then
tar --owner=0 --group=0 -cf- ".$PPAPI_FLASH_INSTALL_DIR" | tar -xf- -C /
elif [ -r /etc/os-release ] && grep -qx 'ID=\(ubuntu\|linuxmint\)' /etc/os-release; then
echo "Calling sudo ... (if prompted, please enter your password, so Flash can be copied into place)"
tar --owner=0 --group=0 -cf- ".$PPAPI_FLASH_INSTALL_DIR" | sudo tar -xf- -C /
echo "Please enter your root password so Pepper Flash can be copied into place"
su -c "sh -c \"tar --owner=0 --group=0 -cf- .$PPAPI_FLASH_INSTALL_DIR | tar -xf- -C /\""
# Tell the user we are done
printf "\nFlash installed into $PPAPI_FLASH_INSTALL_DIR\n"

Great script ! Really nice !


ruario commented Oct 19, 2016

Updated, to use packages from Adobe, rather than pulling apart Chrome.

Thanks for this script!

fld commented Dec 16, 2016

For Debian jessies chromium users:

% cat /etc/chromium.d/latest-pepper-flash
flashversion=`strings $flashso 2> /dev/null | grep LNX | cut -d ' ' -f 2 | sed -e "s/,/./g"`
CHROMIUM_FLAGS="$CHROMIUM_FLAGS --ppapi-flash-path=$flashso --ppapi-flash-version=$flashversion"

kernc commented Dec 29, 2016

For Debian jessies chromium users

In addition, they should remove /etc/chromium.d/pepperflashplugin-nonfree, if any.

@ruario Instead of checking for ubuntu|linuxmint in /etc/os-release, how about testing if groups | grep -q '\bsudo\b'. I use Debian in root-locked-sudo-mode and the latter test works.


ruario commented Jan 2, 2017

@kernc doesn't help as that is just how it is done in debian. Other distros do not always use a sudo group.

In your case, just run the script itself under sudo (or tweak it for your own use).

@fld that command shouldn't be necessary, Vivaldi looks for flash in that location by default

Something has to be changed in the adobe site, now to get the version correctly this should be used:
VERSION=$($SILENT_DL | grep -FA2 'Chromium-based browsers - PPAPI' | grep -Eo '([0-9]+\.){3}[0-9]+' | tail -n1)

Yes, solution @cybernova work for me. Thanks.


ruario commented Oct 11, 2017

Thanks @cybernova I comhe mean tpletely missed your comment before and I have been away for months on parental leave butI have finally fixed this now. I hope others saw your comment in the mean time

@ruario thanks for the script. I had to deal with flash downloads as well, and came across a xml file with all flash versions:

So the download could be changed to this (remove the "L" option in curl):

if available wget; then
SILENT_DL="wget -qO-"
elif available curl; then
SILENT_DL="curl -s"
LOUD_DL="curl -O"
echo "Install wget or curl" >&2
exit 1

VERSION=$($SILENT_DL | sed '/</release>/,$d' | grep PPAPI_linuxchrome | awk -F'"' '{ print $2 }' | sed 's/,/./g')

This is a bit faster, and should also not change to often.


cybernova commented Jan 10, 2018

Didn't notice that in the script we don't use any security by downloading updates from http instead of https exposing us to MitM attacks until today when I saw a report from ESET titled: Diplomats in Eastern Europe bitten by a Turla mosquito ( ) where Turla APT apparently injects malware on the fly in adobe flash player's update.
So I suggest to apply a little patch to the script by simply changing all http to https as soon as possible.

I verified analyzing the traffic generated by the script, even with the use of https the check of the version is in plain text because of a redirect in this page: -> :D
The better solution is to use the suggest of @ohaessler ( is more faster and stable as he said, Thanks! ) and to use a string for verifying the version like this :
VERSION=$($SILENT_DL | grep -m1 "PPAPI_linux version" | cut -d \" -f 2 | tr , .)
Note the use of https and this time works and is full encrypted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment