440 likes | 573 Views
Compression, backup, and software installation. Unit objectives Use compression utilities to compress and decompress files Perform system backups and view and extract archives Compile and install software packages from source code and use the Red Hat Package Manager. Topic A.
E N D
Compression, backup, and software installation Unit objectives • Use compression utilities to compress and decompress files • Perform system backups and view and extract archives • Compile and install software packages from source code and use the Red Hat Package Manager
Topic A • Topic A: Compression • Topic B: System backup • Topic C: Software installation
Compression • Process in which files are reduced in size by a compression algorithm • Compression algorithm • Instructions used to reduce the contents of a file
Common compression utilities • compress • gzip • bzip2
The compress utility • Uses LZW algorithm • 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
GNU zip (gzip) • Algorithm varies slightly from that used by compress • Yields better compression • Typical ratio: 60-70%
Common options with gzip continued
The bzip2 utility • Uses a different algorithm from compress or gzip • zcat and zmore can’t be used • Average ratio: 50-75% • bzcat • Used to view the contents of archive created with bzip2 • bunzip2 • Used to decompress files
Activity A-1 Compressing and uncompressing files
Topic B • Topic A: Compression • Topic B: System backup • Topic C: Software installation
System backup • Process of copying files to an archive • Archive • Location (file or device) that contains a copy of files • Typically created by a backup utility
magnetic tape (mt) command • Used to control tape devices
Activity B-1 Discussing backup media
Backup utilities • tar • cpio • dump/restore • burning software
Tape archive (tar) • One of the oldest and most common backup utilities • Accepts options to determine the location of the archive and the action to perform on the archive
Common options with tar continued
Tarballs • A gzip-compressed tar archive • Used for software distribution as well as backup
Activity B-2 Using the tar utility
The copy in/out (cpio) utility • Common backup utility • Options similar to tar with added features • Can back up device files and long filenames • Uses absolute pathnames by default
The dump/restore utility • Full backup • Archives an entire filesystem • Incremental backup • Archives only files modified since the last full backup • Works only with files on ext2 and ext3 filesystems
restore command • Extracts archives created with the dump command
Activity B-3 Using cpio and dump utilities
Topic C • Topic A: Compression • Topic B: System backup • Topic C:Software installation
Forms of software distribution • Binary program files • Pre-compiled to run on specific hardware • Source code • Must be compiled on the local architecture • RPM package • Uses Red Hat Package Management system
Source code • Independent of hardware platform • Procedure for compiling source code into binary programs is standardized among most open source developers • GNU C Compiler (gcc) • Used to compile source code into binary programs
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
Activity C-1 Discussing forms of software distribution
Installing from source code • Uncompress and extract files • Run configure • Run make • Run make install
Activity C-2 Compiling and installing a program from source code
RPMs • Filenames indicate hardware architecture the software was compiled for • rpm command • Command used to install, query, and remove RPM packages
Removing packages • Use RPM command with –e option
Red Hat Package Manager • Graphical tool that may be used to install RPM packages available with the GNOME/KDE desktop environment
Activity C-3 Using RPM to query packages
Activity C-4 Using RPM to install and remove software
Unit summary • Compressed and decompressed files using compression utilities • Performed system backups and viewed and extracted archives • Compiled and installed software from source code and used the Red Hat Package Manager