Ubuntu linux 3A

Flashcard maker : Lily Taylor
Question 1
You have installed a package called mathpac with yum. After a system upgrade, the package is not working correctly. Which command should you try first to get the package to work?

yum remove math pac and then yum install math pac

rpm -U math pac

yum upgrade math pac

yum update math pac

yum update math pac

Explanation

update will insure all dependencies are met. upgrade is for some backward compatibility and considers package ‘obsoletes’. It may be removed in the future. The yum remove math pac and then yum install math pac will work, but has unnecessary steps. The rpm command is inappropriate for yum packages.

Question 2

You recently installed a third hard drive in your system. You need to install GRUB on the hard drive. Which command should you use?

grub-install –root-directory= /boot sdO

grub-install –root-directory=/boot sd1

grub-install –root-directory=/boot sd2

grub-install –root-directory= /boot sd3

grub-install –root-directory=/boot sd2

Explanation

Use grub-install –root-directory=/boot sd2 to install GRUB on the third hard drive.
##MARGINS=16,8,0,0##. The –root-directory option specifies the directory and hard drive where to install GRUB. ##MARGINS=16,0,0,0##. The third hard drive is represented as sd2. sd3 represents the forth hard drive in the system.

Question 3

Which of the following utilities should you use if you need to extract a file from an RPM package file?

createrepo

rpm2cpio

rpm-i

rpm-e

rpm2cpio

Explanation

Use rpm2cpio to convert RPM packages into a cpio archive. This is useful for extracting files from an RPM package without installing and searching for the specific files.

createrepo creates a repository list of RPM packages stored locally or on a network. rpm -e uninstalls (i.e., erases) a package. Uninstalling packages uses the package name, not the file name. If dependencies exist, the dependent packages must first be removed. rpm -i installs a package. Use the entire package filename when installing.

Question 4

You are attempting to install an RPM package on your Linux system, but the system tells you that a newer package is already installed.

What command will install the RPM package over the existing, installed package?

rpm -ihv

rpm –force

rpm-e

rpm –rebuilddb

rpm –force

Explanation
The rpm –force command install the package regardless of whether, a newer version of the package is already installed, package files overwrite files from previously installed packages, or if the package replaces other installed packages. Be aware of the other rpm options:

##MARGINS=16,8,O,O##. -i installs a package. Use the entire package filename when installing. ##MARGINS=16,O,O,O##. -h prints hash marks as the package archive is unpacked. ##MARGINS=16,O,O,O##. -v displays a verbose version of the installation.

##MARGINS=16,O,O,O##. –rebuilddb rebuilds the database indices from the installed package headers. ##MARGINS=16,O,O,O##. -e uninstalls (i.e., erases) a package. Uninstalling packages uses the package name, not the file name. If dependencies exist, the dependent packages must first be removed.

##MARGINS=16,O,O,O##. –initdb creates a new database.

##MARGINS=16,O,O,O##. –checksig checks the authenticity of the package. The option checks the packages digital signing key against the package to insure it has not been altered.

##MARGINS=16,O,O,O##. –test tests a package for uninstalled dependencies without actually installing it.

##MARGINS= 16,0,0,0##. -v verifies that packages are free from errors. RPM only gives output when packages have errors. If errors are present, the command displays the error code and the file name.

##MARGINS= 16,0,0,0##. -q queries the computer for information about installed packages. Note: Use this with -a to list all packages and -I show the files associated with the package.

##MARGINS= 16,0,0,0##. –nodeps installs the package without checking for dependencies. ##MARGINS=16,O,O,O##. -U updates an installed package to the newest version.

##MARGINS=16,O,O,O##. -F upgrades the package, but only if an earlier version currently exists on the system.

Question 5

Which of the following commands displays all of the shared library information for the /bin/bash executable?

Idconfig -N /bin/bash

Idconfig -p /bin/bash

Idd /bin/bash

Idd -v /bin/bash

Idd -v /bin/bash

Explanation
Idd -v /bin/bash displays all of the shared library information for the /bin/bash executable. The Idd command displays which libraries are used by another library (i.e., library dependencies). Be aware of the following options Idd options:

##MARGINS=16,8,O,O##- -y displays all information. ##MARGINS=16,O,O,O##- –version displays the version number of Idd. ##MARGINS=16,O,O,O##- -u displays unused direct dependencies.

The Idconfig reloads the library cache every time you add or remove libraries, and updates the symbolic links. Be aware of the following options Idconfig options:

##MARGINS=16,8,O,O##- -N updates symbolic links, but does not update the cache.

