[Solved] Update Google Chrome

Get help with XFCE specific problems
Jacoby59
Black ninja
Black ninja
Posts: 49
Joined: 07 Apr 2014, 04:10
Distribution: Porteus 3.0 RazorQT
Location: Chicago

[Solved] Update Google Chrome

Post#1 by Jacoby59 » 17 Sep 2014, 05:29

Is there a way to update google chrome on porteus xfce? The version that came with the distro is 33, while the current version of chrome is 39. I'm having problems playing HTML5 videos because of the old version. Thanks!
Last edited by Jacoby59 on 19 Sep 2014, 14:54, edited 1 time in total.

Payoon
Black ninja
Black ninja
Posts: 88
Joined: 01 Mar 2013, 19:16
Distribution: Porteus 3.2 32 bit XFCE
Location: Duisburg, Germany

Re: Update Google Chrome

Post#2 by Payoon » 17 Sep 2014, 20:16

Hi Jacoby59,
here is how I did it:
Download the chrome 39 as a deb binary file from the chrome home page. Convert the deb file to xzm file (command: deb2xzm). Extract the chrome 39.xzm file (xzm2dir). Extract your original chrome 33.xzm (xzm2dir). Replace the content from chrome 33 /opt directory with the content of chrome 39 /opt directory. If you want to run as root change the last line of the file /opt/google/chrome/google-chrome to look like this:

Code: Select all

exec -a "$0" "$HERE/chrome"  "$@" --user-data-dir
Make a new module from the chrome 39 directory ( dir2xzm). That's all.
Happy browsing.

Payoon

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Update Google Chrome

Post#3 by brokenman » 18 Sep 2014, 02:22

Here is the script I am using. Save it to a file. Make it executable: chmod +x yourfile.sh
Run it: ./yourfile.sh

Code: Select all

#!/bin/sh

    PKGNAM=google-chrome
    RELEASE=${RELEASE:-stable}    # stable, beta, or unstable

    ARCH=${ARCH:-$(uname -m)}

    case "$ARCH" in
      i?86) DEBARCH="i386" ; LIBDIRSUFFIX="" ; ARCH=i386 ; GARCH=i386 ;;
      x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ; ARCH=x86_64 ; GARCH=amd64 ;;
      *) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;;
    esac

    # Download latest version from Google servers
if [ ! -f google-chrome-stable_current_amd64.deb ]; then
    wget --no-check-certificate "https://dl.google.com/linux/direct/google-chrome-stable_current_$GARCH.deb"
fi

    # Get the version from the Debian/Ubuntu .deb (thanks to Fred Richards):
    VERSION=$(ar p google-chrome-${RELEASE}_current_${DEBARCH}.deb control.tar.gz 2> /dev/null | tar zxO ./control 2> /dev/null | grep Version | awk '{print $2}' | cut -d- -f1)
    BUILD=${BUILD:-1}


    if [ ! $UID = 0 ]; then
cat << EOF

    This script must be run as root.

EOF
      exit 1
    fi

    if ! /bin/ls google-chrome-*.deb 1> /dev/null 2> /dev/null ; then
cat << EOF

    This is a script to repackage a Debian/Ubuntu Google Chrome .deb package
    for Slackware.  Run this script in the same directory as one of these
    binary packages:

      google-chrome-stable_current_amd64.deb  (for 64-bit x86_64)
      google-chrome-stable_current_i386.deb   (for 32-bit x86)
     
    This will create a Slackware .txz package.  Install it with installpkg
    or use upgradepkg to upgrade from a previous version.

