Tải bản đầy đủ (.pdf) (20 trang)

Installing Fedora and Adding Software

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (264.03 KB, 20 trang )

Installing Fedora
and Adding Software
Critical tools for initially installing Fedora, and for
adding and managing software later, include the
anaconda installer (initial install),
rpm
command
(install/manage local packages), and the
yum
command (install/manage packages from online
repositories). The yum-utils package also includes
useful commands for creating and managing soft-
ware packages associated with yum repositories.
This chapter highlights critical issues you need
to know during the initial Fedora installation. It
covers information about online yum software
repositories, such as which are best to use for
different circumstances. Detailed examples of
rpm
,
yum
, and related commands are given later
in the chapter.
Installing Fedora
For initial installation of Fedora, most people get an official Fedora DVD
or set of CDs. Media available for the different Fedora releases include:
❑ For Fedora 6, there is a single DVD or a set of five CDs that represent
the entire distribution named Fedora Core 6. You can add more pack-
ages from the Fedora Extras repository (which was only available from
online repositories).
❑ For Fedora 7, Fedora Core and Fedora Extras were merged into a single,


online repository. Different installation package sets are available for
Fedora 7, such as a GNOME live/install CD, KDE live/install CD, and
an installation DVD. Choose the set of media that best suits your need.
Then use online repositories to download and install other packages
you need.
Fedora media are available with books on Fedora, such as Fedora 7 and
Red Hat Enterprise Linux Bible (Wiley, 2007) or by downloading media
IN THIS CHAPTER
Installing Fedora
Working with software
repositories
Getting software
packages with yum
Managing software
packages with rpm
Extracting files
from RPMs
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 13
from the Fedora Project (
/>Download
). Get media for CentOS from

(select Downloads).
Get Red Hat Enterprise Linux media from the Red Hat downloads page (
www.redhat
.com/apps/download
). Subscription fees may apply for RHEL products.
Preparing to Install
To simply erase everything on your computer’s hard disk to install Fedora, you
don’t have to prepare your hard disks in advance. If you want to keep any data

from your hard disk, back up that data before proceeding. To keep existing data
on your hard disk and add Fedora, you may need to resize existing disk partitions
and repartition your disk. See Chapter 7 for information on disk resizing and parti-
tioning commands.
Choosing Installation Options
All Red Hat–based Linux distributions (Fedora, RHEL, and CentOS) use the anaconda
installer to initially install the system. New features in the current Fedora version of
anaconda will most likely make their way into upcoming versions of the RHEL and
CentOS installers as well.
NOTE If you have a Fedora live CD, you can bypass the anaconda installer to
install Fedora to your hard disk. After booting the live CD, you can select an install
icon from the desktop and copy the contents of the live CD to your hard disk. You
don’t have the flexibility that comes with the anaconda installer, but you get a good
basic set of desktop packages installed to start with.
Starting the Install Process
Most people start the install process from the DVD or first CD in the install set. As
an alternative, use boot images contained in the images directory on the CD or DVD
(refer to the README file in that directory). In Fedora, do one of the following to
start anaconda:
❑ CD or DVD — Insert the installation DVD or CD and reboot the computer.
❑ Minimal CD boot image — Locate the
boot.iso
image from the
images
direc-
tory of CDs, DVDs, or online mirrors. Burn
boot.iso
to a CD and start the install
from the CD, but continue from some other medium. This is useful when you’re
doing a quick installation and don’t have the full media with you.

❑ USB flash drive: Locate the
diskboot.img
image from the
images
directory of
CDs, DVDs, or online mirrors. Copy
diskboot.img
to a USB flash drive (also
called a thumb drive or pen drive) and start the install from that drive (provided
your computer’s BIOS can boot from USB devices). From Linux, type the following
(with your USB flash drive inserted and represented by
/dev/sda
) to copy
diskboot.img
to your flash drive:
# dd if=/media/cdrom/diskboot.img of=/dev/sda
14
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 14
❑ Hard disk boot — If your CD drive won’t boot, you can start the install from hard
disk. This procedure assumes you already have a version of Fedora installed on
your hard disk and can modify the GRUB boot loader to start the new install. With
the installed Fedora system running, copy the
initrd.img
and
vmlinuz
files from
the
isolinux
directory on the CD/DVD to the

