Managing Software Flashcards
library
- software component that can be used by many different programs
- reduce disk space and memory requirements of complex programs
package management
relates to managing programs as files on disk
foundational library upon which all other programs in the OS depend
linux kernel
purpose of package mangement tools
maintain a database of installed files
software package
self-contained module with tracking for all modules/software on which it depends
package database
- info about every file installed via package system
- name of package to which it belongs
- dependencies
- checksums
- upgrades and uninstallation
checksum
signature of a file to ensure:
- a package hasn’t been manipulated
- to ensure installation is correct
two main package managers
- rpm
- debian
True or False: RPM and Debian package management systems provide tools to help create binary packages
True
binary packages are installed from…
source code
advantage of installing from source rather than compiling
- track dependencies
rpm and debian compatibility
two don’t work together
Suse package management
use RPM but are different enough
main Red Hat distributions
- Red Hat Enterprise Linux, favored by servers
- Fedora, favord by high level users desktop
- Centos, enterprise users
RPM cross-platform capability
- source RPMs are transportable across architectures (i.e. x86, AMD64)
- some programs need no recompilation due to architecture-independed scripts
RPM package nomenclature
packageName-version.Number-buildNumber.architecture.packagemanager
(i.e. Samba-server-3.0.25b-4.5mdv2008.0.x86_64.rpm)
version information for package
can query the rpm bc information is retained within package
distribution-specific scripts
- sometimes startup scripts are included, but one may need to make their own
rpm switches
- i installs package, system must not contain a package of same name
- u installs new package or upgrades an existing pkg
- f or -freshen: upgrades a pkg only if earlier version exists
- q: queries a pkg, finds if installed, what it contains, and more
- v or -verify: verifies a pkg, checks files are present and unmodified
- e: uninstalls pkg
- b: builds a binary pkg given source code and config files (moved to rpmbuild as of rpm4.2)
- -rebuild: buils binary pkg (moved to rpmbuild as of rpm4.2)
- -rebuilddb: rebuilds rpm db to fix errors
- -root dir: modifies linux system having a root directory located at dir. Can be used to maintain one linux installation separate from another. Can be used during OS installation or emergency maintenance.
- force complete action without prompt
- i, -U, -F: forces install of a pkg even when it means overwriting existing files or pkgs
command rpm
- tool for red hat package management
- syntax: rpm [operation][options][pkg files | pkg names]
cpio
tool to extract from rpm package
command rpm2cpio
- transform rpm archive to cpio
- rpm2cpio [rpmFile] > [cpio file]
cpio switches
- i extract to archive
- -make-directories to create directories
(i. e. cpio -i –make-directories < [cpioFfile]
yum tool
- yum enables easy installation of pkgs and dependencies
- meta-packager
- locates all files for us by searching in a repository
- syntax: yum [options] [command] [package…]
yum commands
- install
- update, will update all if no pkg is specified
- check-update discovers available updates
- upgrade like update but will also check for obsolete software
- remove or erase deletes pkg and dependencies from system
- list displays info about a package such as version and available updates
- provides or whatprovides displays info for a specified program or feature
- search finds package names, summaries, packagers, descriptions
- info displays information about a pkg
- clean delets cache of downloaded packages
- shell enters shell mode so you can enter multiple comamnds one after another
- resolvedep displays pkgs matching specified dependency
- localinstall isntalls specified local rpm file using yum repositories to resolve dependencies
- localupdate updates system using specified local rpm files and yum repositories to resolve dependencies
- deplist displays dependencies of specified pkg
rpm config file
/usr/lib/rpm/rpmrc
popular repositories
- livna
- kde red hat
- fresh rpms
main debian distributions
- ubuntu
- libranet
- xandros
debian compatability
neutral with respect to OS and cpu type
debian maintainers
volunteers
dpkg switches
- i or -install: installs pkg
- -configure: reconfigure an install pkg, runs postinstallation script to set site-specific options
- r, –remove: remove a pkg leave config files
- P, –purge: remove a pkg and configs
- p, –print-avail: display info about installed pkg
- I or –info: displays info about an uninstalled pkg
- l (lower L), –list: lists installed pkgs whose name matches pattern
- L, –listfiles: lists installed files asociated with a pkg
- S, –search: locates pkg that own file specified by pattern
- C, –audit: searches for partially installed pkgs and suggest what to do with them
apt
- apt enables easy installation of pkgs and dependencies
- debian meta-packager
- locates all files for us by searching in a repository
- syntax: apt [options] [command] [package…]
dselect
- dselect enables easy installation of pkgs and dependencies
- debian meta-packager
- locates all files for us by searching in a repository
- syntax: dselect [options] [command] [package…]
command apt-cache
- provide info about debian pkg database
command apt-cache showpkg
- displays info about pkg
- syntax: apt-cache showpkg [packageName]
command apt-cache stats
- displays pkg info, pkg statistics
- syntax: apt-cache stats
command apt-cache depends
- displays dependencies
- syntax: apt-cache depends [packageName]
command apt-cache unmet
- find unmet dependencies
- syntax: apt-cache unmet
command apt-cache pkgnames
- displays all installed pkgs
- finds only those which include a pattern if provided
- syntax: apt-cache pkgnames [pattern]
apt repositories config
/etc/apt/sources.list
command apt
- allows one to get softare from list of repositiories easily
- syntax: apt [options]
apt update
- apt update: obtains updated info about pkgs available from /etc/apt/sources.list
apt upgrade
apt command which upgrades all installed pkgs to newest versions available based on locally stored info about available pkgs
apt install
apt command which installs a pkg by name, obtaining from source that contains recent version
apt remove
apt command which deletes a specified pkg by name
apt source
apt command which retrieves newest available source pkg file by pkg filename using info from installation archives listed in /etc/apt/sources.list
apt clean
apt command which checks pkg db for consistency and broken installations
apt check
apt command which performs housekeeping to clear out info about retrieved files from debian pkg db
apt autoclean
apt command similar to clean but removes info only about pkgs that can no longer be downloaded
dselect tool
- high-level package browser for debian
- select pkgs to intall from apt archives defined in /etc/apt/sources.list
- review packages already installed, uninstall, and upgrade
- similar to apt tool
aptitude tool
- interactive mode similar to dselect
- adds menus accessed by ctrl+T and rearranges some features
- combines interactive features of dselect with cli options of apt
configuration file for debian package tools
- dpkg: /etc/dpkg/dpkg.cfg or ~/.dpkg.cfg
- apt: /etc/apt/sources.list
- apt and dselect optins: /etc/apt/apt.conf
tool to convert between debian package formats
- Alien
- requires appropriate package manager software installed
- not 100% reliable dependency info conversion
- works only if original tarball has files that should be isntalled off / directory
- does not use db features of these packages unless you choose the –install option
command alien
- syntax: alien [options] file[]
- debian format is default
alien switches
–to-deb: convert to debian
–to-rpm: convert to rpm
–to-slp: convert to stampede
–to-tgz: conver to tarball
(i.e.
tar xvfz program.tar.gz
mv program-files usr
tar cvfz program.tgz usr
rm -r usr
alien –to-rpm program.tgz)
.so
shared object
static library nomenclature
.a filename extensions
shared library nomenclature
.so or so.version filename extensions
how can binary program fils point to libraries?
- name (i.e. libc.so.6)
- complete path (i.e. /lib/libc.so.6)
how to configure a library path
- global config file
- env variable
- /etc/ld.so.conf contains list of directories containing libraries
- /etc/ld.so.conf.d/*.conf contains a number of config files
config file containing a list of directories containing libraries
/etc/ld.so.conf
type of line to treat config files within a directory as if they were part of the main /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
libraries always on the library path, always refered to by Linuxq
- /lib
- /usr/lib
library path environment variable
LD_LIBRARY_PATH
i.e. export LD_LIBRARY_PATH=/usr/local/testlib:/opt/newlib will add two directories to the path
ldd
displays a program’s shared library dependencies
ldconfig
updates caches and links used by the system for locating libraries. It reads /etc/ld.so.conf and implements changesin that file or in the directories to which the file refers.
command ldd
- syntax: ldd [options]
- can be run by ordinary and root users
essential step after adding or removing libraries
reload /etc/ld.so.cache
True or False: ld.so and ld-linux.so programs read /etc/ld.so.conf every run
false, they use the cache in /etc/ld.so.cache
RPM and Debian automatically do this step after installing or removing packages
run ldconfig