EOF
      exit 1
    fi

    CWD=$(pwd)
    TMP=${TMP:-/tmp}
    PKG=$TMP/package-$PKGNAM
    OUTPUT=${OUTPUT:-/tmp}

    rm -rf $PKG
    mkdir -p $TMP $PKG $OUTPUT
    cd $PKG
    ar p $CWD/google-chrome-${RELEASE}_current_${DEBARCH}.deb data.tar.lzma | lzma -d | tar xv || exit 1
    chown -R root:root .
    chmod -R u+w,go+r-w,a-s .

    # Make sure top-level perms are correct:
    chmod 0755 .
    # This needs to be setuid root:
    chmod 4711 opt/google/chrome/chrome-sandbox
    # The cron job is for Debian/Ubuntu only:
    rm -rf etc

    # Link to the standard Mozilla library names:
    sed -i 's,libnss3.so.1d,libnss3.so\x00\x00\x00,g;
            s,libnssutil3.so.1d,libnssutil3.so\x00\x00\x00,g;
            s,libsmime3.so.1d,libsmime3.so\x00\x00\x00,g;
            s,libssl3.so.1d,libssl3.so\x00\x00\x00,g;
            s,libplds4.so.0d,libplds4.so\x00\x00\x00,g;
            s,libplc4.so.0d,libplc4.so\x00\x00\x00,g;
            s,libnspr4.so.0d,libnspr4.so\x00\x00\x00,g;' opt/google/chrome/chrome

    # --mandir=/usr/man:
    mv $PKG/usr/share/man $PKG/usr/man
    # Compress manual pages:
    find $PKG/usr/man -type f -exec gzip -9 {} \;
    for i in $( find $PKG/usr/man -type l ) ; do
      ln -s $( readlink $i ).gz $i.gz
      rm $i
    done

    # Install a .desktop launcher:
    sed -i -e "s#Icon=google-chrome#Icon=/opt/google/chrome/product_logo_256.png#" \
      $PKG/opt/google/chrome/google-chrome.desktop
    mkdir -p $PKG/usr/share/applications
    cp -a $PKG/opt/google/chrome/google-chrome.desktop \
      $PKG/usr/share/applications/browser.desktop

    mkdir -p $PKG/install
    cat $CWD/slackbuild/slack-desc > $PKG/install/slack-desc

    cd $PKG
    /sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz

#    if [ -f "$OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz" ]; then txz2xzm $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.xzm; fi

#    rm -f $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
How do i become super user?
Wear your underpants on the outside and put on a cape.

Jacoby59
Black ninja
Black ninja
Posts: 49
Joined: 07 Apr 2014, 04:10
Distribution: Porteus 3.0 RazorQT
Location: Chicago

Re: Update Google Chrome

Post#4 by Jacoby59 » 18 Sep 2014, 03:39

Hi Payoon. Should I replace the content from chrome 39 /opt directory with the content of chrome 33 /opt directory or vice versa?

Payoon
Black ninja
Black ninja
Posts: 88
Joined: 01 Mar 2013, 19:16
Distribution: Porteus 3.2 32 bit XFCE
Location: Duisburg, Germany

Re: Update Google Chrome

Post#5 by Payoon » 18 Sep 2014, 04:10

Hi Jacoby59

Replace the content from chrome 33 /opt (which is your old chrome) directory with the content of chrome 39 /opt directory (the new chrome).
The meaning is to delete the content of the old chrome 33 /opt folder so that it is empty and copy the content of your downloaded chrome 39 /opt folder into the empty folder of chrome 33 /opt. After that rename the complete old chrome 33 dir to something like "my new chrome 39" and make a module with dir2xzm. Maybe that was a little confusing, sorry.

Edit: To use the great script from brokenman is more convient than my layman system. You find the finished txz file in the /temp directory.

Payoon

Jacoby59
Black ninja
Black ninja
Posts: 49
Joined: 07 Apr 2014, 04:10
Distribution: Porteus 3.0 RazorQT
Location: Chicago

Re: Update Google Chrome

Post#6 by Jacoby59 » 19 Sep 2014, 10:40

