Chapter 11 Software Installation N Backup
Chapter 11 Software Installation N Backup
Chapter 11 Software Installation N Backup
Chapter 11
Software installation and backup
Chapter 11 Outline
Installing packages
Installing
packages
Primarily used to install binary packages which are pre-built for a specific
linux distribution and version
RPM packages
Installation scripts
Package description
Dependency information
gcc-3.2-45.i586.rpm
Name of
package
Release/
build number
Version
number
Architecture
package is
built for
Querying packages
Do now!
$ rpm -qa
With the -p flag, rpm can query uninstalled packages (rpm files)
$ rpm -qip gcc-3.2-45.i586.rpm
Installing packages
-i flag means install, -v, -h flags just give more verbose output
Example:
# rpm -qa | grep yacc
Package is not currently installed
# cd /media/cdrom/suse/i586/
# rpm -ivh yacc-91.7.30-764.i586.rpm
Preparing...
################################# [100%]
1:yacc
################################# [100%]
# rpm -qa | grep yacc
yacc-91.7.30-764
Package is now installed
Dependencies
Programs are dependent on the libraries against which they are linked
(linux uses dynamic linking to shared libraries)
Example
# rpm -i totem-0.99.2-77.i586.rpm
error: Failed dependencies:
libgnome-desktop-2.so.2 is needed by totem-0.99.2-77
In this exercise we will use RPM to install the GNU C compiler from
the United Linux CDs. You must be logged in as root for this. Then we
will write and compile a tiny program, to verify that it works.
Click here to
install the
selected packages
There is a lot of free software available for linux which is not provided
on the SuSE distribution
It needs to be compiled for the right architecture (i586, sparc, alpha, etc);
If you have gcc and related development tools installed, it's easy to
download and build from source code
Advantages
You can get the latest version (the SuSE RPMs are likely not the latest)
Disadvantages
$ cd ~/build
$ tar zxvf /tmp/net-snmp-5.1.tar.gz
$ cd netsnmp-5.1
$ ./configure
$ make
$ su -c 'make install'
Archiving and
backup tools
Options include:
Option
Meaning
c
t
x
r
Create an archive
List the contents of an archive
Extract files from an archive. Files are extracted to the current directory
Append to archive
Append to archive if file newer than copy already in archive (You must
specify exactly one of c, t, x, r or u)
The following argument specifies the name of the archive
Verbose mode: list the files being added / extracted
Compress/uncompress the archive using gzip compression
Compress/uncompress the archive using bz2 compression
u
f
v
z
j
tar examples
/tmp/foo.tar .
/home/tux
3. List the files in the compressed archive and verify that the file motd is
present (hint: use grep)
4. Remove the file /etc/motd, using rm
5. Restore the file /etc/motd from the compressed archive and verify
that it is now present
A level 1 dump dumps everything not on the most recent level 0 dump
A level 2 dump dumps everything not on the most recent level 1 dump
... and so on
Creating a dump
# dump 1uf
The dump
level: 0-9
Record the date
and level of the
dump in
/etc/dumpdates
/dev/st0
/new1
Dump regime
Example
Keep enough tapes/CDs that you can restore even if one is faulty
Example:
#
#
#
#
#
mke2fs /dev/hda5
mount /dev/hda5 /new1
cd /new1
restore rf /dev/st0
restore rf /dev/st0
cd
ls
add
delete
extract
quit
There are many free and commercial backup products for linux
Afbackup (sourceforge.net/projects/afbackup)
Integrity (www.availsolutions.com)
Mondo (www.microwerks.net/~hugo)
Quiz
When you create a dump, the lower the dump level, the bigger the dump
will be
You need the gcc compiler installed before you can install RPM packages