/boot
directory on your hard disk.
Update the
/boot/grub/grub.conf
file to include an entry for the
initrd.img
and
vmlinuz
files you just installed. Reboot and select that new entry from the
GRUB boot screen to start the install.
❑ PXE boot — With no CD or DVD drive, you can start an install using a PXE boot.
To do this, your computer needs a PXE-enabled Ethernet card and the ability to set
PXE in the BIOS’s boot order. You also need to set up an install server to support
the PXE boot. The kernel and initial RAM disk needed to start the PXE boot are
in the
images/pxeboot
directory. Tips for setting up a PXE boot server are in the
/usr/share/doc/syslinux-*
directory (when the syslinux package is installed
in Fedora).
NOTE There is no floppy disk image for starting a Fedora install. Since the 2.6
kernel, there is no install image small enough to fit on a floppy disk.
Choosing Where Fedora Software Is
from the Boot Screen
Each of the methods just described should result in a Fedora installer boot screen appear-
ing. With a CD or DVD install, press Enter to continue with a graphical install from that
media. Type the following at the boot prompt to choose a different install type:
boot: linux askmethod
NOTE Beginning with Fedora 7, Fedora install media use a graphical boot screen.
To get to the boot prompt from that screen, press the Tab key. Then add any boot

options (
askmethod
,
text
,
vnc
, and so on) after the
vmlinuz
line shown.
When prompted, select your install method from the following:
❑ Local CDROM — Continue installing from the local CD or DVD.
❑ Hard drive — To use this method, you must copy the DVD or CD images to a local
hard disk. When asked, identify the partition and directory holding the images.
❑ NFS image — To use this method, you must copy the DVD or CD images to a
directory on a computer on your LAN and share that directory using NFS. When
asked, identify the NFS resource holding the images.
❑ FTP — You can use this method to install from an existing Internet FTP mirror, or
from your own in-house install point. When asked, identify the FTP site’s URL
and directory. To create your own FTP install point, you can, for example, copy
the contents of the DVD or all CD images to a directory on your FTP server with
a command such as
cp –ar
.
❑ HTTP — Same as FTP, but using an HTTP web server (an existing Internet mirror
or your own).
15
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 15
Choosing How Install Proceeds from the Boot Screen
To have the install proceed in different ways, you can add boot options. Here are

examples of different install types you can request from the boot prompt:
boot: linux text
boot: linux vnc
boot: linux vnc vncconnect=192.168.0.20 vncpassword=99pass07
boot: linux ks=floppy
boot: linux ks=hd:/dev/hda1/ks.cfg
boot: linux ks= />Use
linux text
to run the install in text mode (if your graphical screens are garbled).
If you use
linux vnc
, you can step through the graphical section of the install remotely
by connecting a VNC client to the IP of the install machine. The installer will show
the IP address and display to connect to after it starts the VNC server. You can also
start a VNC client on your network in listening mode and point the installer to that
client using
vncconnect
. In the second
vnc
example above,
vncviewer -listen
is running on the machine at
192.168.0.20
with a password of
99pass07
.
The three
ks
examples tell the installer where to find a kickstart file to guide the install
process. The first looks for a

ks.cfg
file on the local floppy disk, the second looks for
ks.cfg
on the first IDE hard disk partition, and the last looks for
ks.cfg
in the root
of the web server at
example.com
. A kickstart file contains information that lets the
install process bypass some or all questions asked during installation. A sample kick-
start file can be found in
/root/anaconda-ks.cfg
after a Fedora install is completed.
Using that file, you can repeat the install done on that machine on another computer.
For information on kickstart, refer to the following site:
/>NOTE To learn more about kickstart, install the anaconda package, then refer to the
kickstart-docs.txt
file in the
/usr/share/doc/anaconda-*
directory.
You also have the choice of going into modes other than installation mode. For example:
boot: linux rescue
boot: linux local
boot: linux memtest86
The Fedora installer CD/DVD can be used for things other than installing Fedora. The
rescue
option starts a mini–Linux system in rescue mode, so you can mount file sys-
tems and fix problems from the command line. The
local
option bypasses the CD/

