0% found this document useful (0 votes)
26 views42 pages

COMP 201 OpenSource L2 SampleInstallation2

Uploaded by

michellesparks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views42 pages

COMP 201 OpenSource L2 SampleInstallation2

Uploaded by

michellesparks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

COMP 201 OPEN SOURCE &

SYSTEM ADMINISTRATION
DANIEL OBUOBI, DCSIT, CU
Free BSD Installation
FreeBSD Installation

AFNOG CHIX, Accra Ghana


OCTOBER 2008
Boot Off CD
• Insert the FreeBSD 7.0 CD1 on your machines into your CD-
ROM drive and (re)boot the machine
KeyMap
• You then need to say what country you are in.
Choose Ghana from the list (scroll up with the
up arrow) so it will allow you to choose what
your keymap looks like.
• The Keyboard map tells the Operating system
what characters are printed on your keyboard.
Scroll up and choose english.iso ( the
screenshot is in the next slide).
Sysinstall
• Finally you’ll get to the sysinstall menu. Sysinstall is the
installer tool used to get FreeBSD onto your machine –
and optionally configure it later.
• Move through it by using your up and down arrow keys,
use the space or enter key to choose the highlighted
option.
• If there are “buttons” at the bottom of the screen, you
can navigate to it by using the tab key then using the
enter key.
• Select a standard installation and the next thing we need
to do is partition our disk.
Disk Partitioning/installation
• In your case, you are presented with a choice of disks
to partition. We will use just the first 80GB disk.
• Select it with the space button so we can start slicing
the disk.
• In our case we are going to use the entire disk so use
“a” to tell FreeBSD to use as much of the disk as it can.
• If you plan to use multiple operating disks you need to
create different slices for the other operating systems.
• When done with the slicing, then use “q” to quit the
fdisk partition editor
Slicing
Boot Blocks
• Next you decide what FreeBSD will put in your MBR. If you have multiple
operating systems you want a boot manager. In our case, standard MBR
will do. (none is for if you have GRUB or something else)
Partitions
• Fdisk is launched again to create partitions inside the slice you
created. Use “a” to automatically create partitions, watch the
screen for a demo on how you’d do it yourself.
Multiple Disks
• On computers with more than one disk you are returned to the
menu where you choose which disk you want to slice and
partition.
• If you plan to you use both disks you can put some partitions on
the second disk (like /usr or /var or /data) by going selecting the
second disk and slicinging it and using fdisk to put partitions in
there as was demoed on the screen.
• In our case we use tab to go to ok and continue with the
installation. We’ll leave the second disk blank in case we get the
chance to do actual mirrors later in the week.
Choice of packages
• Next we get to chose which packages we want installed. You can
either choose predefined package groups or make your own
selection. For our case we’ll choose a small distribution and add
packages we need during the week.
• In this window use the arrow keys to move to a distribution, use
the space bar to select the distribution.
• Our distribution is going to be X-User so scroll down and select it
with the space bar.
FreeBSD Distribution
Ports
• You will be asked if you want to install the ports system. Hit
the “Enter” key to say “yes” we will discuss how to use the
ports system in the next session.
• Once that is done you need to exit the distribution selection.
Use the tab key to select “OK” and move on to the media
selection.
• FreeBSD can install these packages from all kinds of media –
CDROM, FTP, HTTP, NFS mounts, even a huge stack of floppies.
• In our case we’ll use the CDROM for now, FTP will be used in
the next session.
Media Selection
Point of no return
• You are now presented with an important prompt. Prior to this,
no actual data has been written to disk. If you chose no, you can
have your system unmodified. If you chose yes, then every thing
from the partitioning starts to happen. Chose yes and watch.
Post Installation Tasks
• At this point, the FreeBSD operating system has been installed on
your computer. We shall now do some post installation tasks to get
some attributes of your system working.
• Say “Yes” to configuring your ethernet device. You are presented
with a menu, select the first one which should be em0 – your
ethernet card.
• You will be asked if you want to try IPv6 configuration for your card,
say “yes”
• You will be asked if you want to try DHCP configuration for your
card, say “no”
• Next is the IPv4 configuration which you should set similar to this.
Substitute the IPv4 address and hostname fields as relevant.
• Leave the gateway, domain, and name server fields constant.
IPv4 configuration
IPV4 Configuration
• ipv4 gateway= 41.204.44.254
• ipv4 address= 41.204.44.x here
x=101,102,etc
• Netmask =255.255.255.0
• Name server =63.216.0.5
Startup Options
• You are then presented with options to start different services
on boot.
• Say “NO” to all of them except ssh.
• You will also be asked if your clock is set to UTC – say “yes”.
• You then need to set the timezone on your machine, say yes
to that, select “Africa” then select “Ghana” and you should
end up with a prompt like the one which follows. – say “yes”
to the prompt.
Timezone
Additional Steps
• Say “Yes” to enable linux binary compatibility (this allows your
FreeBSD to run linux applications natively)
• Say “yes” to whether you have a mouse connected.
• The default settings (autoprobe) work fine, just go down to
enable and select that.
• When done go to exit to leave this menu.
• Answer “NO” to browsing the package selection
• Do not add a user account at this point, one of the exercises that
follows does this.
• Set your root password to afnogchix08 . Please leave this
password as is so instructors can fix your machines if the need
arises..
First Boot
• Next you’ll be asked if you want to visit the configuration menu
for the last time, say no.
• Press the x key to exit systinstall press enter, and remove your
disk from the drive as the machine reboots.
• Log in with the username root ; password afnogchix08 (use the
numeric keypad) and type the following commands. Include all
the quotation marks and don’t forget the double “>>” not a
single “>” replace 100 with the last part of your real IP address.
The ‘#’ just means you type the commands as root.

