Changes

Jump to: navigation, search

OPS235 Lab 3 - CentOS7 - VMware

74 bytes added, 13:17, 29 May 2016
no edit summary
|width="10%" | [[Image:blank-cd.png|thumb|left|85px|<b>CentOS7</b><br>FULL DVD]]
 
|width="10%" | [[Image:harddrive.png|thumb|left|85px|<b>Removable Hard Disk Pack</b> (SATA)]]
|width="10%" |[[Image:ubs-key.png|thumb|left|85px|<b>USB key</b><br>(for backups)]]
'''Answer Part 2 observations / questions in your lab log book.'''
 
 
===Part 3: Practical Application - Compiling Source Code from Archive File===
{| width="40%" align="right" cellpadding="10"
|- valign="top"
|colspan="2"|{{Admon/note|Installing Development Libraries|In the future, remember the above procedure whenever installing software from source. Sometimes, you need to install additional tools or libraries in order to compile a particular software package}}
 
|}
Now that you know how to create and decompress "zipped tarball archives", we will demonstrate how to install applications from websites containing these types of archives. Although this method is not as "user-friendly" as using the yum or rpm command, this method is useful if the application is NOT contained in regular software repositories...
 
In order to build software from source code, you must have the appropriate software development tools (such as make and gcc) and libraries (such as GTK) installed. The required tools will vary depending on the computer languages used in the software being built.
 
# Part is to be performed in your '''centos3''' VM.
# Issue the following command to install a basic set of development tools and libraries:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">yum groupinstall "Development Tools" "Development Libraries"</span></code></b><br><br>
 
<ol>
<li value="3">Go to the directory '''/tmp'''</li>
<li>Use the <b><code><span style="color:#3366CC;font-size:1.2em;">wget</span></code></b> command to download the "tar ball" that contains the source code for the NLED text editor. <code>wget</code> is a command-line tool to download files from the web using the http or ftp protocols.
<ul>
<li><b><code><span style="pointer-events: none;cursor: default;color:#3366CC;font-size:1.2em;">wget http://cdot.senecac.on.ca/software/nled/nled_2_52_src.tgz</span></code></b></li>
</ul>
</li>
<li>Extract the files. Change to the newly-extracted directory (<b><code><span style="color:#3366CC;font-size:1.2em;">/tmp/nled-2.52</span></code></b>)</li>
<li>Check to see if there is a file named <b><code><span style="color:#3366CC;font-size:1.2em;">configure</span></code></b>. If so, run it; if not, skip this step. (Most but not all source code archives contain this file)</li>
<li>Check to see if there is a file named <b><code><span style="color:#3366CC;font-size:1.2em;">Makefile</span></code></b> or <b><code><span style="color:#3366CC;font-size:1.2em;">makefile</span></code></b>. If so, type the command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">make</span></code></b></li>
<li>Did the command work? Why? Use the <b><code><span style="color:#3366CC;font-size:1.2em;">yum</span></code></b> command to install the package '''gcc'''. What do you think the package ''gcc'' does?</li>
</ul>
<li>Reissue the <b><code><span style="color:#3366CC;font-size:1.2em;">make</span></code></b> command. Where you successful? What does <code>make</code> do?</li>
<li>Issue the command as root: <b><code><span style="color:#3366CC;font-size:1.2em;">yum list ncurses</span></code></b>. What do you see? Issue the command at root: <b><code><span style="color:#3366CC;font-size:1.2em;">yum search ncurses</span></code></b>. What do you observe?</li>
<li>In this case, you need to install the ncurses development libraries as well. Issue the following command as root: <b><code><span style="color:#3366CC;font-size:1.2em;">yum install ncurses-devel.x86_64</span></code></b>. Now issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">make</span></code></b></li>
<li>Some software distributed as source code can automatically install itself. Try this command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">make install</span></code></b></li>
</ul>
</li>
<li>Most but not all source code archives include the capability of installing themselves this way.</li>
<li>If the command <code>make install</code> does not work (how can you tell? What command did you learn from ULI101 to confirm that this command cannot be run from the command line?), copy the <b><code><span style="color:#3366CC;font-size:1.2em;">nled</span></code></b> program manually:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">cp nled /usr/local/bin</span></code></b></li>
</ul>
</li>
<li>Run <b><code><span style="color:#3366CC;font-size:1.2em;">nled</span></code></b> from the current directory to make sure that it works. To exit this application, press '''ESC''', then type the letter '''q''' at the command prompt as the bottom left-hand corner and then press '''ENTER'''.</li>
<li>Why did copying the nled executable to '''/usr/local/bin''' allow the nled command to be run by name anywhere in the command prompt?</li>
</ol>
 
