Chapter 13 Flashcards
Governing Software
Describe how developers bundle their open source applications for distribution.
Linux developers bundle source code files, headers, libraries, and documentation files into a single file for distribution. They use the tar utility to archive multiple files and folders into a single archive file and then often compress the archive file using the gzip utility. You can use the wget or cURL program to download the source code distribution files and then use the gzip and tar utilities to decompress and extract the source code files.
Explain how to generate an executable program from a source code tarball.
After you decompress and extract the source code files from a distribution tarball file, you must compile the source code to create an executable file for the application. First, you must use the configure utility. This examines your Linux system to ensure that it has the correct dependencies required for the application and configures the installation script to find the dependencies. Next, you run the make utility. The make utility runs a script that uses the gcc compiler to compile the necessary library and source code files to generate the executable file for your system. Once that script completes, use the make script with the install option to install the executable file on your Linux system.
Describe how Linux packages applications for distribution.
Linux uses a package management system to track what applications are installed on your system. The distribution bundles precompiled application files into a package, which you can easily download and install. The package management database keeps track of which packages are installed and the location of all the files contained within the package. You can also query the package management database to determine what packages are installed and remove packages from the system using the package management tools. Debian-based Linux systems use the dpkg tool to interact with the package management database, whereas Red Hat–based Linux systems use the rpm tool.
Describe how Linux distributions use repositories.
While using packages makes installing, tracking, and removing software applications easier, you still must be able to find the latest packages for your applications. Most Linux distributions help with that by creating a centralized repository of current application packages, along with tools to work with the repository. For Debian-based systems, the apt suite of tools allows you to query the repository for package information and download any new or updated packages. Red Hat–based systems use the yum or dnf tool to interact with their repositories. All three tools allow you to query the remote repository for packages, query the local package management database, and install or remove packages as you need.
Explain how application containers differ from package management systems.
Application containers such as snap and flatpak bundle all of the files required to run an application, including any dependency applications, into a single package. While this can create duplicate copies of dependent applications, it ensures that each application has exactly the correct version of libraries and dependent applications installed to work, making it a breeze to move applications from one system to another.
Which two programs should you use to download tarballs from an application’s website? (Choose two.)
wget cURL dpkg rpm yum
A, B. When developers distribute their applications as source code tarballs using the tar and gzip utilities, you often need to download the file from a website. The wget and cURL programs allow you to download files from the command line, so options A and B are correct. The dpkg tool is used for installing DEB package files, not tarballs, so option C is incorrect. The rpm and yum tools are used for installing RPM package files, so options D and E are incorrect.
Fred received an application in source code format. What script should he run to create the executable application program?
dpkg rpm yum make wget
D. The make script runs the necessary compiler steps to compile all of the source code and library files necessary to build the application executable file, so option D is correct. The dpkg tool installs DEB package files, not source code files, so option A is incorrect. The rpm and yum tools are used to install RPM package files, so options B and C are incorrect. The wget program is used to download source code bundles, but not build them, so option E is incorrect.
Sherri is trying to compile an application from source code. Before she can create the application executable file, what script should she run to create the make script?
make make install configure gcc dpkg
C. The configure tool assesses your Linux system to ensure that any dependencies are met and that the proper compiler tools are installed and then builds the make script, so option C is correct. The make script along with the install option runs the make script but doesn’t create it, so options A and B are incorrect. The gcc program compiles the source code and library files but doesn’t create the make script, so option D is incorrect. The dpkg installs DEB package files but doesn’t create a make script, so option E is incorrect.
What is the most common compiler used for open source Linux applications?
gcc make configure dpkg rpm
A. The GNU Compiler Collection (gcc) is the most popular compiler used in Linux, so option A is correct. The make utility runs make scripts to help build applications using gcc, but it doesn’t compile the source code directly, so option B is incorrect. The configure utility helps build the make script based on the location of the compiler program, but it doesn’t compile the source code, so option C is incorrect. The dpkg and rpm programs are package tools for installing DEB and RPM package files, respectively, and aren’t used to compile source code files, so options D and E are both incorrect.
Harry has finished writing his application source code but needs to package it for distribution. What tool should he use so that it can be extracted in any Linux distribution?
dpkg rpm yum apt-get tar
E. The tape archive, or tar, application is often used for bundling source code projects into a single distributable file, so option E is correct. The dpkg, rpm, yum, and apt-get programs all work with package management files, and are not for archiving source code files, so options A, B, C, and D are all incorrect.
What tar command-line options are commonly used together to extract and decompress files from a tarball file?
-Uvh -zxvf -xvf -zcvf -cvf
B. The -zxvf command-line options for the tar program are commonly used to decompress and extract files from a tarball file, so option B is correct. The -Uvh option group is commonly used for the rpm program to install packages, but it’s not valid for the tar program, so option A is incorrect. The -xvf command-line option combination extracts files from a tarball but doesn’t decompress them, so option C is incorrect. The -zcvf option group will create a new tarball and compress it, not extract and decompress the files, so option D is incorrect. The -cvf option group creates a new tarball file, but it doesn’t extract files from an existing file, so option E is incorrect.
What filename extension does the Rocky Linux distribution use for packages?
.deb .rpm .tgz .tar .gz
B. The Rocky Linux distribution uses the Red Hat package management system, which uses RPM files, so option B is correct. The .deb filename extension is used to identify Debian-based package management files, so option A is incorrect. The .tgz filename extension is used to identify compressed tar archive files, so option C is incorrect. The .tar filename extension is used to identify tar archive files, so option D is incorrect, and the .gz filename extension is used to identify files compressed with the gzip utility, so option E is incorrect.
Sally needs to install a new package on her Ubuntu Linux system. The package was distributed as a DEB file. What tool should she use?
rpm yum dnf dpkg tar
D. The dpkg program is used to install DEB package files on Debian-based systems, so option D is correct. The rpm, yum, and dnf programs are all tools used for Red Hat–based package management systems, not Debian-based systems, so options A, B, and C are all incorrect. The tar program is used for creating and extracting tarball archive files, not DEB files, so option E is incorrect.
What tools do you use to install packages from a Red Hat–based repository? (Choose two.)
dpkg tar yum apt-get dnf
C, E. The yum and dnf programs are used to install RPM packages from Red Hat–based repositories, so options C and E are correct. The dpkg and apt-get programs are used for installing DEB files on Debian-based package management systems, so options A and D are incorrect. The tar program is used for creating and extracting archive files, so option B is incorrect.
What application container format do Red Hat–based Linux distributions utilize for installing applications?
flatpak rpm dpkg snap gcc
A. Red Hat–based Linux distributions use the flatpak application container format to install containers, making option A correct. The snap application container format is used in Ubuntu, but not Red Hat, so option D is incorrect. The rpm and dpkg formats are used in package management, not application containers, so options B and C are incorrect. The gcc program is used for compiling source code into executable programs, so option E is incorrect.