Ch 9 Managing Software Flashcards

1
Q

RPM stands for what?

A

Red Hat Package Manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do EUS, E4S, and ELS before the RPM stand for?

A

Extended Update Support(2 yrs and 4 yrs), Extended Life Cycle Support

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some benefits of dnf?

A
  1. The way it handles package dependencies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does dnf stand for?

A

dandified yum (yum is its predecessor)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why use software repos?

A

Helps when you’re installing and need dependencies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name 3 file compression/archiving tools

A

.tar, .zip, .gz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name 4 package formats for installing software

A

.exe (Windows), .rpm (Linux - redhat), .deb (Linux - debian), .pkg (MacOS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s a benefit of installing from a repo vs installing packages individually?

A

A repo resolves dependencies automatically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does dnf resolve dependencies?

A

dnf looks at the repos configured on a system to fetch dependencies automatically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an EPEL repo?

A

Extra Packages for Enterprise Linux. These are Fedora project repos that aren’t from RHEL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What command line tool is used to manage subscriptions?

A

subscription-manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In what circumstances would you need to specify which repos to use?

A
  1. You want to use nondefault software packages
  2. You are installing RHEL but not registering it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the four main parameters needed or a repo file?

A

[label] a repo file can have many sub repos, and each section starts with a label that ids each sub repo
name= specifies the name of the repo
baseurl= url pointing to repo location
gpgcheck= use if you want a gpg key used to verify package integrity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What directory contains repos?

A

/etc/yum.repos.d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What tool can generate a template repo file so you don’t have to remember the specifics?

A

dnf config-manager
e.g. dnf config-manager —add-repo=file:///repo/BaseOS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What options can you point to for a repo?

A

URI (file location), URL

file://URI or file:///repo/BaseOS

https://URL or https://reposerver.example.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What additional option needs to be set after creating a repo file with dnf config-manager –add-repo?

A

set gpgcheck = 0 if you don’t want the gpg check. If you don’t specify, by default it will want a gpgcheck

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Detail for repo parameter [label]

A

This is the section header inside the .repo file, enclosed in square brackets ([ ]).

It serves as a unique identifier for the repository and is used when running dnf commands (e.g., dnf repolist or dnf install –enablerepo=repoid)

See example below from the fedora.repo file.

[fedora]
name=Fedora $releasever - $basearch
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

[fedora-source]
name=Fedora $releasever - Source
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/source/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Detail for the name= parameter

A

This is the human-readable description of the repository, specified by the name= directive.

It is displayed in dnf repolist and other output but is not used in commands.

example: inside the fedora.repo file

[fedora]
name=Fedora $releasever - $basearch
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

[fedora-source]
name=Fedora $releasever - Source
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/source/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Detail for the mirrorlist= parameter

A

Optional parameter that refers to a URL where information about mirror servers for this server can be obtained. Typically used for big online repos only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Detail for the baseurl= parameter

A

mandatory option that refers to the base URL or URI where the RPM packages are found

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Detail for the gpgcheck= parameter

A

Set to 1 if a GNU Privacy Guard integrity check needs to b eperformed on the packages. If set to 1, a GPG key is required. This is also the default and will be set as such if you create a new repo with the repo creation command line tool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Detail for the gpgkey= parameter

A

Specifies the location of the GPG key that is used to check package integrity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What sort of circumstances would lead to the use of a gpg check being invaluable?

A
  1. A repo is hacked and the download files are replaced/changed
  2. A man in the middle attack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What are three protocol formats that can be used for the baseurl parameter of a repo file?

A

Http://, ftp://, or file://

Then follow with url or uri.

E.g. file:///location/of/files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What makes downloading from a repo especially vulnerable?

A

You have to run dnf commands as root, so whatever malicious interaction happens with the repo is going to happen as root user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What directory are gpg keys stored?

A

/etc/pki/rpm-gpg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

How is a gpg key for a repo acquired?

A

The gpg key is downloaded on first contact with the repo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Creating a repo: First two things you need

A
  1. Make sure all packages you need for the repo are in it
  2. Use the createrepo command to generated the repo metadata
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are the two subdirectories in a redhat installation repo directory?

A
  1. BaseOS - the base OS packages
  2. AppStream - the application stream packages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How do you list all repos?

A

dnf repolist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What command is used to manage repos?

A

dnf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

dnf command that lets you search packages for a string that occurs in the package name or summary

A

dnf search

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

dnf command that searches packages for a string that occurs in the package name, summary, or description(this last one is extra)

A

dnf search all

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

dnf command that provides more information about the package

A

dnf info

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

dnf command that installs a package

A

dnf install

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

dnf command that removes a package

A

dnf remove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

dnf command that lista all or installed packages

A

dnf list all, or dnf list installed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

dnf command that lists package groups

A

dnf group lists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

dnf command that installs all packages from a group

A

dnf group install

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

dnf command that updates specified packages

A

dnf update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

dnf command that removes all stored metadata

A

dnf clean all

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

how does dnf search work?

A
  1. It contacts the online repo
  2. it downloads the most recent repo metadata to your local machine
  3. it then searches package names and descriptions for the string you give it.

if no output, try dnf search all

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

what dnf command do you use if you want to see if a package in a repo contains a specific file that you want?

A

dnf provides or dnf whatprovides or dnf wp

and THEN, you HAVE to put the following package as thus: */filename (because it’s looking inside a package) or any other full file pathname

ex; dnf whatprovides */Containter file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

what dnf command removes a package from the system?

A

dnf remove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What do dnf remove and dnf install have in common?

A

They both do a dependency analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

what should you never do when using dnf remove?

A

bypass looking at the dependencies of a package (and therefore missing what other associated packages will be removed when you remove any one package

the no-no command is

dnf remove -y (selects the yes option to just automatically remove without the prompt)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

What is a protected package?

A

One that cannot just be removed easily, and dnf remove will not work on them. e.g…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

how can you use dnf to check if there’s a newer version of a package available in a remote repo?

A

dnf list ___

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

What happens to an old package when you update it?

A

It replaces the old package, unless it’s a kernel. Old kernels are not replaced.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

what is a package group?

A

a repo defines what that is, or what grouping exists for a given package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

How do you know what the package groups in a repo are?

A

dnf group list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

does dnf group list show all groups?

A

no, some are hidden

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

how do you show hidden package groups in a repo?

A

dnf group list hidden

55
Q

what dnf command gives you further info on a package group?

A

dnf group info

56
Q

what allows you to undo dnf commands?

A

dnf history, using dnf history undo [number in history]

e.g. dnf history undo 2 (erase the 2nd command in dnf history)

57
Q

What is the big distinction between BaseOS and AppStream repos? (the two default)

A

AppStream has packages that can change in major version, while BaseOS explicitly avoids this (for those that want that stability)

58
Q

Why do AppStream repos allow changes to major packages versions in the same distro, without having to do a major OS upgrade?

A

Because it was important that all dependencies of any one package be within one repo – but that’s hard to do if a major package version changes

59
Q

Give an example of a package that the AppStream repo can provide a major version upgrade for

60
Q

What is the key difference between modules and package groups?

A

package groups are static. they don’t have different versions or streams

modules allow you to install different versions of software while avoiding conflicts. great for quickly evolving software like python, postgresql

61
Q

table of properties with differences/distinctions bw package groups and modules

62
Q

what is an application stream?

A

It is a specific version of a module. this allows different major versions of packages to be offered within the same repo

63
Q

what must you do when working with modules from different streams? (diff major versions)

A

only one stream can be enabled at a time

64
Q

what is a module profile?

A

a profile is a list of packages that are installed together for a particular use case, and one module can have multiple profiles

65
Q

give an example of typical profiles within a module

A

minimal profile
default profile
server profile

66
Q

what is the default package format?

67
Q

What is inside an rpm?

A

files and metadata on how to install the files. may have a pre and post install script as well

68
Q

what is a module?

A

a delivery mechanism to install rpm packages. diff versions and profiles can be provided

69
Q

what is an application stream?

A

a specific version of a module

70
Q

what is a profile?

A

a collection of packages that are installed together for a particular use case

71
Q

what dnf command helps you find what modules are available?

A

dnf module list

72
Q

what dnf command will show you what streams there are for a module?

A

dnf module list modulename,

e.g.dnf module list maven

73
Q

what dnf command will tell you what profiles there are for a module?

A

dnf module info

dnf module info php - will tell you all the profiles for all the data streams for the php module

dnf module info php:8.1 - find all profiles for a specific stream (version) of php

74
Q

Label vs name parameters in a repo file

A

Label (or ID)
**This is the section header in the .repo file, enclosed in square brackets ([]).
** It is used internally by dnf to identify the repository.
**Must be unique within the .repo file.

Name
**The name directive provides a human-readable description of the repository.
**It does not need to be unique.
**It is used for display purposes, such as in dnf repolist.

75
Q

What command should be used if you want to change the stream (version) you’re on for a specific module?

A

dnf module enable php:8.1

this disables the old stream and enables the new stream

76
Q

what command should you run after changing the stream(version) of a module?

A

dnf distro-sync

this ensures all dependent packages that aren’t in the module itself are updated as well

77
Q

4 purposes of dnf distro-sync

A

Purpose of dnf distro-sync:

  1. Ensures Consistency: It aligns installed package versions with the repository versions.
  2. Downgrades Packages if Needed: If an installed package version is newer than what is available in the repo (e.g., after enabling an older repo), it will downgrade it.
  3. Upgrades Packages if Needed: If a newer version is available in the repo, it will upgrade the package.
  4. Fixes Partial Updates: If some packages were manually updated or installed from third-party sources, this command can bring them back to the official repository versions.
78
Q

What was the biggest issue with the old way of managing packages with rpm?

A

dependency hell

often while installing a group of rpms, many dependencies would arise. These would all have to be installed and with the right order as well

79
Q

What was rpm replaced (or rather extended) with?

A

repositories, then yum, then dnf (which looks at all available repos for dependencies)

80
Q

Even though packages that are downloaded can still be installed with rpm -Uvh packagename, what could be used to install that downloaded package instead?

A

dnf install packagename.rpm

the not only installs the package as rpm -Uvh would, but it considers all its repos to resolve dependencies automatically

81
Q

Even with better programs for package management than rpm, what is rpm often still used for?

A

querying packages

82
Q

What two package databases are maintained on a RHEL system?

A

rpm and dnf

83
Q

What happens with the dnf and rpm databases when a package is installed with dnf?

A
  1. dnf db gets updated
  2. that info then synchronizes with the rpm db
84
Q

what happens to the dnf and rpm databases when installing a package through rpm?

A
  1. the update is written to the rpm database only and does not update the dnf database – a good reason to not use rpm when installing software!
85
Q

Is there any reason to still use rpm when we have dnf?

A

Yes. Rpm is a better choice when…
1. when you want to install or remove a pkg without resolving dependencies (like if you already have the dependencies and you don’t want dnf adding more). This makes rpm faster when the extra dependency checks aren’t needed. ex: custom built rpm that has its dependencies included, removing a package while keeping dependencies intact)

  1. rpm checks if a file has been modified, corrupted, or deleted (helpful to see if a file was altered by an unintended process, diagnosing system integrity issues
  2. You can inspect a package BEFORE it is installed, which dnf can’t do (view package files, list info). This helps you checks a packages contents and see where a file would be placed.

rpm -qip for info and rpm -qlp for list files

  1. You can remove a package from rpm db without uninstalling the files (can’t do this with dnf) – helps when there is db corruption, or to force a package reinstallation without affecting files
  2. No repo is needed. If installing a local rpm, don’t need a repo. very fast and simple.
86
Q

composition of an rpm filename?

A

packagename-version-subversion.redhatversion.platform(32 or 64 bits)

e.g.

python-5.0.7-40.el7.x86_64

python package, version 5.0.7, subversion 40, for Red Hat 7, and for 6 bit architecture

87
Q

What rpm command will show you what software is installed on the machine?

88
Q

What is the dnf equivalent of the rpm -qa command?

A

dnf list installed

89
Q

What rpm query would tell me more abaout what files are in the nmap package?

A

rpm -qi nmap

this queries the installed version itself for the description, and the rpm db for more details

90
Q

What rpm command will show you all the files in a package, let’s say nmap?

A

rpm -ql nmap

91
Q

What rpm command could find you documentation for a package, say nmap?

A

rpm -qd nmap

92
Q

What rpm command would show you all the config files for a package, like nmap?

A

rpm -qc nmap

so like rpm query configs

93
Q

What rpm command would help you find a file name and the package its in?

A

rpm -qf filename

94
Q

What is the command rpm -qf /bin/ls doing?

A

queries the rpm database to find what package the file /bin/ls belongs to

95
Q

What must you add to an rpm command if querying a file that has not yet been installed?

A

-p

without this flag, you query the rpm db instead of the package itself

96
Q

What other consideration other than p flag, do you need to make when querying an rpm package directly and not the rpm db?

A

You have to provide the full rpm name and not just the package name. You need version and more.

97
Q

What is happening with this command?

rpm -qp –scripts httpd-2.4.6-19.el7.centos.x86_64

A

Directly query the package httpd-2.4.6-19.el7.centos.x86_64 instead of the rpm db, in order to see if the package contains scripts

98
Q

Why is it important to use rpm to query if an rpm package contains scripts?

A

Because rpms have to be installed as root, and you want to be sure there are no rogue scripts

99
Q

What rpm command will tell you the dependencies of a specific package?

100
Q

what rpm command shows which parts of a specific package have been changed since installation?

101
Q

What rpm command verifies installed packages and shows the parts that have been changed since installation?

102
Q

What’s the difference between rpm -V and rpm -Va?

A

rpm -V is for one package, rpm -Va is for all. It’s a system-wide integrity check.

103
Q

On an rpm -Va command’s output, what would the following 9 digits before a file mean?

S.5….T. c /etc/httpd/conf/httpd.conf

104
Q

What’s a drawback of rpm -qp?

A

It only works on RPM package files and can’t be used to query files directly form repos. That requires a separate command, repoquery

105
Q

What’s the purpose of repoquery?

A

Queries repos for rpms since the rpm command can’t

106
Q

Is repoquery a default package?

A

No, and it command with the dnf-utils package that would have to be installed

107
Q

How similar are rpm and repoquery?

A

They have similar option flags, but not –scripts, but this can be worked around if you only work with trusted repos

108
Q

If you wanted to know all the nitty gritty details of how an rpm is installed, how could you find out?

A

with the rpm -qp –scripts command

109
Q

How could a package be downloaded to the local directory?

A

using yumdownloader, a package provided by yum-utils

110
Q

rpm -qf $(which dnsmasq)
What’s going on in this command?

A

You’re querying to find out what package a file belongs to. For the file name, it’s using an embedded command to produce the filename (which dnsmasq) and you need the $ to embed it.

111
Q

In the context of taking the RHCSA test, why is it so helpful to know rpm commands?

A

It allows you to learn and find things on the fly when taking the test, by finding documentation and files and config files and all that.

112
Q

Very broadly and speaking high level, what’s different about dnf vs rpm?

A

dnf manages packages coming from repos, and rpm does queries on packages on a system

113
Q

How could you make a directory containing RPM packages into a repo?

A

createrepo enables you to make a directory containing a collection of RPM packages in a repository

114
Q

What needs to be in a repo file to point to a repository on http://server.example.com/repo?

A

the line [some-label] name=some-name baseurl=http://server.example.com/repo needs to be in the repo file

115
Q

You’ve just configured a new repo to be used on your RHEL computer. What command enables you to verify that the repo is indeed available?

A

dnf repolist verifies that a repository is available

116
Q

Which command enables you to search the RPM package containing the file useradd?

A

dnf provides */useradd enables you to search the RPM package containing the file useradd

117
Q

Which two commands do you need to use to show the name of the dnf group that contains security tools and shows what is in that group?

A

using dnf group list followed by dnf group info “Security Tools” shows the name and contents of the dnf group that contains security tools

118
Q

Which command do you use to ensure that all PHP related packages are going to be installed using the older version 7.1, without actually installing anything yet?

A

dnf module enable php:5.1 ensures that all PHP related packages are going to be installed using the older version 5.1, without actually installing anything yet

119
Q

You want to make sure that an RPM package that you have downloaded does not contain any dangerous script code. Which command enables you to do so?

A

rpm -pq –scripts packagename enables you to ensure that a downloaded RPM package does not contain dangerous script code

120
Q

Which command reveals all documentation in an RPM package?

A

rpm -qd packagename shows all documentation in an RPM package

121
Q

Which command shows the RPM package a file comes from?

A

rpm -qf /path/to/file shows which PRM package a file comes from

122
Q

Which command enables you to query software from the repository?

A

repoquery enables you to query software from the repository

123
Q

What’s the difference between repoquery and dnf?

124
Q

Review Q
Chapter 9
#1

A

D. The gpgcheck= line indicates whether to check the integrity of packages in the repository using the GPG key. Although useful, this capability is not mandatory in all cases

125
Q

Review Q
Chapter 9
#2

126
Q

Review Q
Chapter 9
#3

127
Q

Review Q
Chapter 9
#4

128
Q

Review Q
Chapter 9
#5

129
Q

Review Q
Chapter 9
#6

130
Q

Review Q
Chapter 9
#7

130
Q

Review Q
Chapter 9
#8

131
Q

Review Q
Chapter 9
#9

132
Q

Review Q
Chapter 9
#10