Course ILT
Compression, back-up, and software installation
Unit objectives Use compression utilities to compress and decompress files Perform system back-ups and view and extract archives Compile and install software packages from source code and use the Red Hat Package Manager Compress binary files and image files
Course ILT
Topic A
Topic A: Compression Topic B: System back-up Topic C: Software installation Topic D: Compressing binary and image files
Course ILT
Compression Process in which files are reduced in size by a compression algorithm Compression algorithm – Instructions used to reduce the contents of a file
Course ILT
Common compression utilities compress gzip bzip2
Course ILT
The compress utility Uses an algorithm to make file smaller Average ratio: 40-50% zcat – Used to view the contents of archive created with compress or gzip
zmore – Used to view page-by-page
uncompress – Decompresses files that were processed with compress
Course ILT
Common options with the compress utility
Course ILT
GNU zip (gzip) Algorithm varies slightly from that used by compress Yields better compression Typical ratio: 60-70%
Course ILT
Common options with gzip
continued
Course ILT
Common options with gzip, continued
Course ILT
The bzip2 utility Uses a different algorithm than compress or gzip zcat and zmore cannot be used Average ratio: 50-75% bzcat – Used to view the contents of archive created with bzip2
bunzip2 – Used to decompress files
Course ILT
Common options with bzip2
Course ILT
Activity A-1
Compressing and uncompressing files
Course ILT
Topic B
Topic A: Compression Topic B: System back-up Topic C: Software installation Topic D: Compressing binary and image files
Course ILT
System back-up Process of copying files to an archive Archive – Location (file or device) that contains a copy of files – Typically created by a back-up utility
Course ILT
Device files for different tape devices
magnetic tape (mt) command Course ILT
Used to control tape devices
Course ILT
Activity B-1
Discussing back-up media
Course ILT
Back-up utilities tar cpio dump/restore
Course ILT
Tape archive (tar) One of the oldest and most common back-up utilities Accepts options to determine the location of the archive and the action to perform on the archive
Course ILT
Common options with tar
continued
Course ILT
Common options with tar, continued
Course ILT
Tarballs A gzip-compressed tar archive Used for software distribution as well and back-up
Course ILT
Activity B-2
Using the tar utility
Course ILT
The copy in/out (cpio) utility Common back-up utility Options similar to tar with added features – Can back up device files and long filenames
Uses absolute pathnames by default
Course ILT
Common options with cpio
The dump/restore utility Course ILT
Full back-up – Archives an entire filesystem
Incremental back-up – Archives only files modified since the last full back-up
Works only with files on ext2 and ext3 filesystems
Course ILT
A sample back-up strategy
Course ILT
Options with dump/restore
Course ILT
restore command Extracts archives created with the dump command
Course ILT
Activity B-3
Using cpio and dump utilities
Course ILT
Topic C
Topic A: Compression Topic B: System back-up Topic C: Software installation Topic D: Compressing binary and image files
Forms of software distribution Course ILT
Binary program files – Pre-compiled to run on specific hardware
Source code – Must be compiled on the local architecture
RPM package – Use Red Hat Package Management system
Course ILT
Package manager Defines a standard package format Can be used to install, query, and remove packages Red Hat Package Manager (RPM) – The most commonly used
Course ILT
Compiling source code into programs
The procedure for compiling source code into binary programs is standardized today among most open source software developers GNU C Compiler (gcc) – Command used to compile source code into binary programs
Course ILT
Activity C-1
Discussing forms of software distribution
Course ILT
Installing from source code 1. 2. 3. 4.
Uncompress and extract files Run configure Run make Run make install
Course ILT
The LTRIS program
Course ILT
Activity C-2
Compiling and installing a program from source code
Course ILT
RPMs Filenames indicate hardware architecture the software was compiled for rpm command – Command used to install, query, and remove RPM packages
Course ILT
Common options with RPM
Course ILT
Red Hat Package Manager Graphical tool that may be used to install RPM packages available with the GNOME/KDE desktop environment
Course ILT
The RPM interface
Course ILT
Activity C-3
Using RPM to install and remove software
Course ILT
Topic D
Topic A: Compression Topic B: System back-up Topic C: Software installation Topic D: Compressing binary and image files
gzexe Course ILT
Compresses binary programs
Course ILT
Activity D-1
Using the gzexe utility
Course ILT
Compressing images Use the cjpeg program to compress .tga image files and convert them to JPEG format The cjpeg program converts a .jpeg image file to grayscale
Course ILT
Activity C-2
Using the cjpeg utility
Course ILT
Unit summary Compressed and decompressed files using compression utilities Performed system back-ups and viewed and extracted archives Compiled and installed software from source code, and use the Red Hat Package Manager Compressed binary and image files