1 00:00:06,930 --> 00:00:11,520 - So we have just seen how some packages have dependencies, 2 00:00:11,520 --> 00:00:15,000 and these dependencies often relate to libraries. 3 00:00:15,000 --> 00:00:16,230 Now the thing in libraries 4 00:00:16,230 --> 00:00:19,830 is that common functionality is often provided by a library. 5 00:00:19,830 --> 00:00:21,660 And the nice thing about a library 6 00:00:21,660 --> 00:00:23,490 is that different software packages 7 00:00:23,490 --> 00:00:25,680 can use the same libraries. 8 00:00:25,680 --> 00:00:29,700 And that is how libraries make working with software easier. 9 00:00:29,700 --> 00:00:31,890 They provide common functionality 10 00:00:31,890 --> 00:00:33,903 that can be used by multiple packages, 11 00:00:34,980 --> 00:00:38,430 even if some of the libraries are very specific. 12 00:00:38,430 --> 00:00:40,743 But some other libraries are more generic. 13 00:00:41,970 --> 00:00:45,330 One of the most generic libraries is glibc, 14 00:00:45,330 --> 00:00:47,040 also known as libc. 15 00:00:47,040 --> 00:00:48,900 That's the C-library that provides 16 00:00:48,900 --> 00:00:52,500 all of the common functions in the Linux operating system. 17 00:00:52,500 --> 00:00:54,690 And when installing software packages, 18 00:00:54,690 --> 00:00:58,110 libraries normally are installed as dependencies, 19 00:00:58,110 --> 00:01:00,870 if they are not already present of course. 20 00:01:00,870 --> 00:01:03,213 Let me show you how these libraries are used. 21 00:01:05,460 --> 00:01:08,370 So I would like to show you a little bit about libraries. 22 00:01:08,370 --> 00:01:11,490 And libraries, in order to explore them, 23 00:01:11,490 --> 00:01:14,250 you need a full path name to an application. 24 00:01:14,250 --> 00:01:17,220 And ldd is the program that I want to use. 25 00:01:17,220 --> 00:01:20,653 So I'm using ldd on something we have not seen before, 26 00:01:20,653 --> 00:01:24,270 ${which passwd}. 27 00:01:24,270 --> 00:01:25,110 What is that? 28 00:01:25,110 --> 00:01:25,943 Well normally, 29 00:01:25,943 --> 00:01:28,080 ldd wants a path name. 30 00:01:28,080 --> 00:01:29,700 But here I'm using a solution 31 00:01:29,700 --> 00:01:32,043 that is creating the path name dynamically. 32 00:01:33,120 --> 00:01:37,920 The ${} are implementing what we call command substitution. 33 00:01:37,920 --> 00:01:39,990 So the command, which passwd, 34 00:01:39,990 --> 00:01:42,270 is executed, it generates its result, 35 00:01:42,270 --> 00:01:45,300 and ldd works on the result of the command, 36 00:01:45,300 --> 00:01:49,470 which is a very nice and frequently used method 37 00:01:49,470 --> 00:01:52,830 to provide content in a dynamic way. 38 00:01:52,830 --> 00:01:56,010 And there we can see all these different libraries. 39 00:01:56,010 --> 00:01:59,430 Now most of these libraries may not need too much, 40 00:01:59,430 --> 00:02:01,380 but I wanna pick out a couple of them, 41 00:02:01,380 --> 00:02:02,340 like libc. 42 00:02:02,340 --> 00:02:04,593 Libc is the generic C-library. 43 00:02:05,610 --> 00:02:07,860 The C-library contains the main functions 44 00:02:07,860 --> 00:02:10,380 of the Linux operating system. 45 00:02:10,380 --> 00:02:11,490 We have libpam, 46 00:02:11,490 --> 00:02:15,330 which is about pluggable authentication models. 47 00:02:15,330 --> 00:02:16,440 We have libcrypt, 48 00:02:16,440 --> 00:02:19,170 which is providing cryptography. 49 00:02:19,170 --> 00:02:21,300 You can imagine that in passwords, 50 00:02:21,300 --> 00:02:23,100 in password management, 51 00:02:23,100 --> 00:02:26,910 different solutions for cryptography may be implemented. 52 00:02:26,910 --> 00:02:30,210 And instead of putting that in the individual module, 53 00:02:30,210 --> 00:02:33,210 a generic library is used, libcrypt. 54 00:02:33,210 --> 00:02:35,160 And this libcrypt library can be used 55 00:02:35,160 --> 00:02:37,500 by many other software packages 56 00:02:37,500 --> 00:02:40,863 that need this cryptography functionality. 57 00:02:41,700 --> 00:02:42,870 And that is how libraries 58 00:02:42,870 --> 00:02:46,680 make working with Linux really much easier. 59 00:02:46,680 --> 00:02:48,330 Most of the libraries that are needed 60 00:02:48,330 --> 00:02:51,450 by the software packages are dynamically loaded. 61 00:02:51,450 --> 00:02:54,060 And you can use ldd, as you see here, 62 00:02:54,060 --> 00:02:55,680 to get an overview of libraries 63 00:02:55,680 --> 00:02:58,830 that are loaded by specific software packets. 64 00:02:58,830 --> 00:03:01,500 And that is providing insight in functionality 65 00:03:01,500 --> 00:03:04,500 that is provided by the software package. 66 00:03:04,500 --> 00:03:05,943 And that can be very useful.