syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
How I install Meteor?
Tags: meteor linux

Google sent me to an old webpage:

https://www.meteor.com/blog/2012/03/06/full-linux-support

I used wget to inspect the shell script at install.meteor.com

The script looks like this:
#!/bin/sh

# This is the Meteor install script!
#
# Are you looking at this in your web browser, and would like to install Meteor?
# Just open up your terminal and type:
#
#    curl https://install.meteor.com/ | sh
#
# Meteor currently supports:
#   - Mac: OS X 10.6 and above
#   - Linux: x86 and x86_64 systems

# We wrap this whole script in a function, so that we won't execute
# until the entire script is downloaded.
# That's good because it prevents our output overlapping with curl's.
# It also means that we can't run a partially downloaded script.
# We don't indent because it would be really confusing with the heredocs.
run_it () {

# This always does a clean install of the latest version of Meteor into your
# ~/.meteor, replacing whatever is already there. (~/.meteor is only a cache of
# packages and package metadata; no personal persistent data is stored there.)

RELEASE="1.0.2.1"


# Now, on to the actual installer!

## NOTE sh NOT bash. This script should be POSIX sh only, since we don't
## know what shell the user has. Debian uses 'dash' for 'sh', for
## example.

PREFIX="/usr/local"

set -e
set -u

# Let's display everything on stderr.
exec 1>&2


UNAME=$(uname)
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
    echo "Sorry, this OS is not supported yet."
    exit 1
fi


if [ "$UNAME" = "Darwin" ] ; then
  ### OSX ###
  if [ "i386" != "$(uname -p)" -o "1" != "$(sysctl -n hw.cpu64bit_capable 2>/dev/null || echo 0)" ] ; then
    # Can't just test uname -m = x86_64, because Snow Leopard can
    # return other values.
    echo "Only 64-bit Intel processors are supported at this time."
    exit 1
  fi

  # Running a version of Meteor older than 0.6.0 (April 2013)?
  if grep BUNDLE_VERSION /usr/local/bin/meteor >/dev/null 2>&1 ; then
    echo "You appear to have a very old version of Meteor installed."
    echo "Please remove it by running these commands:"
    echo "  $ sudo rm /usr/local/bin/meteor"
    echo "  $ sudo rm -rf /usr/local/meteor /usr/local/meteor.old"
    echo "and then run the installer command again:"
    echo "  $ curl https://install.meteor.com/ | sh"
    exit 1
  fi

  PLATFORM="os.osx.x86_64"
elif [ "$UNAME" = "Linux" ] ; then
  ### Linux ###
  LINUX_ARCH=$(uname -m)
  if [ "${LINUX_ARCH}" = "i686" ] ; then
    PLATFORM="os.linux.x86_32"
  elif [ "${LINUX_ARCH}" = "x86_64" ] ; then
    PLATFORM="os.linux.x86_64"
  else
    echo "Unusable architecture: ${LINUX_ARCH}"
    echo "Meteor only supports i686 and x86_64 for now."
    exit 1
  fi

  # Running a version of Meteor older than 0.6.0 (April 2013) on a dpkg system?
  if dpkg -s meteor >/dev/null 2>&1 ; then
    echo "You appear to have a very old version of Meteor installed."
    echo "Please remove it by running these commands:"
    echo "  $ sudo dpkg -r meteor"
    echo "  $ hash -r"
    echo "and then run the installer command again:"
    echo "  $ curl https://install.meteor.com/ | sh"
    exit 1
  fi

  # Running a version of Meteor older than 0.6.0 (April 2013) on an rpm system?
  if rpm -q meteor >/dev/null 2>&1 ; then
    echo "You appear to have a very old version of Meteor installed."
    echo "Please remove it by running these commands:"
    echo "  $ sudo rpm -e meteor"
    echo "  $ hash -r"
    echo "and then run the installer command again:"
    echo "  $ curl https://install.meteor.com/ | sh"
    exit 1
  fi
fi

trap "echo Installation failed." EXIT

# If you already have a tropohouse/warehouse, we do a clean install here:
if [ -e "$HOME/.meteor" ]; then
  echo "Removing your existing Meteor installation."
  rm -rf "$HOME/.meteor"
fi

TARBALL_URL="https://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz"

INSTALL_TMPDIR="$HOME/.meteor-install-tmp"
rm -rf "$INSTALL_TMPDIR"
mkdir "$INSTALL_TMPDIR"
echo "Downloading Meteor distribution"
curl --progress-bar --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR" -o
# bomb out if it didn't work, eg no net
test -x "${INSTALL_TMPDIR}/.meteor/meteor"
mv "${INSTALL_TMPDIR}/.meteor" "$HOME"
rm -rf "${INSTALL_TMPDIR}"
# just double-checking :)
test -x "$HOME/.meteor/meteor"



echo
echo "Meteor ${RELEASE} has been installed in your home directory (~/.meteor)."

METEOR_SYMLINK_TARGET="$(readlink "$HOME/.meteor/meteor")"
METEOR_TOOL_DIRECTORY="$(dirname "$METEOR_SYMLINK_TARGET")"
LAUNCHER="$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor"




if cp "$LAUNCHER" "$PREFIX/bin/meteor" >/dev/null 2>&1; then
  echo "Writing a launcher script to $PREFIX/bin/meteor for your convenience."
  cat <<"EOF"

To get started fast:

  $ meteor create ~/my_cool_app
  $ cd ~/my_cool_app
  $ meteor

Or see the docs at:

  docs.meteor.com

EOF
elif type sudo >/dev/null 2>&1; then
  echo "Writing a launcher script to $PREFIX/bin/meteor for your convenience."
  echo "This may prompt for your password."

  # New macs (10.9+) don't ship with /usr/local, however it is still in
  # the default PATH. We still install there, we just need to create the
  # directory first.
  # XXX this means that we can run sudo too many times. we should never
  #     run it more than once if it fails the first time
  if [ ! -d "$PREFIX/bin" ] ; then
      sudo mkdir -m 755 "$PREFIX" || true
      sudo mkdir -m 755 "$PREFIX/bin" || true
  fi

  if sudo cp "$LAUNCHER" "$PREFIX/bin/meteor"; then
    cat <<"EOF"

To get started fast:

  $ meteor create ~/my_cool_app
  $ cd ~/my_cool_app
  $ meteor

Or see the docs at:

  docs.meteor.com

EOF
  else
    cat <<EOF

Couldn't write the launcher script. Please either:

  (1) Run the following as root:
        cp "$LAUNCHER" /usr/bin/meteor
  (2) Add "\$HOME/.meteor" to your path, or
  (3) Rerun this command to try again.

Then to get started, take a look at 'meteor --help' or see the docs at
docs.meteor.com.
EOF
  fi
else
  cat <<EOF

Now you need to do one of the following:

  (1) Add "\$HOME/.meteor" to your path, or
  (2) Run this command as root:
        cp "$LAUNCHER" /usr/bin/meteor

Then to get started, take a look at 'meteor --help' or see the docs at
docs.meteor.com.
EOF
fi


trap - EXIT
}

