Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

LPIC-1: Linux Professional Institute Certification

Study Guide 5th Edition (Exams 101 and 102),


Ancillary Exercises
Please see the LPIC-1: Linux Professional Institute
Certification Study Guide 5th Edition (Exams 101 and 102),
Ancillaries: Introduction and Syllabus for guidelines associated with
the following exercises.

Chapter 2: Managing Software and Processes

Ancillary Exercise 2.a: Managing shared libraries (Objective 102.3)

This exercise assumes you are using the Ubuntu distribution,


installed in ancillary exercise 1.b.
1. Press Ctrl+Alt+F2 and log in as an ordinary user.
2. Check if your user account has any locally-defined libraries by typing:
echo $LD_LIBRARY_PATH and press Enter. (If you receive no output and a
prompt back, that means there are no locally-defined libraries.)
3. Find the library dependencies for the ls command typing:
ldd /bin/ls and press Enter. Note the libraries required just to run the ls
command.
4. Find the included libraries for your system by typing:
cat /etc/ld.so.conf and press Enter.
You may see a list of one or more folders that are included using the
include command.
5. Use the ls command to display the list of files contained in any folders
included in the ld.so.conf file by typing:
ls -l /etc/ld.so.conf.d and pressing the Enter key
6. Display the contents of any files in the /etc/ld.so.conf.d folder
by using the cat command.

Ancillary Exercise 2.b: Use Debian package management (Objective 102.4)

This exercise assumes you are using the Ubuntu distribution.


1. This exercise requires a Debian-based Linux distribution, such as the Ubuntu
18.04 LTS Linux distribution.
2. Press Ctrl+Alt+F2 and log in as an ordinary user that can obtain super user
privileges with the sudo command.
3. List the installed Debian packages by typing:
sudo dpkg --get-selections and press Enter. You will need to enter your

LPIC-1: Linux Professional Institute Certification Study Guide 5th Edition (Exams 101 and 102), Ancillary Materials by
Richard Blum and Christine Bresnahan. Copyright 2019 SYBEX Inc. All Rights Reserved. http://www.sybex.com
password when prompted and press Enter.
4. Display information about the sudo package by typing:
sudo dpkg -p sudo and press Enter. You will need to enter your password
when prompted, and press Enter.
5. View all of the files associated with the sudo package by typing:
sudo dpkg -L sudo and press Enter. You will need to enter your password
when prompted and press Enter.
6. Install the tint game package using apt-get by typing:
sudo apt-get install tint and press Enter. You may need to enter your
password when prompted and press Enter.
7. Display status information about the tint game package by typing:
sudo dpkg -s tint and press Enter. You may need to enter your password
when prompted and press Enter.
8. Start the tint game by typing
tint and press Enter.
9. Remove the tint game from your system by typing:
sudo apt-get remove tint and press Enter. You may need to enter your
password when prompted and press Enter. Type Y and press Enter when
prompt, about continuing the removal process.

Ancillary Exercise 2.c: Use RPM and Yum package management (Objective
102.5)

This exercise assumes you are using the CentOS distribution,


installed in ancillary exercise 1.a.
1. This exercise requires a Red Hat-based Linux distribution, such as CentOS
7.0.
2. Press Ctrl+Alt+F2 and log in as the root user account.
3. List the installed packages by typing:
rpm -qa and press Enter.
4. Display information about the sudo package by typing:
rpm -qi sudo and press Enter.
5. View the dependencies for the sudo package by typing:
rpm -qR sudo and press Enter.
6. Check if there’s a newer version of the sudo package available using the
yum command by typing:
yum list sudo and press Enter.
7. Install the iotop disk I/O monitoring tool by typing:
yum install iotop and press Enter. Type Y and press Enter when asked if
this is okay.
8. Start the disk I/O monitoring tool by typing:
iotop and press Enter. Press the Q key, when you are doing using the utility.
9. Remove the disk I/O monitoring utility by typing:
yum remove iotop and press Enter. Type Y and press Enter when asked if
this is okay.

LPIC-1: Linux Professional Institute Certification Study Guide 5th Edition (Exams 101 and 102), Ancillary Materials by
Richard Blum and Christine Bresnahan. Copyright 2019 SYBEX Inc. All Rights Reserved. http://www.sybex.com
Ancillary Exercise 2.d: Create, monitor, and kill processes (Objective 103.5)

This exercise assumes you are using the CentOS distribution.


1. Press Ctrl+Alt+F3 and log in as an ordinary user account.
2. Check if your session has any background jobs running by typing:
jobs and press Enter. You should not see any jobs listed.
3. Start a job in background mode by typing:
sleep 1000 & and press Enter. This command will return a job number in
square brackets, and the process ID number. Write both values down.
4. Check if the job is running in background by typing:
jobs and press Enter. You should see the sleep command that you
entered running in background, and assigned job number 1.
5. Verify the process ID (PID) of the running sleep command by typing:
ps -ax | grep sleep and press Enter. Note the number under the PID column
and write it down. It will match the value returned when you started the job in
step 3.
6. Bring the running job back to the foreground by typing:
fg 1 and press Enter. The sleep command should now be running on your
console, waiting for the specified 1000 seconds to expire.
7. Suspend the running sleep command and place it into background mode
by pressing: Ctrl+Z
8. Monitor the background job by typing:
jobs and press Enter. You will see the sleep command in background,
but the job status should show that it is stopped.
9. Restart the sleep command job in background mode by typing:
bg and press Enter.
10. Check on the job by typing:
jobs and press Enter. You will now see the status of the sleep command
as Running.
11. Kill the running background job by typing:
kill -9 PID and press Enter (where PID is the process ID of the sleep
command you noted in step 3.
12. Make sure the sleep command is not running by typing:
ps -ax | grep sleep and press Enter.

Ancillary Exercise 2.e: Modify process execution priorities (Objective 103.6)

This exercise assumes you are using the CentOS distribution.


1. If you are not already logged in, press Ctrl+Alt+F3 and log in as an ordinary
user account.
2. Check if your session has any background jobs running by typing:
jobs and press Enter. You should not see any jobs listed.
3. Start a job in background mode with a priority of 19 by typing:
nice -19 sleep 1000 & and press Enter.
4. Find the process ID (PID) and nice number of the running sleep command by
typing:
ps -al | grep sleep and press Enter. Note the nice number (the eighth
column) and the PID number (the third column) of the sleep command

LPIC-1: Linux Professional Institute Certification Study Guide 5th Edition (Exams 101 and 102), Ancillary Materials by
Richard Blum and Christine Bresnahan. Copyright 2019 SYBEX Inc. All Rights Reserved. http://www.sybex.com
and write them down.
5. Attempt to change the job priority to a higher priority of 18 by typing:
renice -18 PID and press Enter, where PID is the process ID number you
noted in step 4. You will receive a permissions denied error message
indicating that you don’t have permissions to change the priority of this job
6. Attempt to change the job priority to a priority of 18, but as the root user
account by typing:
sudo renice 18 PID and press Enter, where PID is the process ID number
you noted in step 4. You will need to enter the password of the root user
account when prompted.
7. View the new nice number of the running sleep command by typing:
ps -al | grep sleep and press Enter. You will see the sleep command
now has a nice value of 18.
8. Change the job priority to a lower priority of 19 as your ordinary user account
by typing:
renice 19 PID and press Enter, where PID is the process ID number you
noted in step 4. The system allows you to lower the priority of the job as an
ordinary user account.
9. View the new nice number of the running sleep command by typing:
ps -al | grep sleep and press Enter. You will now see the nice number of the
sleep command as 19.
10. Kill the running sleep command by typing:
kill -9 PID and press Enter (where PID is the process ID of the sleep
command you noted in step 4.
11. Make sure the sleep command is not running by typing:
ps -ax | grep sleep and press Enter.

LPIC-1: Linux Professional Institute Certification Study Guide 5th Edition (Exams 101 and 102), Ancillary Materials by
Richard Blum and Christine Bresnahan. Copyright 2019 SYBEX Inc. All Rights Reserved. http://www.sybex.com

You might also like