System administration
RPM package management
Using RPM
PLD is a RPM based Linux distribution. RPM is a system of
maintaining software resources of your computer. This system
provides a command rpm which you can use to
perform basic operations (install, upgrade, remove) on your set of
packages. Every package is a collection of files which provides
some functionality. For instance program which your humble author
use to write this text is called vim.ispell.
It is located in file /usr/bin/vim.ispell.
I can check that my vim.ispell comes from
package vim-ispell-6.1.063-1 using the command:
dobrek:~> rpm -qf /usr/bin/vim.ispell
vim-ispell-6.1.063-1
This package could by installed by downloading file
vim-ispell-6.1.063-1.i686.rpm from PLD ftp site
or one of the mirrors and invoking command rpm -i
vim-ispell-6.1.063-1.i686.rpm.
RPM can by also used for removing packages using command
rpm -e vim-ispell .
Sometimes already installed packages require upgrade. It can
happen
that new version has a expected new feature or the old one has a
nasty security bug. If you want to upgrade package type
rpm -U <package name>
Upgrading package which conatins your kernel is usually very bad
idea. Upgrade consist of removing the old package and installing the
new one. With kernel it is usually safe to install the new one test
and than id everything works fine remove the old one.
After upgrade some packages you will note that there are some new
files. It usually happens in the case of configuration files located
in /etc. For instance if you upgrade your lpd
daemon you will note that the file /etc/printcap hasn't been
overwritten but the new file is created
/etc/printcap.rpmnew. It is almoust always
worth to look into this type of files to check out what are the
differences between old and new version.
configuring rpm (limit languages, etc)
Managing packages with apt
Apt is powerful package installer/updater originally
written for Debian and its .deb package system, adapted for
RPM based systems by Connectiva people. Apt can be used to install
packages from various sources (filesystem, cdrom, nfs, http).
Here the net method is described (ftp or http).
To use apt first make sure you have
apt rpm package installed. Then
you usually need to edit
/etc/apt/sources.list (there are some
examples in this file, in most cases it is enough to
uncomment one of them). Example entry for i586 system:
rpm ftp://ftp.pld-linux.org/apt PLD-1.0/i586 base supported
You might also check some setup
values in /etc/apt/apt.conf
See
sources.list
5
and
apt.conf
5
for details.
Apt is driven by apt-get command. First
time you run apt, issue apt-get update
(this command will only download list of packages from
server). Then you can install/upgrade particular packages
(and all packages they depend on) with
apt-get install package1 package2 ...
or upgrade whole system with
apt-get upgrade.
See
apt-get
8
.
Apt is very strict about dependencies.
If you had ever issued --force and --nodeps options to rpm program,
then you may get a lot of messages about broken dependencies
when you run apt first time. That means your rpm database is messy.
In that case it is wise to run
apt-get check to see more details and then
fix your database by hand, installing, removing or updating
packages that cause problems. Once done, that cleaning is not
necessary anymore as long as you use apt.
Managing packages with poldek
Poldek is batch-mode rpm package installer/updater written
by Pawel Gajda as a part of PLD installer.
It is software in beta stage.
To use poldek you need poldek rpm package.
Poldek can be used in full batch mode - every option can be passed
in command line - or it can use config file,
either /etc/poldek.conf (system wide config),
or ~/.poldekrc (user config). Poldek can be run by
ordinary user, installation of packages in that case can be done with
sudo (can be set in user config).
Running poldek from root does not require sudo.
Program supports various sources of packages: filesystem, ftp, http, rsync.
Simple config for source requires only one line, like that:
source = ftp://ftp.pld-linux.org/PLD-1.0/i686/PLD/RPMS/
See example configs in poldek doc directory.
You may install/upgrade selected packages with
poldek -i package1 package2 ...
or upgrade whole system with poldek --upgrade-dist.
Run with no arguments poldek enters it's nice interactive mode
(with TAB name completion and command history available). Try it. It's really cool!
If you use poldek with remote source (e.g. ftp), it may be sometimes necessary to
issue command poldek --update
to reload poldek index files from server.
See extensive man page for details:
poldek
8
.
If you use lilo, and do not use rc-boot,
it is advisable to add hold = kernel
to poldek config, otherwise it may happen during massive upgrade
that kernel is also upgraded. If you didn't notice that it had happened,
lilo wouldn't be aware of new kernel installed!
If you use rc-boot, bootloader should be automatically upgraded.
Managing packages with wuch
Wuch is an interactive package manager written by Pawel Kolodziej.
It has also some batch mode. The software is in beta stage.
To run wuch you need wuch package.
Wuch stores its configuration in /etc/wuch.conf.
Example wuch.conf:
root_dir=/
source=Primary PLD ftp server,ftp,ftp.pld-linux.org,/PLD-1.0/i586/PLD/,RPMS,inst
For more details see comments in initial wuch.conf.
Unfortunately, program is not very well documented (you may
find some docs in program sources), nevertheless
it has very simple and intuitive interface.
Simply type wuch and enjoy.
Managing users
PLD provides both standard useradd command (from shadow package),
as well as interactive script adduser (from package adduser).
Rescue procedure
Occasionally, it may happen that system do not boot up correctly.
Depending on the failure, some rescue steps might be necessary:
Using rescue mini-system.
Rescue mini-system usually comes on bootable diskettes or CD.
As regards rescue diskettes, you can find plenty of them on the
net, try to search e.g. on freshmeat.net.
Good rescue CD can be found here:
http://ftp.pld-linux.org/software/Rescue-CD/
Starting in another runlevel
If the bootloader prompt is enabled, it is possible to give
extra parameters to kernel. E.g. on LILO prompt, additionally to
image name you can add runlevel parameter like that:
LILO: pld runlevel=2
Runlevel 1 can be specified with runlevel=1 but also
with single.
Single mode is especially provided for system maintenance and
emergency situation. But it can happen sometimes that even single does
not work correctly. One can try to run system
completely without init, e.g.:
LILO: pld init=/bin/bash
Above line causes that kernel attempts to run
bash as a first user process instead of
init that is invoked in normal case.
System (if was able to run at all) boots in very "raw"
state e.g. to be able to write on disk, one must
remount the device into read-write mode first:
mount / -o rw,remount
Repairing filesystem
When some serious error has been detected on root filesystem,
init scripts invoke "emergency shell" and expect administrator
to fix the problems manually.
Usual reaction is using fsck program on root disk to check/repair disk data.
After problem has been fixed, shell should be closed (with exit)
or Ctrl-D), so the init scripts can continue boot-up procedure.
Bootloaders
General issues
initrd etc, geninitrd etc
Easy way: rc-boot
PLD comes with simple utility called rc-boot.
This package
provides an uniform interface to install and update bootloader.
With rc-boot this task can be done with simple running
rc-boot command;
what bootloader should rc-boot use, and what are bootloader options,
this is specified in uniform way
in rc-boot config files instead of particular bootloader's config files.
Basic rc-boot behavior is controlled by file
/etc/sysconfig/rc-boot/config.
To know what linux kernels or other systems should be available
at boot time, rc-boot needs also image description
files residing in
directory /etc/sysconfig/rc-boot/config/.
Newly installed system should contain at least one these file,
that is, the file describing default system kernel,
but in general it is possible to have more of them.
Image description files can be written by the user, but the main idea of
rc-boot was that they come with particular packages that need to be
handled by bootloader. These packages are primarily kernel packages,
but can be also other packages like memtest86 etc.
It is used for easy kernel upgrades:
as was just mentioned, each kernel rpm package comes with
boot image description
file.
During kernel package installation, rc-boot is automatically invoked to ensure that
newly installed kernel will be seen by bootloader at next boot-up.
rc-boot support works only if rc-boot is installed (thats obvious),
but it must also be enabled. This is done in it's main config file.
For details refer to
rc-boot
8
.