# echo ‘ipv6_ifconfig_em0=“2001:4438:0:218:196:200:218:100”’ >>


/etc/rc.conf
# /etc/netstart
FreeBSD ports & packages
FreeBSD ports & packages - overview
• Different UNIX distributions use different package systems for distributing software
– Debian GNU/Linux and Ubuntu use .DEB
– SuSE, RedHat, Fedora use .RPM
– etc..
• FreeBSD uses a simple format (.TGZ)
• Where do they come from ?
Installing software on FreeBSD

• Normally 3 ways to install software on FreeBSD:


– from the « source »
# ./configure; make; make install
– from the port
– from the package
The FreeBSD ports collection

• Described in detail at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/
handbook/ports.html
• The ports is a collection of « skeleton » instructions (Makefile,
patches) to retrieve, configure, build and install software
• The ports collection contains instructions for over 16.000 software
programs as of 2007, and it is still growing.
Installing software ...

Open source software is shipped in source form; to be usable on a


system

1. It must be unpacked
2. It must be adapted to the system one is running on (« porting »)
3. It may be compiled (source -> binary)
4. It must installed
5. It may need to be configured
Installing software ...
The ports system takes care of steps 1 – 4, and sometimes 5
(preconfiguration)

The build and installation process might trigger the build and
Installation of other required software
– this is known as « dependencies ».

For example, a graphics program might need


a JPEG software library to be able to read and write JPEG images
From port to package
• Once the port is built, one can make a package
• A package is a pre-built port
• Packages can be installed...
– from the network via FTP
– from the FreeBSD CDROM
• Packages can be those built by the FreeBSD project or
your own
Ports vs packages

PACKAGES PORTS

precompiled more and better configuration
easy to install control / options
no need to have ports collection installed
(for example Apache and PHP)
local patches possible
tuning options
Installing packages

• pkg_add [-r] <package name>


• For instance:
# pkg_add -r bash
• This will attempt to install the bash package from the network
• Problems:
– what if bash depends on other software ?
– which version of bash ? 2 or 3 ?
• pkg_add will try to install dependencies, if they are available
Installing packages

• If you have the package on CD, and the CD is mounted, you can
install it directly, for instance:
# pkg_add /cdrom/packages/All/bash-3.1.10_1.tbz
• If you know the URL (Link) to the package on the Internet, you
could:
# pkg_add
ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/6.1-RELEASE/pac
kages/All/bash-3.1.10_1.tbz
Ports

• To install a port, you can search by name or


keyword:
# cd /usr/ports; make search name=<name>
# cd /usr/ports; make search key=<keywrd>
• Once you know where the port resides (its
category), you can go to that directory, and install it:
# cd /usr/ports/shells/bash3
# make
# make install
# make clean
• That's it!
Ports

• If you want to build a package, you just need


to type:
# make package

• ... from the directory where you built the port


from.
Best of both worlds

• But what if...


– you don't know in which category the port is located
or which version you want;
– you can't find up-to-date packages for the version of
FreeBSD you are running (maybe it's a bit older) ;
– you want to upgrade a package, but other packages
depend on it ;

• For all the above reasons, it is strongly


recommended to use a tool called portupgrade
Portupgrade

• Portupgrade is a « meta » package manager.


It sits on a layer above the ports and package
system, and makes your life easier

• Portupgrade greatly simplifies package


installation, upgrades.
The big picture
Installing portupgrade

Portupgrade is itself a port, and can be installed as such, or as a package:

# cd /usr/ports/sysutils/portupgrade
# make
# make install
# make clean
or
# pkg_add -r portupgrade

It can also be installed at system install time (via sysinstall)


Using portupgrade

• To install a program with portupgrade

# portinstall <port name>

• For instance:

# portinstall bash
Using portupgrade

• Portupgrade can be told to try and install a pre-built package, using


the -P option, one or more times:

– Try and install from a package, fallback to the port if the


package isn't found:
# portinstall -P <port name>

– Try and install from a package, stop if it's not found:


# portinstall -P -P <port name>
Using portupgrade

• To upgrade an already installed software package:

# portupgrade <package name>

• For instance:

# portupgrade apache

You might also like