##MARGINS=16,O,O,O##- -p displays the current library cache, including all the library directories and their respective libraries.

Question 6

What file contains a colon, space, tab, newline, or comma-delimited list of directories in which to search for libraries? (Tip: Enter the full path to the file.)

/etc/ld.so.conf

Explanation

/etc/ld.so.conf contains a colon, space, tab, newline, or comma-delimited list of directories in which to search for libraries. Some lines in the file begin with the include directive, which lists files that are to be included as if they were part of the part of the main file.

Use the Idconfig -f command to change the configuration file from the default of /etc/ld.so.conf.

Question 7

Which of the following situations is most likely to cause a dependency problem?

Several applications use the library /usr/lib/biglib

Installing two different packages that both include /usr/lib/graphlib

Upgrading the kernel from 2.4.6 to 2.4.12

Upgrading the library /usr/lib/biglib from version 1.4 to version 1.6

Installing two different packages that both include /usr/lib/graphlib

Explanation

Installing two different packages that include the same library has the possibility of conflicting versions.

Generally, upgrading a library to a higher version is not a problem. Several applications using the same library are per design and will not cause conflicts. Upgrading the kernel and staying within the same minor revision level will usually not cause conflicts.

Question 8

You have GRUB installed on your workstation. You need to make some permanent changes to the boot loader. What file would you edit? (Select two.)

/boot/grub/menu.lst

/boot/grub/grub.conf

/boot/grub.conf

/etc/lilo.conf

/boot/boot.conf

/boot/grub/menu.lst

/boot/grub/grub.conf

Explanation

The GRUB configuration file is /boot/grub/grub.conf or /boot/grub/menu.lst. In some distributions, the menu.lst file is a symbolic link to the grub.conf file.

Question 9

Which command will search for packages that have been partially installed on the system? (Tip: Enter the command as if at the command prompt.)

dpkg -C

Explanation
The dpkg -C command searches for packages that have been partially installed on the system. The dpkg command installs Debian packages on Debian distributions.

Question 10

Which rpm option will perform an MD5 checksum on the myapp5.4.rpm package? (Tip: Type the command as if at the command prompt.)

rpm -v myapp5.4.rpm

Explanation
rpm -v myapp5.4.rpm will perform an MD5 checksum on the package to verify that the myapp5.4.rpm package is free from errors. RPM only gives output when packages have errors. If errors are present, the command displays the error code and the file name.

Question 11

Which of the following methods should you use to configure dynamic libraries on a Linux system? (Select two.)

Use the LD_LIBRARY _PATH environment variable to specify additional directories to search for library files.

Modify /etc/ld.so.cache to add the path of the libraries.

Edit all files with the .a filename extension.

Modify /etc/ld.so.conf to add the path of the libraries.

Use the LD_LIBRARY _PATH environment variable to specify additional directories to search for library files.

Modify /etc/ld.so.conf to add the path of the libraries.

Explanation
Use the following methods for configuring dynamic libraries on a Linux system:

##MARGINS=16,8,O,O##e Modify jetcjld.so.conf to add the path of the libraries.

##MARGINS= 16,O,O,O##e Use the LD_LIBRARY _PATH environment variable to specify additional directories to search for library files.

/etc/ld.so.cache is a cached list of libraries found in the directories specified in /etc/ld.so.conf. The system uses this cached list instead of loading /etc/ld.so.conf every time a program runs. Static libraries have an .a filename extension and are used when shared libraries are not available.

Question 12

You are attempting to install an RPM package on your Linux system, but the system tells you that package has dependencies that are not installed. What rpm option will override the need to install the dependencies? (Tip: Enter the command as if at the command prompt.)

rpm –nodeps

Explanation

The rpm –nodeps command installs the package without checking for dependencies. This is not recommended. A dependency is an application’s reliance on another package to perform correctly.

Question 13

Without installing an RPM package, you want to check for all of the package’s uninstalled dependencies.

Which command should you use?

rpm –test

rpm -ihv

rpm –checksig

rpm-U

rpm –test

Explanation
The rpm –test tests a package for uninstalled dependencies without actually installing it. Be aware of the other rpm options:

##MARGINS=16,8,0,0##. -i installs a package. Use the entire package filename when installing. ##MARGINS=16,0,0,0##. -h prints hash marks as the package archive is unpacked. ##MARGINS=16,0,0,0##. -v displays a verbose version of the installation.

##MARGINS=16,0,0,0##. –checksig checks the authenticity of the package. The option checks the packages digital signing key against the package to insure it has not been altered.

##MARGINS=16,0,0,0##. -U updates an installed package to the newest version.

##MARGINS=16,0,0,0##. –rebuilddb rebuilds the database indices from the installed package headers. ##MARGINS=16,0,0,0##. -e uninstalls (i.e., erases) a package. To uninstall packages, use the package name, not the file name. If dependencies exist, the dependent packages must first be removed.

##MARGINS=16,0,0,0##. –initdb creates a new database.

##MARGINS= 16,0,0,0##. -v verifies that packages are free from errors. RPM only gives output when packages have errors. If errors are present, the command displays the error code and the file name.

##MARGINS= 16,0,0,0##. -q queries the computer for information about installed packages. Note: Use this with -a to list all packages and -I to show the files associated with the package.

##MARGINS=16,0,0,0##. –nodeps installs the package without checking for dependencies.

##MARGINS=16,0,0,0##. -F upgrades the package, but only if an earlier version currently exists on the system. ##MARGINS=16,0,0,0##. –force installs the package, regardless of whether a newer version of the package is already installed. Package files overwrite files from previously installed packages, or if the package replaces other installed packages.

Question 14

You are working on a Debian distribution of Linux. You want to retrieve information about the Debian package database on the system. Without any command options, which command will provide the information you need?

apt-cache

Explanation
The apt-cache command retrieves information about the Debian package database. Be aware of the following apt-cache options:

##MARGINS=16,8,O,O## -showpkg displays information about a package in the database.

##MARGINS= 16,O,O,O## -stats shows the number of packages installed, dependency information, and other package cache statistics.

##MARGINS=16,O,O,O## -unmet lists any missing dependencies in the package cache. ##MARGINS=16,O,O,O## -depends shows all of the package’s dependencies.

##MARGINS= 16,O,O,O## -pkgnames displays whether a package is installed on the system. When the package name is left off, the command shows information for all packages on the computer.

##MARGINS=16,O,O,O## -search searches for a package in the cache.

Question 15

You have previously installed package ‘mplayer’ and wish to remove it from your computer. Which of these methods is the best?

Locate the files for mplayer and delete them.

Run the command tar -e mplayer.

Run the command erase -r mplayer.

Run the command rpm -e mplayer-1.0-0.10.pre4.1.fc2.fr.i386 to uninstall mplayer.

Run the command rpm -e mplayer-1.0-0.10.pre4.1.fc2.fr.i386 to uninstall mplayer.

Explanation

The proper method is to run the rpm -e command to uninstall the application.

The tar command cannot be used to uninstall packages. There is no standard Linux command called erase. Trying to manually uninstall an application by erasing its files is not recommended

Question 16

Which of the following Debian package management utilities provides the front-end for APT?

aptitude

apt-get

apt-cache

dpkg

aptitude

Explanation

aptitude is the front-end to Advanced Packaging Tool (APT) which displays a list of software packages and allows the user to interactively pick packages to install or remove.

apt-get downloads and installs packages including dependencies. apt-cache retrieves information about the Debian package database. dpkg installs Debian packages on Debian distributions.

Question 17

You are editing the /boot/qrub/qrub.conf file as shown below.

default=O
timeout=5
splashimage=(hdO,O)/grub/splash.xpm.gz
#hiddenmenu
title Fedora (2.6.33.3-85.fc13.i686)
root (hdO,O)
kernel /vmlinuz-2.6.33.3-85.fc13.i686 ro root=/dev/mapper/vg vm-lv_root rd_LVM_LV-vg_vm/ v_root
rd_LVM_LV=vg_vm/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en US.UTF-8 SYSFONT=latarcyrheb-sun16
KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /initramfs-2.6.33.3-85.fc13.i686.img

title Red Hat Linux (2.6.18-19.8.0.19)
root (hdO,l)
kernel /boot/bzlmage.2.6.18-19.8.0.19mar2009 ro root=/dev/mapper/vg_vm-lv_root rd_LVM_LV=vg_vm/
lv root rd_LVM_LV=vg_vm/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16
KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initrd-2.6.18-19.8.0custom.img.19mar09

You want GRUB to load the second operating system installed on the system as the default when the system boots.

What should you do?

Change the #hiddenmenu line to read hiddenmenu.

Change the timeout line to read timeout=2.

Change the default line to read default=1.

Leave the configuration file alone, as it will already select the correct operating system.

Change the default line to read default=1.

Explanation

Use the default line to specify the operating system that boots as the default. In this case, you should change the default line to read default=1. or default=Red Hat Linux. Either method configures GRUB to load the second operating system installed on the system as the default when the system boots.