'''Answer Part 3 observations / questions in your lab log book.'''
=INVESTIGATION 2: INSTALLING APPLICATIONS WITH YUM &amp; USING SHELL SCRIPTS=
</ol>
===Part 2: Practical Application - Compiling Source Code from Archive File===
{| width="40%" align="right" cellpadding="10"
|- valign="top"
|colspan="2"|{{Admon/note|Installing Development Libraries|In the future, remember the above procedure whenever installing software from source. Sometimes, you need to install additional tools or libraries in order to compile a particular software package}}
 
|}
Sometimes, some software may <u>not</u> be available on repositories to install with the '''yum''' command. They may be available from web-pages to download, and compile. Now that you know how to create and decompress "zipped tarball archives", we will demonstrate how to install applications from websites containing these types of archives. Although this method is not as "user-friendly" as using the yum or rpm command, this method is useful if the application is NOT contained in regular software repositories...
 
In order to build software from source code, you must have the appropriate software development tools (such as make and gcc) and libraries (such as GTK) installed. The required tools will vary depending on the computer languages used in the software being built.
 
# Part is to be performed in your '''centos3''' VM.
# Issue the following command to install a basic set of development tools and libraries:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">yum groupinstall "Development Tools" "Development Libraries"</span></code></b><br><br>
 
<ol>
<li value="3">Go to the directory '''/tmp'''</li>
<li>Use the <b><code><span style="color:#3366CC;font-size:1.2em;">wget</span></code></b> command to download the "tar ball" that contains the source code for the NLED text editor. <code>wget</code> is a command-line tool to download files from the web using the http or ftp protocols.
<ul>
<li><b><code><span style="pointer-events: none;cursor: default;color:#3366CC;font-size:1.2em;">wget http://cdot.senecac.on.ca/software/nled/nled_2_52_src.tgz</span></code></b></li>
</ul>
</li>
<li>Extract the files. Change to the newly-extracted directory (<b><code><span style="color:#3366CC;font-size:1.2em;">/tmp/nled-2.52</span></code></b>)</li>
<li>Check to see if there is a file named <b><code><span style="color:#3366CC;font-size:1.2em;">configure</span></code></b>. If so, run it; if not, skip this step. (Most but not all source code archives contain this file)</li>
<li>Check to see if there is a file named <b><code><span style="color:#3366CC;font-size:1.2em;">Makefile</span></code></b> or <b><code><span style="color:#3366CC;font-size:1.2em;">makefile</span></code></b>. If so, type the command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">make</span></code></b></li>
<li>Did the command work? Why? Use the <b><code><span style="color:#3366CC;font-size:1.2em;">yum</span></code></b> command to install the package '''gcc'''. What do you think the package ''gcc'' does?</li>
</ul>
<li>Reissue the <b><code><span style="color:#3366CC;font-size:1.2em;">make</span></code></b> command. Where you successful? What does <code>make</code> do?</li>
<li>Issue the command as root: <b><code><span style="color:#3366CC;font-size:1.2em;">yum list ncurses</span></code></b>. What do you see? Issue the command at root: <b><code><span style="color:#3366CC;font-size:1.2em;">yum search ncurses</span></code></b>. What do you observe?</li>
<li>In this case, you need to install the ncurses development libraries as well. Issue the following command as root: <b><code><span style="color:#3366CC;font-size:1.2em;">yum install ncurses-devel.x86_64</span></code></b>. Now issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">make</span></code></b></li>
<li>Some software distributed as source code can automatically install itself. Try this command:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">make install</span></code></b></li>
</ul>
</li>
<li>Most but not all source code archives include the capability of installing themselves this way.</li>
<li>If the command <code>make install</code> does not work (how can you tell? What command did you learn from ULI101 to confirm that this command cannot be run from the command line?), copy the <b><code><span style="color:#3366CC;font-size:1.2em;">nled</span></code></b> program manually:
<ul>
<li><b><code><span style="color:#3366CC;font-size:1.2em;">cp nled /usr/local/bin</span></code></b></li>
</ul>
</li>
<li>Run <b><code><span style="color:#3366CC;font-size:1.2em;">nled</span></code></b> from the current directory to make sure that it works. To exit this application, press '''ESC''', then type the letter '''q''' at the command prompt as the bottom left-hand corner and then press '''ENTER'''.</li>
<li>Why did copying the nled executable to '''/usr/local/bin''' allow the nled command to be run by name anywhere in the command prompt?</li>
</ol>
 
'''Answer Part 2 observations / questions in your lab log book.'''
==Part 23: Automating Routine Tasks (Shell Scripting)==
{|width="40%" align="right" cellpadding="10"
|- valign="top"
13,420
edits

Navigation menu