102 Linux Installation and Package Management KT Flashcards
Key Terms
102.1 Design hard disk layout
The following is a partial list of the used files, terms and utilities:
/ (root) filesystem /var filesystem /home filesystem /boot filesystem EFI System Partition (ESP) swap space mount points partitions
/ (root) filesystem
This is the top level of all directories.
/var filesystem
Persistent, variable system data. Must be writable. This directory might be pre-populated with vendor-supplied data.
/home filesystem
The location for a normal user’s home directory.
/boot filesystem
The location of the boot partition responsible for bringing up the system.
EFI System Partition (ESP)
If the boot partition /boot/ is maintained separately from the EFI System Partition (ESP), the latter is mounted here. Tools that need to operate on the EFI system partition should look for it at this mount point first, and fall back to /boot/ — if the former doesn’t qualify.
swap space
Swap is a space on a disk that is used when the amount of physical RAM memory is full. When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.
mount points
A mount point is a directory (typically an empty one) in the currently accessible filesystem on which an additional filesystem is mounted.
partitions
Disk partitioning is the creation of separate divisions of a hard disk drive using partition editors such as fdisk.
102.2 Install a boot manager
The following is a partial list of the used files, terms and utilities:
menu.lst, grub.cfg and grub.conf
grub-install
grub-mkconfig
MBR
menu.lst
The GRUB menu.lst file lists the contents of the GRUB main menu. The GRUB main menu lists boot entries for all the OS instances that are installed on your system
grub.cfg
The grub.cfg file is the GRUB2 configuration file. It is generated by the grub2-mkconfig program using a set of primary configuration files and the grub default file as a source for user configuration specifications.
grub.conf
The GRUB menu interface configuration file is /boot/grub/grub.conf. The commands to set the global preferences for the menu interface are placed at the top of the file, followed by stanzas for each operating kernel or operating system listed in the menu.
grub-install
grub-install is a command/program that can be invoked to install the GRUB boot loader on a partition.
grub-mkconfig
grub-mkconfig is the command/program that generates a configuration file for GRUB.
MBR
A master boot record (often shortened as MBR) is a kind of boot sector stored on a hard disk drive or other storage device that contains the necessary computer code to start the boot process.
102.3 Manage shared libraries
The following is a partial list of the used files, terms and utilities:
ldd
ldconfig
/etc/ld.so.conf
LD_LIBRARY_PATH
ldd
Command: ldd prints the shared objects (shared libraries) required by each program or shared object specified on the command line.
ldd [option]… file…
ldconfig
Command: ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories, /lib and /usr/lib.
/sbin/ldconfig [-nNvXV] [-f conf] [-C cache] [-r root] directory…
/sbin/ldconfig -l [-v] library…
/sbin/ldconfig -p
/etc/ld.so.conf
The /etc/ld.so.conf file format allows the specification of an expected type. This is used only for those ELF libraries which we can not work out.
/etc/ld.so.conf can be used to configure the dynamic loader to search for other directories.
LD_LIBRARY_PATH
A list of directories in which to search for ELF libraries at execution time.
The items in the list are separated by either colons or semicolons, and there is no support for escaping either separator.
102.4 Use Debian package management
The following is a partial list of the used files, terms and utilities:
/etc/apt/sources.list dpkg dpkg-reconfigure apt-get apt-cache
/etc/apt/sources.list
The main Apt sources configuration file is at /etc/apt/sources. list. You can edit this files (as root) using your favorite text editor. To add custom sources, creating separate files under /etc/apt/sources.
dpkg
Command: dpkg is a tool to install, build, remove and manage Debian packages.
dpkg [option…] action
dpkg-reconfigure
Command: dpkg-reconfigure reconfigures packages after they have already been installed. Pass it the names of a package or packages to reconfigure. It will ask configuration questions, much like when the package was first installed.
dpkg-reconfigure [options] packages
apt-get
Command: apt-get is the command-line tool for handling packages, and may be considered the user’s “back-end” to other tools using the APT library. Several “front-end” interfaces exist, such as aptitude(8), synaptic(8) and wajig(1).
apt-get [options] command
apt-get [options] install|remove pkg1 [pkg2 …]
apt-get [options] source pkg1 [pkg2 …]
apt-cache
Command: apt-cache performs a variety of operations on APT’s package cache. apt-cache does not manipulate the state of the system but does provide operations to search and generate interesting output from the package metadata.
apt-cache [options] command
apt-cache [options] show pkg1 [pkg2 …]
102.5 Use RPM and YUM package management
The following is a partial list of the used files, terms and utilities:
rpm rpm2cpio /etc/yum.conf /etc/yum.repos.d/ yum zypper
rpm
Command: rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta-data used to install and erase the archive files.
rpm {-i|–install} [install-options] PACKAGE_FILE …
rpm2cpio
rpm2cpio converts the .rpm file specified as a single argument to a cpio archive on standard out. If a ‘-‘ argument is given, an rpm stream is read from standard in.
rpm2cpio [filename]
/etc/yum.conf
The configuration file for yum and related utilities is located at /etc/yum.conf. This file contains one mandatory [main] section, which allows you to set Yum options that have global effect, and can also contain one or more [repository] sections, which allow you to set repository-specific options.
/etc/yum.repos.d/
Directory where individual repositories in new or existing .repo files should be defined.
yum
Command: yum is an interactive, rpm based, package manager. It can automatically perform system updates, including dependency analysis and obsolete processing based on “repository” metadata. It can also perform installation of new packages, removal of old packages. yum is similar to other high level package managers like apt-get and smart.
yum [options] [command] [package …]
zypper
Command: zypper is command line interface in SuSE Linux which is used to install, update, remove software, manage repositories, perform various queries.
zypper [–global-opts] [–command-opts] [command-arguments]
102.6 Linux as a virtualization guest
The following is a partial list of the used files, terms and utilities:
Virtual machine Linux container Application container Guest drivers SSH host keys D-Bus machine id
Virtual machine
Virtual machines (VMs) are an abstraction of physical hardware turning one server into many servers. The hypervisor allows multiple VMs to run on a single machine.
Linux container
A Linux container is a set of one or more processes that are isolated from the rest of the system. All the files necessary to run them are provided from a distinct image.
This means that Linux containers are portable and consistent as they move from development, to testing, and finally to production.
Application container
Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space.
Guest drivers
Guest drivers provide additional functionality for virtual machines.
SSH host keys
A host key is a cryptographic key used for authenticating computers in the SSH protocol.
Host keys are key pairs, typically using the RSA, DSA, or ECDSA algorithms. Public host keys are stored on and/or distributed to SSH clients, and private keys are stored on SSH servers.
D-Bus machine id
The /etc/machine-id file contains the unique machine ID of the local system that is set during installation or boot. The machine ID is a single newline-terminated, hexadecimal, 32-character, lowercase ID. When decoded from hexadecimal, this corresponds to a 16-byte/128-bit value. This ID may not be all zeros.