The hiddenmenu line disables/enables the menu that lists the operating system options. The timeout line sets the number of seconds GRUB waits before automatically booting the default operating system.

Question 18

How many logical partitions can you create on an extended partition?

1

2

Unlimited

4

Unlimited

Explanation

You can create an unlimited amount of logical partitions on an extended partition. An extended partition is an optional partition that does not have an operating system installed on it and thus is not bootable. Extended partitions can be further subdivided into an unlimited amount of logical drives. There can be a maximum of one extended partition on a single hard disk drive.

Question 19

You need the Yellowdog Updater Modified (YUM) utility to check specific URLs for RPM repositories. Where should you add the URLs?

Within the /etc/yum.conf file.

Within the /etc/yum.repos.d/ directory.

Within the /var/lib/rpm directory.

Within the /var/usr/yum.log file.

Within the /etc/yum.conf file.

Explanation
Add the URLs of RPM repositories to the /etc/yum.conf configuration file. The configuration file contains:

##MARGINS=16,8,O,O## -URLs of RPM repositories. ##MARGINS=16,O,O,O## -Directories where it saves downloaded packages.
##MARGINS=16,O,O,O## -Locations of logs.

You can also add a .repo file for each Internet repository in the /etc/yum.repos.d/ directory. YUM uses /var/usr/yum.log as a log file to track when packages are installed, removed, or downloaded. The Red Hat Package Manager (RPM) uses a database stored at /var/lib/rpm that keeps track of all installed packages, their current status, and available updates.

Question 20

You need to remove an RPM package from your system. Which of the following commands could you use? (Select two.)

yum search

yum provides

yum erase

yum remove

yum erase

yum remove

Explanation
To remove an RPM package from your system using the Yellowdog Updater Modified (YUM) use:

##MARGINS=16,8,O,O## – rpm erase ##MARGINS=16,O,O,O## – rpm remove

rpm provides displays what packages are associated with a specific file. rpm search searches all packages for a specified term.

Question 21

Which yum option displays whether updates are available for RPM packages?

list updates

update

list

install

list updates

Explanation

yum list updates displays whether updates are available for packages. Use the Yellowdog Updater Modified (YUM) utility to install RPM packages, including their dependencies.

yum list displays lists of packages. yum install installs a package. Use the entire package filename when installing. yum update updates RPM packages.

Question 22

You need to install the package apt-0.S.1Scnc6-1.1.fc2.fr.i386.rpm. Which commands will perform the installation? (Choose two.)

rpm -Xh apt-O.5.15cnc6-1.1.fc2.fr.i386

rpm -e apt-O.5.15cnc6-1.1.fc2.fr.i386

tar -Uh apt-O.5.15cnc6-1.1.fc2.fr.i386

rpm -ih apt-O.5.15cnc6-1.1.fc2.fr.i386

rpm -Uh apt-O.5.15cnc6-1.1.fc2.fr.i386

rpm -ih apt-O.5.15cnc6-1.1.fc2.fr.i386

rpm -Uh apt-O.5.15cnc6-1.1.fc2.fr.i386

Explanation

The commands rpm -Uh or rpm -ih will install package apt-0.S.1Scnc6-1.1.fc2.fr.i386.

The command rpm -e will erase an installed package. There is no -X switch to use with rpm. Tar does not work with rpm files.

Question 23

You need to determine which files are associated with the metacity RPM package. What command should you use?

rpm –test meta city

rpm -i metacity

rpm -v metacity

rpm -ql metacity

rpm -ql metacity

Explanation

rpm -ql metacity shows the files associated with the metacity package.

rpm -l installs a package. Use the entire package filename when installing. rpm -V verifies that packages are free from errors by performing an MDS checksum on the package. rpm –test tests a package for uninstalled dependencies without actually installing it.

Question 24

Which directory contains user data for all standard users on the system? (Tip: Enter the full path to the directory.)

/home

Explanation
The /home directory contains the user data for all users on the Linux system except for the root user account. When planning partitions, you should create a separate partition for the /home directory.

Question 25

You are working on a Debian distribution of Linux. You need to install a package, but you do not want to manually install all the dependencies for the package. Which command should you use? (Tip: Do not include any command options.)

apt-get

Explanation
The apt-get command downloads and installs packages on a Debian distribution. Apt-get:

##MARGINS=16,8,O,O## – Is similar to the yum utility on an RPM distribution.
##MARGINS=16,O,O,O## – Gets its information about the application repositories from the /etc/apt/sources.list file.

Get instant access to
all materials

Become a Member