Ch. 13 Linux+ Governing Software
1. Which two programs should you use to download tarballs from an application's website? (Choose two.) A. wget B. cURL C. dpkg D. rpm E. 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.
10. Where should you place a new configuration file to add a third-party repository to a Red Hat-based package management system? A. /etc/yum.repos.d B. /etc/apt/sources.list C. /usr/lib D. /usr/bin E. /proc
A. Red Hat-based package management systems use the yum program to retrieve packages from repositories, so you need to add the third-party URL configuration to the /etc/ yum.repos.d folder, making option A correct.
4. What is the most common compiler used for open-source Linux applications? A. gcc B. make C. configure D. dpkg E. rpm
A. The GNU Compiler Collection (gcc) is the most popular compiler used in Linux, so option A is correct.
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.
6. What tar command-line options are commonly used together to extract and decompress files from a tarball file? A. -Uvh B. -zxvf C. -xvf D. -zcvf E. -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.
7. What file name extension does the CentOS Linux distribution use for packages? A. .deb B. .rpm C. .tgz D. .tar E. .gz
B. The CentOS Linux distribution uses the Red Hat package management system, which uses .rpm files, so option B is correct.
9. What tools do you use to install packages from a Red Hat-based repository? (Choose two.) A. dpkg B. tar C. yum D. apt-get E. 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.
3. 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? A. make B. make install C. configure D. gcc E. 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.
8. 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? A. rpm B. yum C. dnf D. dpkg E. tar
D. The dpkg program is used to install .deb package files on Debian-based systems, so option D is correct.
2. Fred received an application in source code format. What script should he run to create the executable application program? A. dpkg B. rpm C. yum D. make E. 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.
5. 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? A. dpkg B. rpm C. yum D. apt-get E. tar
E. The tape archive, tar, application is often used for bundling source code projects into a single distributable file, so option E is correct.
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.
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 tool. Debian-based Linux systems use the dpkg tool to interact with the package management database, while Red-Hat-based Linux systems use the rpm tool.
Describe how Linux distros use repositories:
While using packages makes installing, tracking, and removing software applications easier, you still must be able to find the latest packages from your applications. Most Linux distros 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 tools 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.