Difference between revisions of "Linux3"

From SourceWiki
Jump to navigation Jump to search
m (Protected "Linux3" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
Line 1: Line 1:
 
[[category:Pragmatic Programming]]
 
[[category:Pragmatic Programming]]
'''More Advanced Examples'''
+
'''Starting to administer systems'''
 
=Introduction=
 
=Introduction=
  
=rsync=
+
=Installing Software=
 +
 
 +
==Package Managers==
 +
 
 +
==Building from Source Code==
 +
 
 +
Let's build the latest and greatest version of the popular, open-source statistics package--R.  We can download the source code from a mirror site right here in Bristol!
  
 
<pre>
 
<pre>
#!/bin/bash
+
cd $HOME
 +
mkdir BUILD
 +
mkdir INSTALL
 +
cd BUILD
 +
mkdir R
 +
cd R
 +
wget http://www.stats.bris.ac.uk/R/src/base/R-3/R-3.0.1.tar.gz
 +
</pre>
  
# An rsync script to, for example, synchronise an SVN checkout on your local machine
+
OK, take a look at what we have so far:
# with a copy of your checkout, kept on a remote machine.  The files are transported
 
# via SSH, so all the usual comments about using SSH keys etc. apply
 
  
# set up some env vars
+
<pre>
RSYNC=/usr/bin/rsync
+
ls -l
REMOTE_HOST="full.domain.name.here"
+
-rw-r--r-- 1 gethin gethin 25508280 2013-05-16 08:11 R-3.0.1.tar.gz
REMOTE_USER_NAME="known-as"
+
</pre>
  
# see the rsync man page for an explanation of these
+
So far, so good. Let's unpack the tarball:
OPTS='-vzrltp --progress --stats --rsh=/usr/bin/ssh --delete --exclude ".svn" --exclude "*~"'
 
  
LOCAL_SVN_CHECKOUT=/path/to/my/svn/dir
+
<pre>
REMOTE_SRC_DIR=/path/to/my/src/on/remote/machine
+
tar -xzf R-3.0.1.tar.gz
 +
ls -l
 +
drwxr-xr-x 10 gethin gethin    4096 2013-05-16 08:11 R-3.0.1
 +
-rw-r--r--  1 gethin gethin 25508280 2013-05-16 08:11 R-3.0.1.tar.gz
 +
</pre>
  
# call rsync to PUSH your files to the remote host
+
We have a directory called '''R-3.0.1''', let's move into that directory and start the build process.
$RSYNC $OPTS $LOCAL_SVN_CHECKOUT $REMOTE_USER_NAME@$REMOTE_HOST:$REMOTE_SRC_DIR
 
  
exit 0
+
<pre>
 +
cd R-3.0.1
 
</pre>
 
</pre>

Revision as of 09:33, 7 June 2013

Starting to administer systems

Introduction

Installing Software

Package Managers

Building from Source Code

Let's build the latest and greatest version of the popular, open-source statistics package--R. We can download the source code from a mirror site right here in Bristol!

cd $HOME
mkdir BUILD
mkdir INSTALL
cd BUILD
mkdir R
cd R
wget http://www.stats.bris.ac.uk/R/src/base/R-3/R-3.0.1.tar.gz

OK, take a look at what we have so far:

ls -l
-rw-r--r-- 1 gethin gethin 25508280 2013-05-16 08:11 R-3.0.1.tar.gz

So far, so good. Let's unpack the tarball:

tar -xzf R-3.0.1.tar.gz
ls -l
drwxr-xr-x 10 gethin gethin     4096 2013-05-16 08:11 R-3.0.1
-rw-r--r--  1 gethin gethin 25508280 2013-05-16 08:11 R-3.0.1.tar.gz

We have a directory called R-3.0.1, let's move into that directory and start the build process.

cd R-3.0.1