run_it

It looks like the script wants to install meteor in ~/.meteor

I was happy with that so I ran the script:
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ /bin/sh meteor.sh 
Downloading Meteor distribution

curl: (77) error setting certificate verify locations:
  CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Installation failed.
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
Darn, we have a bad certificate somewhere.

I did this:
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ grep RELEASE meteor.sh 
RELEASE="1.0.2.1"
TARBALL_URL="https://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz"
echo "Meteor ${RELEASE} has been installed in your home directory (~/.meteor)."
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ grep PLATFORM meteor.sh 
  PLATFORM="os.osx.x86_64"
    PLATFORM="os.linux.x86_32"
    PLATFORM="os.linux.x86_64"
TARBALL_URL="https://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz"
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ export RELEASE="1.0.2.1"
dan@hp ~/tmp $ export PLATFORM="os.linux.x86_64"
dan@hp ~/tmp $ 
dan@hp ~/tmp $ wget http://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz
--2015-01-16 00:42:42--  http://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/1.0.2.1/meteor-bootstrap-os.linux.x86_64.tar.gz
Resolving d3sqy0vbqsdhku.cloudfront.net (d3sqy0vbqsdhku.cloudfront.net)... 54.192.144.132, 54.192.145.207, 54.192.144.233, ...
Connecting to d3sqy0vbqsdhku.cloudfront.net (d3sqy0vbqsdhku.cloudfront.net)|54.192.144.132|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71690872 (68M) [application/x-tar]
Saving to: ‘meteor-bootstrap-os.linux.x86_64.tar.gz’

100%[======================================>] 71,690,872   147KB/s   in 10m 47s

2015-01-16 00:53:29 (108 KB/s) - ‘meteor-bootstrap-os.linux.x86_64.tar.gz’ saved [71690872/71690872]

dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 


dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ tar zxf meteor-bootstrap-os.linux.x86_64.tar.gz 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ ll .meteor/
total 20
drwxr-xr-x   4 dan dan 4096 Dec 23 01:12 ./
drwxrwxr-x   6 dan dan 4096 Jan 16 00:56 ../
lrwxrwxrwx   1 dan dan   62 Dec 23 01:12 meteor -> packages/meteor-tool/1.0.38/meteor-tool-os.linux.x86_64/meteor*
drwxr-xr-x   3 dan dan 4096 Dec 23 01:12 package-metadata/
drwxr-xr-x 124 dan dan 4096 Dec 23 01:12 packages/
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ mv .meteor ~/
dan@hp ~/tmp $ 
dan@hp ~/tmp $ cd
dan@hp ~ $ 
dan@hp ~ $ cd .meteor
dan@hp ~/.meteor $ 
dan@hp ~/.meteor $ find . -name launch-meteor -print
./packages/meteor-tool/.1.0.38.ieqxkv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/scripts/admin/launch-meteor
dan@hp ~/.meteor $ 
dan@hp ~/.meteor $ ln -s ./packages/meteor-tool/.1.0.38.ieqxkv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/scripts/admin/launch-meteor .
dan@hp ~/.meteor $ 
dan@hp ~/.meteor $ mkdir -p ~/bin/
dan@hp ~/.meteor $ cd ~/bin/
dan@hp ~/bin $ 
dan@hp ~/bin $ ln -s ~/.meteor/launch-meteor .
dan@hp ~/bin $ 
dan@hp ~/bin $ cd
dan@hp ~ $ 
dan@hp ~ $ which launch-meteor
dan@hp ~ $ 
dan@hp ~ $ bash
dan@hp ~ $ 
dan@hp ~ $ which launch-meteor
/home/dan/bin/launch-meteor
dan@hp ~ $ 
dan@hp ~ $ cd bin
dan@hp ~/bin $ 
dan@hp ~/bin $ ln -s launch-meteor meteor 
dan@hp ~/bin $ 
dan@hp ~/bin $ cd
dan@hp ~ $ 
dan@hp ~ $ which meteor
/home/dan/bin/meteor
dan@hp ~ $ 
dan@hp ~ $ cd tmp/
dan@hp ~/tmp $ 
dan@hp ~/tmp $ meteor create meteor1
meteor1: created.

To run your new app:
  cd meteor1
  meteor
dan@hp ~/tmp $ 
dan@hp ~/tmp $ 
dan@hp ~/tmp $ cd meteor1
dan@hp ~/tmp/meteor1 $ 
dan@hp ~/tmp/meteor1 $ 
dan@hp ~/tmp/meteor1 $ which meteor
/home/dan/bin/meteor
dan@hp ~/tmp/meteor1 $ 
dan@hp ~/tmp/meteor1 $ 
dan@hp ~/tmp/meteor1 $ meteor
[[[[[ ~/tmp/meteor1 ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/



Other window:

dan@hp ~ $ 
dan@hp ~ $ 
dan@hp ~ $ curl localhost:3000
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/20ae2c8d51b2507244e598844414ecdec2615ce3.css">


<script type="text/javascript">__meteor_runtime_config__ = {"meteorRelease":"METEOR@1.0.2.1","ROOT_URL":"http://localhost:3000/","ROOT_URL_PATH_PREFIX":"","appId":"qb67hh1drf7ia1co28q2","autoupdateVersion":"f7c139a66554f167d16e00ca4615f4ea0cef7a85","autoupdateVersionRefreshable":"552dc4572cdc1c616aae686a9e6473b7f7cd2fcf","autoupdateVersionCordova":"none"};</script>

  <script type="text/javascript" src="/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18"></script>
  <script type="text/javascript" src="/packages/meteor.js?81e2f06cff198adaa81b3bc09fc4f3728b7370ec"></script>
  <script type="text/javascript" src="/packages/json.js?e22856eae714c681199eabc5c0710b904b125554"></script>
  <script type="text/javascript" src="/packages/base64.js?1a63019243b73298e2964e6d4680f25bca657726"></script>
  <script type="text/javascript" src="/packages/ejson.js?71047b64b5196348bdbe5fd5eea9ac97a5a9eb14"></script>
  <script type="text/javascript" src="/packages/logging.js?07e201b648f16be8435a4f666156995eeda0c750"></script>
  <script type="text/javascript" src="/packages/reload.js?da8974b7231dd8c0caccb5f322dcf97329d486d1"></script>
  <script type="text/javascript" src="/packages/tracker.js?7f0c5481709a504dd2254ba2a71c1cee78adc280"></script>
  <script type="text/javascript" src="/packages/random.js?fe7b46080c91ce482acf6fc326afbc5b176f0502"></script>
  <script type="text/javascript" src="/packages/retry.js?1f1dd2c35d300110fdaba51ce4473583bc3bf031"></script>
  <script type="text/javascript" src="/packages/check.js?6a833c91fc716468839ed932ff4762828cda2dc8"></script>
  <script type="text/javascript" src="/packages/id-map.js?9ea6eaae8d74693ce2505a858d9a5e60cf191298"></script>
  <script type="text/javascript" src="/packages/ordered-dict.js?bf8af2f26c8d96bf8b2e6b407d3ed69f23c2cd37"></script>
  <script type="text/javascript" src="/packages/geojson-utils.js?81b79d5cf96d00b4b7a28987debcffb665c17526"></script>
  <script type="text/javascript" src="/packages/minimongo.js?e8806aa7782b729b2517ebc0cd10b321667f1427"></script>
  <script type="text/javascript" src="/packages/ddp.js?41b62dcceb3ce0de6ca79c6aed088cccde6a44d8"></script>
  <script type="text/javascript" src="/packages/follower-livedata.js?74156c6baa89da861fc4ddb58ef158eac71e58e0"></script>
  <script type="text/javascript" src="/packages/application-configuration.js?dcbf1f0774460fccf098a4c9e8fad4c3a0f2952f"></script>
  <script type="text/javascript" src="/packages/insecure.js?3dc9d4a2dad55999b5b15a447d57f3d5fb66b290"></script>
  <script type="text/javascript" src="/packages/mongo.js?052f30e968644b2b39a96605ffee73a7684ff37b"></script>
  <script type="text/javascript" src="/packages/autoupdate.js?c823646e93561d86e6bcb3cbd2457a8540e519c1"></script>
  <script type="text/javascript" src="/packages/meteor-platform.js?499a2f8522e25820b1153c69a92751ccaae507b3"></script>
  <script type="text/javascript" src="/packages/autopublish.js?c3059a78bb200b171099fc4fa1a9345101790ddb"></script>
  <script type="text/javascript" src="/packages/webapp.js?e1be090051b82f046484dccc2de7d747e50c7328"></script>
  <script type="text/javascript" src="/packages/deps.js?504589e1e9585dec8f9f6094e5a87b22de3783a1"></script>
  <script type="text/javascript" src="/packages/reactive-dict.js?6b25309b1f0dcf775b44984324878d6f8ad1abc2"></script>
  <script type="text/javascript" src="/packages/session.js?e436deefadc999c21b6fd16e8e1ecce55c3c3a55"></script>
  <script type="text/javascript" src="/packages/livedata.js?718526445deb4d9baacb6d92c551adea1d36c1e1"></script>
  <script type="text/javascript" src="/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4"></script>
  <script type="text/javascript" src="/packages/htmljs.js?567eb96d5d22631c03d6aca6afa4c42f0d1295f2"></script>
  <script type="text/javascript" src="/packages/observe-sequence.js?2fd807ea171ead273b9e6458607cb226012d9240"></script>
  <script type="text/javascript" src="/packages/reactive-var.js?20335b7b37165980ddd9f23943b2e5b00aae1cc2"></script>
  <script type="text/javascript" src="/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb"></script>
  <script type="text/javascript" src="/packages/ui.js?5a663333fd30f8fd913f110e0ef779e84f67c4b8"></script>
  <script type="text/javascript" src="/packages/templating.js?599ba307216da826d8b335332ebcc9a497a369a0"></script>
  <script type="text/javascript" src="/packages/spacebars.js?3c496d2950151d744a8574297b46d2763a123bdf"></script>
  <script type="text/javascript" src="/packages/launch-screen.js?13e1092ebecdb7208762500188f1dc2dea5603e9"></script>
  <script type="text/javascript" src="/packages/global-imports.js?ddfcd9be6cef3c8bb0263139937a05092e4a3fe9"></script>
  <script type="text/javascript" src="/template.meteor1.js?e119ff8df948cfe8167f49eb28794995a594841c"></script>
  <script type="text/javascript" src="/meteor1.js?a4ef596255404350be2cc45303caea02f934cd17"></script>



<title>meteor1</title>
</head>
<body>

</body>
</html>
dan@hp ~ $ 
dan@hp ~ $ 
dan@hp ~ $ 

It looks like I have meteor running on my laptop.

yay!


syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me