Howto install chromium using simple Script

Sponsored Link
We have already discussed how to install chromium in ubuntu .One of reader Jeff Rader used our instruction to create a simple script so that it will be usefull for users

First you need to open a new file chromium.sh

gksudo gedit chromium.sh

add the following script

#!/bin/bash
#Installs Chromium Browser in Ubuntu
#Script by Jeff Rader, [email protected]
#Source from http://www.ubuntugeek.com/install-chromium-google-chrome-web-browser-in-ubuntu.html

echo "Getting ready to install chromium-browser:"

echo "
To run this script, you must be an administrator.
If you are not and you try to run this anyway,
your system administrator will be notified.

"
sudoer=null
echo -n "Continue [y or n]? "
while [ $sudoer == "null" ]; do
        read sudoer
        if [ $sudoer == "y" ]; then
                echo "Continuing..."
        elif [ $sudoer == "n" ]; then
                echo "Press ENTER to quit."
                read
                exit
        else
                echo -n "[y] or [n]: "
                sudoer=null
        fi
done

disto=`awk '{print $1}' /etc/issue`
if [ $disto == "Ubuntu" ]; then
        vers=`awk '{print $2}' /etc/issue`
                if [ "$vers" == "9.10" ]; then
                        echo "You are using $disto $vers"
                        echo "Adding Launchpad to /etc/apt/sources.list"
                        sudo cat >> /etc/apt/sources.list << EOF

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

EOF
                elif [ "$vers" == "9.04" ]; then
                        echo "You are using $disto $vers"
                        echo "Adding Launchpad to /etc/apt/sources.list"
                        sudo cat >> /etc/apt/sources.list << EOF

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main

EOF
                elif [ "$vers" == "8.10" ]; then
                        echo "You are using $disto $vers"
                        echo "Adding Launchpad to /etc/apt/sources.list"
                        sudo cat >> /etc/apt/sources.list << EOF

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main

EOF
                else
                        clear
                        echo "This scipt does not support $distro $ver
                        Press ENTER to exit:"
                        read
                        exit
                fi
else
        vers=`awk '{print $2}' /etc/issue`
        echo "This script only works with Ubuntu 9.10, 9.04. and 8.10.
You are using $distro $vers.
You will have to find another way to install Chromium.
Press ENTER to exit:"
        read
        exit
fi
echo "Adding Key"
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com
0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5
echo "Updating"
sudo apt-get update
echo "Installing Chromium-Browser"
sudo apt-get install chromium-browser
echo "Killing Firefox"
killall firefox
echo "Starting Chromium
"
chromium-browser
echo "Press Enter to exit:"
read
exit

Save and exit the file

OR

Simply download chromium.sh script

Now change the permissions

chmod 755 chromium.sh

Run the script

sudo sh chromium.sh

Sponsored Link

Related posts

7 thoughts on “Howto install chromium using simple Script

  1. I don’t believe you need to do all this in Karmic (Ubuntu 9.10). All you need is:

    $ sudo add-apt-repository ppa:chormium-daily/ppa
    $ sudo aptitude update
    $ sudo aptitude install chromium-browser

    [Reply]

  2. hi,
    thanks for the script.

    A quick tip to simplify the distribution recognition :

    —-
    distro=$(lsb_release -i|awk ‘{print $3}’)
    ver=$(lsb_release -c|awk ‘{print $2}’|sed ‘/\(karmic\)\|\(jaunty\)\|\(intrepid\)/!d’)
    —-

    then just test distro and version ($version must be empty string for a wrong version) and

    —-
    sudo cat >> /etc/apt/sources.list.d/chromium.list << EOF
    #Chromium Browser
    ##KEY sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com
    0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5
    deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu $ver main
    deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu $ver main
    EOF
    —-

    [Reply]

  3. I am getting an error that says: Continue [y or n]? [: 29: null: unexpected operator
    [: 76: Ubuntu: unexpected operator
    This script only works with Ubuntu 9.10, 9.04. and 8.10.
    You are using 9.10.
    You will have to find another way to install Chromium.
    Press ENTER to exit:
    read: 76: arg count

    [Reply]

  4. IMHO this method will work, but is far from being perfect.
    Your script should use /etc/apt/sources.list.d/chromium.list dedicated file instead of /etc/apt/sources.list which might and will be replaced by Ubuntu upgrade scripts.

    [Reply]

  5. Thanks for taking the effort to write this script and share it with us.

    IMHO I would not have killed firefox without a warning or prompting the person running the script.

    Do you really need to include the chromium startup in the script? You could prompt the user in the script if they now want to run Chromium, noting that if they want to import Firefox settings then they should exit Firefox first.

    [Reply]

  6. I use Ubuntu Tweak. Add the third party repo for Chromium and after a reload, you’re prompted to install it. All GUI based work here. Also install Chrome through the Google repos.

    [Reply]

Leave a comment

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