Manage Shared Libraries (1) Flashcards

Objective 102.3 Weight 1

1
Q

Which of the following commands will check if the library lib123.so.1 is currently in the library cache?

  1. ldd library lib123.so.1
  2. ldd -p lib123.so.1
  3. ldd -p | grep lib123.so.1
  4. ldconfig -vN lib123.so.1
  5. ldconfig -p lib123.so.1
  6. ldconfig -p | grep lib123.so.1
A
  1. ldconfig -p | grep lib123.so.1

The ldconfig -p | grep lib123.so.1 command will check if the library lib123.so.1 is currently in the library cache. The ldconfig -p portion of the command prints out the library cache information, including the libraries in the cache. The STDOUT from this command is piped into the grep utility so it can search for the lib123.so.1 library, and if the library is displayed, it IS in the cache.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following will let you view the current library cache?
ldconfig
ldconfig –list
Correct selection
ldconfig -p
ldconfig -i
ldconfig -v
Correct selection
ldconfig -vN
Overall explanation
The ldconfig -vN command will let you view the current library cache. The -v option is to make the output verbose, and the -N option tells the ldconfig command not to rebuild the library cache. Also the ldconfig -p command prints out library cache information.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following commands will properly update the library path environment variable?

  1. LIBRARY_PATH=$LIBRARY_PATH:newLibDir
  2. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:newLibDir
  3. export LIBRARY_PATH=$LIBRARY_PATH:newLibDir
  4. PATH=$PATH:newLibDir
  5. export PATH=$PATH:newLibDir
    Your answer is incorrect
  6. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:newLibDir
A
  1. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:newLibDir

The export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:newLibDir command will properly update the library path environment variable, which is LD_LIBRARY_PATH.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is true concerning a library cache?

  1. It is a list of the various library directories/libraries
  2. It is used for quickly installing programs
  3. It cannot be viewed
  4. It can be updated
  5. It is automatically updated by package managers when you install packages
  6. It often needs to be updated when developing a new app
A
  1. It is a list of the various library directories/libraries
  2. It is used for quickly installing programs
  3. It is automatically updated by package managers when you install packages
    AND
  4. It often needs to be updated when developing a new app

The library cache is used for quickly loading programs, and not installing them. And the library cache can be viewed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following is a typical location for a library file?

  1. Files in the /lib directory tree
  2. Files in the /lib64 directory tree
  3. Files in the /usr/lib directory tree
  4. Files in the /usr/bin directory tree
  5. Files in the /etc directory tree
  6. Files in the /usr/var directory tree
A
  1. Files in the /lib directory tree
  2. Files in the /lib64 directory tree
    AND
  3. Files in the /usr/lib directory tree

The /lib, /lib64, and /usr/lib directory trees are all typical locations for a library file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly