2.
Type in the command line to upgrade a package using the apt-get command. Thepackage name is package1.
Explanation
Updating Information on Available Packages
To update information on available packages, issue the following command:
apt-get updateInstalling a PackageTo install a specified package, issue the following
command:apt-get install packagewhere package specifies the name of the package to be
installed.Upgrading Installed PackagesTo automatically upgrade all installed packages to
the latest available version, issue the following command:apt-get upgrade package
3.
Which of the following commands can be used to create a tar archive file in verbosemode?
Correct Answer
A. Tar -cvf
Explanation
To create a tar file with verbose mode
tar -cvf tarfilename sourcefiles
Some Common Options:
c Create a tar file
t Test a tar file
x Extract a tar file
v Verbose
f Tar Filename
4.
You wish to install a package named package.deb using the apt-get tool. Type thesimplest command line to do this.
Correct Answer
apt-get install package.deb
Explanation
To install the package using apt-get command
5.
The ______ command is typically used to search files for a specified string.
Correct Answer
grep
Explanation
grep command prints lines of files where pattern is matched.
Eg: grep root /etc/passwd à will display all lines from /etc/paswd matching the root pattern.
6.
While installing from source code you don't see the configuration script. Whatcommand can you run to compile the code?
Explanation
The purpose of the make utility is to determine automatically which
pieces of a large program need to be recompiled, and issue the commands to recompile
them. example C programs, since they are most common, but you can use make with any
programming language whose compiler can be run with a shell command. In fact, make
is not limited to programs. You can use it to describe any task where some files must be
updated automatically from others whenever the others change.
To prepare to use make, you must write a file called the makefile that describes the
relationships among files in your program, and the states the commands for updating
each file. In a program,typically the executable file is updated from object files, which
are in turn
made by compiling source files.
So, make command compile the source code.
7.
You want to install a new software package, but it is only available inRPM format and you are running Debian Linux. Which of the followingwould help you to install it on your system?
Explanation
alien is a program that converts between Redhat rpm, Debian deb,
Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a
package from another linux distribution than the one you have installed on your
system, you can use alien to convert it to your preferred package format and install
it. It also supports LSB packages.
8.
Which of the following commands can be used to extract a tar file?
Correct Answer
A. Tar -xvf
Explanation
tar -xvf tarfile
Some Common Options:
c Create a tar file
t Test a tar file
x Extract a tar file
v Verbose
f Tar Filename
9.
Type in the command to update the apt-get database with new or updated packages.
Correct Answer
apt-get update
Explanation
Updating Information on Available Packages
To update information on available packages, issue the following command:
apt-get updateInstalling a PackageTo install a specified package, issue the following
command:apt-get install packagewhere package specifies the name of the package to be
installed.Upgrading Installed PackagesTo automatically upgrade all installed packages to
the latest available version, issue the following command:apt-get upgrade package
10.
What is filename including full path, of the file used to configure library pathsettings for a system?
Correct Answer
A. /etc/ld.so.conf
Explanation
/etc/ld.so.conf File containing a list of colon, space, tab, newline, or comma
spearated directories in which to search for libraries. So you should specify the full path
the libraries in /etc/ld.so.conf file.
11.
What environment variable will set the path for added libraries?
Correct Answer
A. LD_LIBRARY_PATH
Explanation
the LD_LIBRARY_PATH environmental variable set the path for
added libraries. You can display environmental varialble using env command.
12.
To what environment variable will you assign or append a value ifyou need to tell the dynamic linker to look in a build directory for someof a program's shared libraries?
Correct Answer
A. LD_LIBRARY_PATH
Explanation
the LD_LIBRARY_PATH environmental variable set the path for
added libraries. You can display environmental varialble using env command.
13.
What command will display the needed libraries for the program myprog1 to run?
Correct Answer
ldd myprog1
Explanation
ldd command prints the shared libraries required by each program or
shared library specified on the command line.
14.
You wish to install a debian package using dpkg called debianpackage.deb. Give thesimplest command line to do this.
Correct Answer
dpkg -i debianpackage.deb
dpkg --install debianpackage.deb
Explanation
There are two different options -i or -install. Convention is short option starts from - and
long option starts from -- .
If you have a package file containing a package you want to install, the simplest way to
install the package is to use the dpkg command:
dpkg --install packagefile
where packagefile stands for the name of the package file, which generally ends with the
characters .deb. If all the prerequisite packages have already been installed and if the
package does not conflict with any installed packages, the command will unpack the
package files, move them to their proper locations, and execute the scripts necessary to
configure the package.
15.
What RPM command would show you detailed information for a package calledopenssh-3.6.i386.rpm?
Correct Answer
A. Rpm -qi openssh-3.6.i386.rpm
Explanation
-qi option queried and display the information about the package.
16.
After a minor security incident you are instructed by your lead sys-admin to verify theRPM's installed on a running system. Which command will create a complete report which you can analyze for changes which may be security related?
Correct Answer
A. Rpm -Va >report
Explanation
Verifying a package compares information about the installed files in
the package with information about the files taken from the package metadata
stored in the rpm database. Among other things, verifying compares the size, MD5
sum, permissions, type, owner and group of each file. Any discrepancies are
displayed.
To verify the package:
rpm -Va or -verify -a packagename
17.
What operation of the make utility cannot normally be performed as a normal user?
Correct Answer
A. Install
Explanation
make install or install command creates/writes the files or directory on
different directory. To write or to create user required write permission to parent
directory. Generally, normal users doesn't have write permission to system
directory.
18.
You want to find out what files are contained in a tar file. How would you do this?
Correct Answer
A. Use the tar command with the -t switch
Explanation
To test the tar files by displaying the contents of tar file use the -t or
--list option on tar command.
Example: tar -t tarfilename.tar
19.
User Joseph has successfully extracted and compiled a program fromsource code. Installing the binaries produces errors. What is the mostlikely reason?
Correct Answer
A. The binaries require root privileges to be installed.
Explanation
The most likely reason for the errors occurring during the installation of the binaries is that they require root privileges to be installed. Root privileges are necessary for certain system-level operations, such as modifying system directories or accessing restricted resources. Without the proper permissions, the installation process may encounter errors and fail to complete successfully.
20.
On boot, your system shows messages that mention library file errors. Whatcommand should you type (command only) to attempt to fix the library errors?
Correct Answer
ldconfig
Explanation
ldconfig command is used to configure dynamic linker run time
bindings
21.
Type the shortest command including switches, to remove the installed Redhat Package named packagename from the system.
Correct Answer
rpm -e packagename
Explanation
rpm -e packagename
22.
What tool can you use to print shared library dependencies?
Explanation
Explanation: ldd command prints the shared libraries required by each program or
shared library specified on the command line.
Example: ldd libdb.so.3
libc.so.6 => /lib/tls/libc.so.6 (0x00237000)
/lib/ld-linux.so.2 (0x0021e000)
23.
What is the full path including the filename of the configuration file that stores thelocations of all library files on the system?
Correct Answer
/etc/ld.so.conf
Explanation
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). The cache is used by
the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and file names of
the libraries it encounters when determining which versions should have their links
updated.
Some files:
/lib/ld.so run-time linker/loader
/etc/ld.so.conf File containing a list of colon, space, tab, newline, or comma spearated
directories in which to search for libraries.
/etc/ld.so.cache File containing an ordered list of libraries found in the directories
specified in /etc/ld.so.conf.
24.
What is the correct syntax to remove Certkiller entirely from a Debian Systemincluding configuration files?
Correct Answer
A. Dpkg --purge Certkiller
Explanation
To remove an installed package, use the command
dpkg --remove package à this command does not remove package configuration files,
which may facilitate subsequent re-installation of the package. If you want to remove the
configuration files as well, use the command:
dpkg --purge package
25.
You have a package called debianpkg.deb and wish to convert it to an rpm.Type the command line that will do this for you including switches.
Correct Answer
alien -r debianpkg.deb
alien --to-rpm debianpkg.deb
Explanation
Debian Linux generally uses .deb format packages and Redhat uses .rpm format packages. There is a command named alien used to convert .deb to
26.
You are compiling some software from source. After running ./configure with the appropriate arguments and no errors, what is the next command to run?
Correct Answer
./make
Explanation
The purpose of the make utility is to determine automatically which
pieces of a large program need to be recompiled, and issue the commands to recompile
them. example C programs, since they are most common, but you can use make with any
programming language whose compiler can be run with a shell command. In fact, make
is not limited to programs. You can use it to describe any task where some files must be
updated automatically from others whenever the others change.
To prepare to use make, you must write a file called the makefile that describes the
relationships among files in your program, and the states the commands for updating
each file. In a program, typically the executable file is updated from object files, which
are in turn
made by compiling source files.
27.
What file is read by the program ldconfig?
Correct Answer
A. /etc/ld.so.conf
Explanation
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). The cache is used by the run-time linker,
ld.so or ld-linux.so. ldconfig checks the header and file names of the libraries it
encounters when determining which versions should have their links updated.
Some files:
/lib/ld.so run-time linker/loader
/etc/ld.so.conf File containing a list of colon, space, tab, newline, or comma spearated
directories in which to search for libraries.
/etc/ld.so.cache File containing an ordered list of libraries found in the directories
specified in /etc/ld.so.conf.
28.
Type the command line including switches to convert and install a Redhat packagenamed package.rpm on a Debian system?
Correct Answer
alien -i package.rpm
alien --install package.rpm
Explanation
Redhat packages are in .rpm format and debian packages are in .deb
format. To convert or to install the .rpm packages on debian linux:
alien -i or --install package.rpm
29.
Which utility can you call to find out what shared libraries a program is using?
Explanation
ldd command prints the shared libraries required by each program or
shared library specified on the command line.
Example: ldd libdb.so.3
libc.so.6 => /lib/tls/libc.so.6 (0x00237000)
/lib/ld-linux.so.2 (0x0021e000)
30.
You are preparing a new set of shared libraries in /usr/local/applib and you havewritten and compiled some code that uses these libraries. You have alreadyperformed and ldconfig, however the system still cannot find the shared libraries.What is most likely the cause of this?
Correct Answer
A. You forgot to put the library path in ld.so.conf
Explanation
/etc/ld.so.conf File containing a list of colon, space, tab, newline, or comma
spearated directories in which to search for libraries. So you should specify the path the
libraries in /etc/ld.so.conf file.
31.
What is the name and full path to the location of the dpkg database?
Correct Answer
/var/lib/dpkg
Explanation
Local database is maintain in debian as well as in redhat. /var/lib/dpkg
is the local package database for debian linux and /var/lib/rpm for redhat.
32.
How can you list files owned by a specific .deb package?
Correct Answer
A. Dpkg -L package
Explanation
To list the files installed from a specified package, issue the command:
dpkg --listfiles package or dpkg -L package
33.
What command will uninstall a package but leave its configurationFiles in case a package is re-installed?
Correct Answer
A. Dpkg -r pkgname
Explanation
To remove an installed package, use the command
dpkg --remove package or dpkg -r packageThis command does not remove package
configuration files, which may facilitate subsequent re-installation of the package. If you
want to remove the configuration files as well, use the command:dpkg --purge package
34.
What would the command "rpm --allmatches rpmname" do?
Correct Answer
A. Remove all packages with the package name rpmname
Explanation
Remove all versions of the package which match PACKAGE_NAME
35.
What is a reasonable command to uninstall a Debian package from your system?
Correct Answer
A. Dpkg -r pkgname
Explanation
dpkg ?r | ??remove
Remove an installed package. ?r or ??remove remove everything except configuration
files. This may avoid having to reconfigure the package if it is reinstalled later.
36.
What is the difference between the -remove and the -purge action with the dpkgcommand?
Correct Answer
A. Remove removes the program, -purge also removes the config files
Explanation
-r or --remove remove everything except configuration files. This
may avoid having to reconfigure the package if it is reinstalled later. (Configuration
files are the files listed in the debian/conffiles control file). ?P or ??purge removes
everything, including configuration files. If -a or --pending is given instead of a package name, then all packages unpacked, but marked to be removed or purged in file /var/lib/dpkg/status, are removed or purged, respectively.
37.
What will happen when the following command is issued?rpm -Uvh file
Correct Answer
A. The installed package may be upgraded with the package called file, giving verbose output and hash marks to show installation
Explanation
This upgrades or installs the package currently installed to a newer
version. It checks either old version is installed or not, if installed then it will
upgrade to newer and install new if not installed.
38.
Type the command line that will list information, and all file locations on theinstalled package mypackage?
Correct Answer
rpm -qil mypackage
rpm -qli mypackage
Explanation
Some common options of rpm command
-i or --install à Install the New package
-U or --upgrade à Upgrade the Package
-e or --erase à Remove the package
-q or --query à Query the package
-qi à Query the information of package
-ql à Query and list all files belongs to package. Multiple options can be combined on single - and order can be different.
39.
Type the simplest command with switches to unpack a compressed archive namedfile1.tar.gz?
Correct Answer
tar -zxf file1.tar.gz
tar zxf file1.tar.gz
tar xzf file1.tar.gz
tar -xzf file1.tar.gz
Explanation
Generally files will archive using tar command. To archive tar cvf tarfilename.tar source files To extract from the tar archive file: tar xvf tarfilename.tar
In QUESTION showing the file archived as well as compressed using gzip command.
We can archive as well as compress at one time using:
tar -czfv tarfilename.cgz or first create the archive file and then compress using gzip or gzip2 command.
To extract :
tar -zxf filename
or
uncompress the file : gunzip compressedfile
extract from the tar. tar xvf tarfile.
40.
You want to add files to a previously created tar file. You want to replace existingfiles with newer files, how can you do this?
Correct Answer
A. Use the tar command with the -u switch
Explanation
To append the newer or updated files only on existing tar file either use the -u or --update option on tar command
Example: tar -u tarfilename.tar sourcefile
41.
Which TWO of the following commands allows you to manage .deb packages?
Correct Answer(s)
A. Dpkg
A. Dselect
Explanation
dselect - console Debian package handling frontend
dpkg - package manager for Debian
42.
You are about to install a new program on an RPM based Linux system.Which of the following would be the best way to accomplish this?
Correct Answer
A. Use rpm to install the program's binaries from an RPM package.
Explanation
rpm command is used to install, upgrade or uninstall the rpm format package.
43.
Which system administration command you can use to update ld.so.cache after theinstallation of new shared libraries?
Correct Answer
A. Ldconfig
Explanation
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). The cache is used by
the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and file names of
the libraries it encounters when determining which versions should have their links
updated.
44.
While installing an application from source code you don't see theconfigure script. What command can you run to compile the code?
Explanation
The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to
45.
What happens when ldconfig is executed?
Correct Answer
A. The binary index file (cache) of library locations is rebuilt
Explanation
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). The cache is used by
the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and file names of
the libraries it encounters when determining which versions should have their links
updated.
46.
What is the location including the full path to where apt-get stores its downloadedpackages?
Correct Answer
/var/cache/apt/archives
Explanation
atp-get command stores the downloaded packages on
/var/cache/atp/archives
47.
You need to know where all the configuration files for the installed package named"postfix" are located. Assuming it was installed with rpm, which command will list this information for you?
Correct Answer
A. Rpm -qc postfix
Explanation
To list the configuration files of installed package: rpm -qc or -q
--configfiles packagename. To list all belongs to installed package: rpm -ql or -q
--list packagename
48.
Which RPM command would produce the following outputName : xwhois Relocations: (not relocatable)Version : 0.3.7 Vendor: CertkillerRelease : 1 Build Data: Fri 06 Aug 1999 09:29:07 AM EDTInstall date: (not installed) Build Host:desktop.infohvy.comGroup : Application/Internet Source RPM: (none)Size : 74057 License: GPLPackager : Ryan Weaver URL : http://www.goatnet.ml.org/software.htmlSummary : X Windows Whois ToolDescription: xwhois is a small and fast query tool for thewhois service. (rfc954)xwhois-0.3.7.tar.gzxwhois.spec
Correct Answer
A. Rpm -qpil xwhois-0.3.7-1.src-rpm
Explanation
he output is information of xwhois package. To display the
information about the package, we use the -qi option.
49.
After a minor security incident you are instructed by your lead sys-admin to verifythe RPM's installed on running system. Which command will create a completereport which you can analyze for changes which may be security related?
Correct Answer
A. Rpm -Va>report
Explanation
Verifying a package compares information about the installed files in the package with information about the files taken from the package metadata
stored in the rpm database. Among other things, verifying compares the size, MD5
sum, permissions, type, owner and group of each file. Any discrepancies are
displayed.
To verify the package:
rpm -Va or -verify -a packagename