DVD and tries to boot from hard disk. The
memtest86
option checks your computer’s
memory.
Choosing More Boot Options
Most boot options, besides those mentioned, are meant to help work around problems
that might occur during installation. In particular, you might need to disable certain
16
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 16
hardware components or features that aren’t properly configured and enabled during
installation. Type linux, followed by one or more of the boot options shown in Table 2-1,
to deal with common problems.
Table 2-1: Boot Options When Installing Fedora
Other information on kernel boot options is available from the
bootparam
man page
and the Boot Prompt HOWTO (
www.tldp.org/HOWTO/BootPrompt-HOWTO.html
).
Answering Installation Questions
Most of the screens you see during installation are quite intuitive. Table 2-2 offers a
quick review of those screens, along with tips where you might need some help.
If errors occur during the installation, press Ctrl+Alt+F1, F2, F3, F4, or F5 to see vir-
tual terminals containing useful information. Ctrl+Alt+F1 displays the installation
dialog box. Ctrl+Alt+F2 displays a shell prompt, so you can access your system during
Problem Description Boot Options to Try
Failure to read
CD/DVD drive.
Some CD/DVD drives

don’t properly support
DMA or some power
management features.
ide=nodma nodma acpi=off
all-generic-ide irqpoll
Hardware improperly
probed.
Tell the boot process to
not probe hardware.
noprobe
System hangs trying to
enable some hardware.
Disable hardware or
service that is causing
the system to hang.
nousb nopcmcia nofirewire
noapic nolapic
You want to disable
SELinux.
Some people prefer
not to enable SELinux
because of its complexity.
selinux=0
Your computer has a
serial console, but no
regular monitor.
You can run the install
in text mode from the
serial terminal.
console=/dev/ttyS0

Video is garbled or
hangs.
Try to set resolution
yourself or skip monitor
probing.
resolution=800x600
skipddc
vga=ask
RAM is improperly
detected.
Tell the kernel how
much RAM to use.
mem=256M
Driver needed is not
available with kernel.
Add driver you need
from a driver disk.
dd
17
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 17
installation from the shell. Ctrl+Alt+F3 displays messages sent to the install log from
the installation program. Ctrl+Alt+F4 shows system-related messages. Ctrl+Alt+F5
displays other messages. Press Ctrl+Alt+F7 to return to the X graphical installation
screen.
Table 2-2: Fedora Installation Screens
Screen Description Tips
Test Media Check each CD/DVD image
against an md5sum implanted
on that image.

On occasion, a media check will
fail with good media on a drive
that doesn’t support DMA. If the
check fails, start the installer with
ide=nodma
and check again. If
the media passes, you can continue.
Language Choose the install language. If you need support for other
languages, add them later.
Keyboard Choose the keyboard by
language/country.
Install or Upgrade Choose a fresh install or
upgrade (if a Fedora version
is already installed).
If multiple Fedoras are installed,
choose which one to upgrade.
Disk Partitions Either let the installer partition
your disk or choose to parti-
tion it yourself.
You need at least one swap parti-
tion and one partition to hold
the installation. See Chapter 7 for
information on partitioning your
hard disk.
Boot loader Choose whether or not to
install a boot loader on your
hard disk.
GRUB is the only bootloader sup-
ported by Fedora. GRUB is config-
ured by default in the master boot

record of your first hard drive. If
multiple operating systems are
installed on your hard drives,
you can add them to the list of
bootable operating systems on
your boot loader.
Network Wired Ethernet cards are
detected and configured
(by default) to use dynamic
addresses retrieved from a
DHCP server.
You can set hostname and IP
addresses manually, if you prefer.
Wireless cards and modems can
only be configured after Fedora is
installed. (See the description of
iwconfig
in Chapter 11.)
18
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 18
Table 2-2: Fedora Installation Screens (continued)
Working with Software Packages
Software delivered particularly for Fedora systems is packaged in what are called RPM
packages. An RPM package (
.rpm
extension) contains not only the software you want
to install, as a compressed archive, but it can also hold lots of information about the
contents of the package. That information can include software descriptions, depend-
encies, computer architecture, vendor, size, licensing, and other information.