Okay I did everything like you said —
  • I downloaded the latest stable Google Chrome release (deb file)
  • Converted it to a module (let's say newchrome.xzm) using deb2xzm
  • Extracted the files from newchrome.xzm to a folder (newgoogle) using xzm2dir
  • Extracted the files from the old module (let's call it oldchrome.xzm) to a folder (oldgoogle) using xzm2dir
  • Deleted the opt folder from oldgoogle folder
  • Browsed to newgoogle folder and copied opt folder
  • Pasted the opt folder in oldgoogle folder
  • Converted oldgoogle folder to a module (USM>Tools>Porteus Modules Tools>Create a module from a folder)
However, when I ran the module, I got this error -

Failed to execute child process "/usr/bin/google-chrome-stable" (No such file or directory)

Did I miss something?

Jacoby59
Black ninja
Black ninja
Posts: 49
Joined: 07 Apr 2014, 04:10
Distribution: Porteus 3.0 RazorQT
Location: Chicago

Re: Update Google Chrome

Post#7 by Jacoby59 » 19 Sep 2014, 10:43

Hi brokenman. Should I run the script after deactivating oldchrome.xzm? I ran it without deactivating it and it automatically downloaded the latest stable release (which I already had, in the same directory), but it proceeded no further. What should I do once the deb file is downloaded? Thanks.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Update Google Chrome

Post#8 by brokenman » 19 Sep 2014, 13:17

I guess you are running 32bit. Please change the line near the top of the script from:

if [ ! -f google-chrome-stable_current_amd64.deb ]; then

to

if [ ! -f google-chrome-stable_current_$GARCH.deb ]; then

The script should then use the .deb file in the same folder (without downloading another) and then it will process the file and leave a .txz file waiting in /tmp.
If you want a module you can convert the .txz with: txz2xzm /tmp/filename.txz

If it doesn't work it could be that some code was messed up when pasting into the forum and using code tags. In this case I can upload the script somewhere for you.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Jacoby59
Black ninja
Black ninja
Posts: 49
Joined: 07 Apr 2014, 04:10
Distribution: Porteus 3.0 RazorQT
Location: Chicago

Re: Update Google Chrome

Post#9 by Jacoby59 » 19 Sep 2014, 14:54

That solved it! Thanks a lot!

Payoon
Black ninja
Black ninja
Posts: 88
Joined: 01 Mar 2013, 19:16
Distribution: Porteus 3.2 32 bit XFCE
Location: Duisburg, Germany

Re: [Solved] Update Google Chrome

Post#10 by Payoon » 20 Sep 2014, 05:05

Hi Jacoby59,
no you did everything exactly right.
In the folder of your newchrome39 ( meaning before compression) go to the /opt/google/chrome directory there is a file that can have 3 names : google-chrome, google-chrome-stable or google-chrome-unstable. The best way is to change the desktop file in /usr/share/applications . In my case it'sname is "browser.desktop" and has the chrome logo. Edit it and change the line with exec ( in my case
Exec=/opt/google/chrome/google-chrome %U
to the appropriate name in /opt/google/chrome which in your case should be google-chrome-unstable, because chrome 39 is still unstable.
To test your chrome before doing all that you can execute the /opt/google/chrome/google-chrome-??? file from the command line (after the module was activated) to see if your new browser starts and then proceed to modifying the extracted folder.
The reason for all that, is that my google-chrome has many "update fathers" for example stable , unstable , puppy linux and I always have upgraded and adapted accordingly but without writing anything down ( a mistake like always) .
Hope it helps you
Payoon

User avatar
francois
Contributor
Contributor
Posts: 6433
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: [Solved] Update Google Chrome

Post#11 by francois » 11 Jan 2016, 19:37

@brokenman:
Your script built the google-chrome-current in the folder where your script is. Great little program.
Thanks.

Edit:
To start google-chrome while you are in root mode use<;

Code: Select all

su -c /opt/google/chrome/google-chrome guest
You edit kde menu to put this line in command line argument.
- the google-chrome icon is in /opt/google/chrome/
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6433
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: [Solved] Update Google Chrome

Post#12 by francois » 17 Jan 2016, 17:59

Edited precedent post to provide an effective path to google-chrome and to provide the necessary icon for the browser. :wink:
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6433
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: [Solved] Update Google Chrome

Post#13 by francois » 30 Jan 2016, 20:30

Version 47.0.2526.106 (64-bit) google chrome:

1) unable to download isos
2) unable to attach documents to emails

Anyone else with that type of problem?
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6433
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: [Solved] Update Google Chrome

Post#14 by francois » 28 Feb 2016, 17:00

Chromium from alien bob (link being courtesy of slaxmax):
http://www.slackware.com/~alien/slackbu ... 2alien.txz

Edited to provide the right hyperlink.
Prendre son temps, profiter de celui qui passe.

User avatar
amplatfus
Samurai
Samurai
Posts: 153
Joined: 30 Oct 2012, 14:55
Distribution: MATE Porteus-v5.0rc1
Location: Romania

Re: Update Google Chrome

Post#15 by amplatfus » 25 Mar 2016, 18:55

brokenman wrote:Here is the script I am using. Save it to a file. Make it executable: chmod +x yourfile.sh
Run it: ./yourfile.sh

Code: Select all

