SRA840 Lab2

From CDOT Wiki
Revision as of 17:35, 2 February 2009 by Milton.paiva (talk | contribs) (Milton Paiva)
Jump to: navigation, search

SRA840 Lab2

REFERENCES

FreeBSD ports

Answers

Stephen Carter

When I logged in to FreeBSD for the first time, I was confronted with the following:

$|

...and nothing else. This is, of course, a bare shell; it's not even bash! That's right, the default shell is /bin/sh! So, for this lab, I decided to install the bash shell, asap! Now, I know technically the lab is about getting to use ports, and we're supposed to use pkg_add and all that stuff, but that was giving me trouble because I hadn't set up an internet connection yet. So I said to myself "screw ports!" and got creative. (Be afraid...) I thought "maybe I messed up something in the install, and ports wasn't installed or something." So, I started the sysinstall program (which is the FreeBSD installer), to see if I could fix it. It turns out, you can install programs this way! So to install bash, from the installer screen, you go through the menus to "Configure -> Packages -> CD/DVD -> shells" and then select bash, then ok, and then select install. Then the installer will go off and use prts to install your program, and Voila! Bash!

...of course I has to tell FreeBSD I actually wanted to *use* this new shell, so to do that I did a "whereis bash" to find out where bash was located, and the "chsh -s /usr/local/bin/bash evets" to change the shell for the user evets (me). After a quick logout and log back in, I had my pretty bash shell back! Success! And so, I immediately ran " PS1='C:${PWD//\//\\\}>' ". If you don't know what that does, and you're near a bash command prompt, try it out for yourself and see. ;) --scarter4 21:36, 22 January 2009 (UTC)

Kezhong Liang

I have the same problem when I did the lab, because I hadn't set up the internet. So I reinstalled the FreeBSD, and set DHCP enable. Now I can ping the host. And I can do the lab according to Handbook.

Nestor Chan

Instead of talking about the experience. I actually wanna mention the different between using Packages and Ports. The main different between using Packages and Ports are binary and source. Packages are binary files, it almost dose every thing automatically. When Ports is install from source, which gives you more control on what and where to install. For FreeBSD, most applications, services are open source, which you can obtain the source easily on the internet. But some packages, like from Sun Micro System, are closed source or "partially" closed source, then you may not able to find a source package. Instead you need to install the binary. Personally, I would suggest system administrator use sourse code to install. Because it's more customised for your server. And we usually use FreeBSD as a server instead of a desktop operating system, because of its stability. (and of course, it's not a great desktop OS tho) And installing from the source gives you the best performance on your server.


Mohak Vyas

I tried to install gnome for this lab. I installed gnome with the packaging method. I used sysinstall, the default installer. The steps are very simple. run sysinstall, select configure, goto packages, select the location i.e CD/DVD or FTP etc. and select the package you want install. You can start gnome each time you start your system by adding this line ' gnome_enable="yes" ' to your /etc/rc.conf file.

Milton Paiva

Packages: constains pre-compiled code

Commands to install, remove or get information of a give package

pkg_add
pkg_delete
pkg_info

Ports: collections of files designed to automate the process of compiling an applications from the source code. It will do everything to install a new program as download, unpack, patch, compile and install.

./configure
make
make install

I install lsof command. I entered in the directory /usr/ports/sysutils/lsof, then I typed make, and finally make install. The port was installed at /usr/local/sbin/lsof

  • The ports can be used to generate packages.
  • They both understand dependencies

Packages X Ports

Package Benefits

*Smaller files
*Do no require compilation

Ports Benefits

*Customizations for the architecture could improve performance
*Multiple packages could coexist
*Source code is included
*Possibility of modify the software