Force Update PHPMyAdmin Shell Script

Here is the code of the script:


echo “Backing up”
mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak

echo “Getting lastest PHPMyAdmin version…”
mkdir -p /usr/share/phpmyadmin/
cd /usr/share/phpmyadmin/
tar xzf phpMyAdmin-latest-all-languages.tar.gz
mv phpMyAdmin-*/* /usr/share/phpmyadmin

echo “Updating vendor_config”
sed -i -r “s/(‘TEMP_DIR’\s*,)[^\)]*/\1 ‘\/var\/lib\/phpmyadmin\/tmp\/’/” /usr/share/phpmyadmin/libraries/vendor_config.php
sed -i -r “s/(‘CONFIG_DIR’\s*,)[^\)]*/\1 ‘\/etc\/phpmyadmin\/’/” /usr/share/phpmyadmin/libraries/vendor_config.php

echo “Cleaning up…”
rm /usr/share/phpmyadmin/phpMyAdmin-latest-all-languages.tar.gz
rm -rf /usr/share/phpmyadmin/phpMyAdmin-*
rm -rf /usr/share/phpmyadmin.bak

echo “Done!”

In general, it will start downloading the latest phpmyadmin version and install it to local machine.

Tested on Ubuntu.

Original author: GARSAX


Alternatively, you can also run the script from my website:

$ sudo curl | bash

Leave a comment

Your email address will not be published. Required fields are marked *