LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Google Chrome Auto Update (http://www.linuxquestions.org/questions/slackware-14/google-chrome-auto-update-887131/)

blue_k 06-18-2011 11:52 PM

Google Chrome Auto Update
 
Hello,

I was wondering if there was a way to have Google Chrome auto update like in Windows. I am running Chrome on both Slackware 13.37 and Slackware64 13.37. I used the Slackbuild in the Extras folder from the Slackware DVD.

andrewthomas 06-18-2011 11:59 PM

No.

Nor does firefox auto-update as it does in windows.

Linux is not windows.

EDIT: In retrospect, it does seem that my post was a bit harsh and I am sorry for the tone.

EricTRA 06-19-2011 12:02 AM

Hi,

It's been since my laptop died last year that I haven't used Slackware but if you want to automatically update something you'll need to use something like sbopkg and configure it to check and download from a repository.

Kind regards,

Eric

EricTRA 06-19-2011 12:06 AM

Quote:

Originally Posted by andrewthomas (Post 4389739)
No.

Nor does firefox auto-update as it does in windows.

Linux is not windows.

Hi,

Sorry, but that's a bit to strong. It depends on the distro you use and the availability of the software. I use Google Chrome on Linux Mint Debian edition and get updates on a regular basis, whenever mintUpdate runs and there are updates available, just pointing to http://dl.google.com/linux/chrome/deb/ as repository. I use Nightly as FireFox version (develop channel) and it checks for updates whenever started and installs them automatically.

Kind regards,

Eric

mRgOBLIN 06-19-2011 12:45 AM

But that is the package management software updating via the distro specific tools
It's not actually Firefox or Chrome running the "Auto-update" feature.

But yes while certainly true, it was probably a bit of a harsh response to a valid question.

EricTRA 06-19-2011 12:49 AM

Hello,

You're correct of course, for Chrome that is. The 'Nightly' version of FireFox I use has no repository configured in any way that I'm aware of, yet whenever I start it, the browser checks for updates and presents them without user intervention for installation or installs them automatically upon the next restart of the browser.

Kind regards,

Eric

mRgOBLIN 06-19-2011 12:52 AM

Perhaps it's installed in a local directory or it's running with (or being allowed for update purposes) root permissions.

blue_k 06-19-2011 01:40 AM

Hi,

Thank you for your answers. Is there anyway I can have Slackpkg update Chrome?

EDIT:

I made a bash script that does what I want. This problem is now solved.

neymac 06-19-2011 09:19 AM

Quote:

Originally Posted by blue_k (Post 4389770)
Hi,

Thank you for your answers. Is there anyway I can have Slackpkg update Chrome?

EDIT:

I made a bash script that does what I want. This problem is now solved.

Could you please post your script. I'd like to try it.

blue_k 06-19-2011 05:11 PM

Quote:

Originally Posted by neymac (Post 4389925)
Could you please post your script. I'd like to try it.

No problem! Here is the script. Where it says USER=USERNAME, just change USERNAME to the username on your computer. The script expects the SlackBuild script to be in your Downloads folder where Chrome normally downloads files from the internet, so make sure that the SlackBuild script is in there. Also, the script must be run as root, but don't worry as you can see there is nothing malicious. The rm commands it runs in the end just deletes the .deb file it downloads and the package that the SlackBuild script makes, this helps clean things up for the next time you update. Please let me know if there are any problems with it, or if there is anyway I can improve it.

Code:

#!/bin/bash
USER=USERNAME

cd /home/$USER/Downloads

wget --no-check-certificate https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

./google-chrome.SlackBuild

cd /tmp

upgradepkg google-chrome*

rm /tmp/google-chrome*

rm /home/$USER/Downloads/google-chrome-stable_current_amd64.deb


neymac 06-19-2011 07:50 PM

Thank you, blue_k.
As sugestion, instead of "./google-chrome.SlackBuild" line, you can replace it (copy and paste) with the body of google-chrome.SlackBuild script.
And you don't need the google-chrome.SlackBuild script in your Downloads folder anymore.

Code:

#!/bin/bash
cd /tmp
wget --no-check-certificate https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

#here starts the google-chrome slackbuild script

PRGNAM=google-chrome
VERSION=10.0.648.127
RELEASE=stable                # stable, beta, or unstable
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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

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

set -eu

# Get the real version, thanks to Fred Richards.
REAL_VER=$(ar p google-chrome-${RELEASE}_current_${DEBARCH}.deb control.tar.gz | tar zxO ./control | grep Version | awk '{print $2}' | cut -d- -f1)

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
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

chmod 0755 $PKG # Put this back.
chmod 4755 opt/google/chrome/chrome-sandbox # This needs to be SUID.
rm -rf etc/ # The cron job is debian/ubuntu only.

# We need bits of Moz, do this as dynamically as possible:
MISSING_LIBS=$(ldd opt/google/chrome/chrome | grep "not found" | cut -d\  -f1 | xargs)
for MLIB in $MISSING_LIBS ; do
  ln -s /usr/lib${LIBDIRSUFFIX}/seamonkey/${MLIB%.?d} opt/google/chrome/$MLIB
done

mv $PKG/usr/share/man $PKG/usr/man
gzip -9 $PKG/usr/man/man?/*.?

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
ln -s /opt/google/chrome/google-chrome.desktop \
  $PKG/usr/share/applications/google-chrome.desktop

#mkdir -p $PKG/usr/doc/$PRGNAM-$REAL_VER
#cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$REAL_VER/$PRGNAM.SlackBuild

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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$REAL_VER-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

#here ends the google-chrome slackbuild script

upgradepkg /tmp/google-chrome*
rm /tmp/google-chrome*

In blue colors the "original" script with some changes.
Green colors is slackbuild google-chrome script pasted.

blue_k 06-19-2011 10:53 PM

Thank you for the suggestions neymac.

rinias 01-01-2012 01:41 PM

If you want this for Chromium...
 
... the SlackWiki has a very good post here : http://slackwiki.com/Chromium_browser

They also show you how to set up a cron job to have it check for updates and install them as often (or seldom) as you'd like.

ruario 01-03-2012 06:27 AM

I work for Opera, so I'm tempted not to reply to this and rather suggest that you just give Opera a try instead! :P (If you do my op2slk script handles package format conversion and includes an update script). However, I'm also a realist and understand that people have their own preferences and may want to choose Firefox, Chrome or some other browser over Opera.

As I am also a Slackware user and like to have the latest versions of competitor products installed for comparative testing I wrote a script to automate grabbing the latest version. I keep the script (which I call 'fetch_chrome') in a directory with PatV's google-chrome.SlackBuild and slack-desc. When I think there is a new version I can then run it within that directory to pull down the latest package and compare version numbers with the installed version. Only if it actually is a newer version do I bother to run the google-chrome.SlackBuild. Anyway, I suppose this might be handy for someone else so here is the script:

Edit: I made a better version of the following script in a later post. I am leaving the old one below purely for comparison.

Code:

#!/bin/sh

if [ -x /usr/bin/google-chrome ]; then
  CURVERSION=$(google-chrome --version | awk '{print $3}')
  echo "Google Chrome installed: ${CURVERSION}"
else
  CURVERSION=UNKNOWN
  echo "Could not detect an installed version of Google Chrome"
fi

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

curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_${DEBARCH}.deb

NEWVERSION=$(bsdtar xqOf google-chrome-stable_current_${DEBARCH}.deb control.tar.gz | bsdtar -xOf- control | sed -n "s/^Version: \([0-9.]*\)-.*/\1/p")

if [ "${CURVERSION}" = "${NEWVERSION}" ]; then
  echo "The Google Chrome downloaded (${NEWVERSION}) is the same as the version installed."
else
  echo "Google Chrome downloaded: ${NEWVERSION}"
fi

P.S. In case you are wondering, bsdtar is installed in a full install of Slackware by default as it is part of the libarchive package. The 'q' option should mean that is is faster at reading the deb archive than ar, hence why I use it when working out the NEWVERSION variable. ;)

ruario 01-03-2012 06:46 AM

Quote:

Originally Posted by neymac (Post 4390269)
And you don't need the google-chrome.SlackBuild script in your Downloads folder anymore.

Unless you keep a copy of the slack-desc in /tmp at all times it will be missing from the final package if done this way. ;)


All times are GMT -5. The time now is 11:33 AM.