When a basic Fedora system is installed, you can add, remove, and otherwise manage
Fedora packages to suit how you use that system. Fedora, RHEL, CentOS, and other
Linux systems use RPM Package Management (RPM) tools to create and manage soft-
ware for those systems. You use two primary commands to manage RPMs in Fedora:
❑ yum — Use
yum
to download and install packages from online repositories. The
yum
command
is preferred over
rpm
for installing packages in most cases because
yum
will get
dependent packages needed by those packages you request to install, and by getting
packages from official repositories, you are most likely to get the latest available packages.
❑ rpm — Use
rpm
to install RPM packages available from your local system (hard disk or CD/
DVD) and otherwise manage installed packages (remove, query, and so on). Related
commands and options are available for verifying software packages and repairing
your local RPM database, if problems should occur.
Screen Description Tips
Timezone Select your time zone from a
map or pull-down menu.
Root password Set the password for the
root user.
Make it difficult to guess. Don’t
share it.
Software packages Package groups available from

the installation medium are
displayed for you to choose.
Select Add additional software repos-
itories to choose online repositories
that make more packages avail-
able to install. Click the Using
Software Repositories box to see
details on finding and adding
repos. Click Customize now for
details of which packages from
selected groups are to be installed.
Reboot When all packages are
installed, you are asked
to reboot.
19
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 19
Up until Fedora 6, Fedora was represented by an installation set (a single DVD or up
to five CDs) that contained more than 2200 RPM packages. The packages in that set
were referred to as Fedora Core. Red Hat, Inc. employees were primarily responsible for
maintaining Fedora Core. Additional packages submitted by the Fedora community
were tested and approved by the Fedora Extras committee, then added to a separate
online repository.
Both Fedora Core and Extras RPM packages were held to the same standards: pack-
ages must be open source, not encumbered by patents, legal under U.S. laws such
as the Digital Millennium Copyright Act (DMCA), and licensed for redistribution.
That made it easier in Fedora 7 to merge Fedora Core and Extras into a single reposi-
tory. So, instead of getting an installation set that included a cross-section of desktop,
workstation, and server packages, separate spins were created for Fedora 7 desktop,
server, and other package groupings. Packages outside of your spin can then be down-

loaded and installed from the massive, online Fedora repository.
Other software packages that work with Linux, but may not meet Red Hat require-
ments, are available from third-party yum software repositories. Some of those repos-
itories build their dependencies on the main Fedora repository. The following section
describes some of those repositories and how to access them.
Using yum Software Repositories
In the old days of Red Hat Linux, when people needed packages that had been left
out by Red Hat, they had to hunt the packages down on the Web. If they got lucky,
they located an RPM built for the exact version of Red Hat Linux they were using. If
not, they had to fight against RPM dependency hell or do a dirty install from source.
The
rpm
command, while very powerful for installing single packages (either locally
or from the Internet), did not go out and find dependent packages you needed to
install your selected package. It also didn’t grab the latest version of a package just
by asking for it.
Debian GNU/Linux and other Linux distributions based on Debian enjoy the bliss
of
apt
— a one-line command that allowed a user to install virtually any package
out there. Dependencies are calculated and installed automagically. At first,
apt4rpm
emerged as a tool for letting Red Hat-based distributions get RPM packages from
apt
-enabled repositories. Soon, however,
yum
emerged as the tool for getting Fedora
software.
Just as
apt

was borrowed from Debian,
yum
came from Yellow Dog Linux (a distribu-
tion based on Red Hat Linux that ran on Mac hardware). The yum utility (Yellow dog
Updater, Modified) offered near-identical features to
apt
and has now become an inte-
gral part of Fedora;
apt4rpm
is no longer maintained and should no longer be used.
While Fedora was adopting
yum
, RHEL went with its own RPM management tool:
up2date
. With RHEL 5, however, yum provides the underlying structure for software
installation.
20
Chapter 2: Installing Fedora and Adding Software
82911c02.qxd:LinuxToolbox 10/18/07 3:53 PM Page 20

×