#!/bin/sh

    PKGNAM=google-chrome
    RELEASE=${RELEASE:-stable}    # stable, beta, or unstable

    ARCH=${ARCH:-$(uname -m)}

    case "$ARCH" in
      i?86) DEBARCH="i386" ; LIBDIRSUFFIX="" ; ARCH=i386 ; GARCH=i386 ;;
      x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ; ARCH=x86_64 ; GARCH=amd64 ;;
      *) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;;
    esac

    # Download latest version from Google servers
if [ ! -f google-chrome-stable_current_amd64.deb ]; then
    wget --no-check-certificate "https://dl.google.com/linux/direct/google-chrome-stable_current_$GARCH.deb"
fi

    # Get the version from the Debian/Ubuntu .deb (thanks to Fred Richards):
    VERSION=$(ar p google-chrome-${RELEASE}_current_${DEBARCH}.deb control.tar.gz 2> /dev/null | tar zxO ./control 2> /dev/null | grep Version | awk '{print $2}' | cut -d- -f1)
    BUILD=${BUILD:-1}


    if [ ! $UID = 0 ]; then
cat << EOF

    This script must be run as root.

EOF
      exit 1
    fi

    if ! /bin/ls google-chrome-*.deb 1> /dev/null 2> /dev/null ; then
cat << EOF

    This is a script to repackage a Debian/Ubuntu Google Chrome .deb package
    for Slackware.  Run this script in the same directory as one of these
    binary packages:

      google-chrome-stable_current_amd64.deb  (for 64-bit x86_64)
      google-chrome-stable_current_i386.deb   (for 32-bit x86)
     
    This will create a Slackware .txz package.  Install it with installpkg
    or use upgradepkg to upgrade from a previous version.

EOF
      exit 1
    fi

    CWD=$(pwd)
    TMP=${TMP:-/tmp}
    PKG=$TMP/package-$PKGNAM
    OUTPUT=${OUTPUT:-/tmp}

    rm -rf $PKG
    mkdir -p $TMP $PKG $OUTPUT
    cd $PKG
    ar p $CWD/google-chrome-${RELEASE}_current_${DEBARCH}.deb data.tar.lzma | lzma -d | tar xv || exit 1
    chown -R root:root .
    chmod -R u+w,go+r-w,a-s .

    # Make sure top-level perms are correct:
    chmod 0755 .
    # This needs to be setuid root:
    chmod 4711 opt/google/chrome/chrome-sandbox
    # The cron job is for Debian/Ubuntu only:
    rm -rf etc

    # Link to the standard Mozilla library names:
    sed -i 's,libnss3.so.1d,libnss3.so\x00\x00\x00,g;
            s,libnssutil3.so.1d,libnssutil3.so\x00\x00\x00,g;
            s,libsmime3.so.1d,libsmime3.so\x00\x00\x00,g;
            s,libssl3.so.1d,libssl3.so\x00\x00\x00,g;
            s,libplds4.so.0d,libplds4.so\x00\x00\x00,g;
            s,libplc4.so.0d,libplc4.so\x00\x00\x00,g;
            s,libnspr4.so.0d,libnspr4.so\x00\x00\x00,g;' opt/google/chrome/chrome

    # --mandir=/usr/man:
    mv $PKG/usr/share/man $PKG/usr/man
    # Compress manual pages:
    find $PKG/usr/man -type f -exec gzip -9 {} \;
    for i in $( find $PKG/usr/man -type l ) ; do
      ln -s $( readlink $i ).gz $i.gz
      rm $i
    done

    # Install a .desktop launcher:
    sed -i -e "s#Icon=google-chrome#Icon=/opt/google/chrome/product_logo_256.png#" \
      $PKG/opt/google/chrome/google-chrome.desktop
    mkdir -p $PKG/usr/share/applications
    cp -a $PKG/opt/google/chrome/google-chrome.desktop \
      $PKG/usr/share/applications/browser.desktop

    mkdir -p $PKG/install
    cat $CWD/slackbuild/slack-desc > $PKG/install/slack-desc

    cd $PKG
    /sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz

#    if [ -f "$OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz" ]; then txz2xzm $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.xzm; fi

#    rm -f $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Thank you for script. It seems that in LXDE 64bits is not working any more. I am looking for an updated version of Chrome, if you have one, could you please upload (64bits) and (32bits)?

BR,
amplatfus
Porteus-v5.0. rc1 MATE. Thank you all dev team and @Blaze for helping to configure it, thanks to entire Porteus community members for great topics.
Kernel: 000-kernel-5.4.8,xzm

Post Reply