مدیریت بسته های نرم افزاری در لینوکس با استفاده از YUM

در این پست می خواهیم نحوه مدیریت بسته های نرم افزاری در لینوکس را برای شما کاربران عزیز آموزش دهیم . امیدواریم مقاله مدیریت بسته های نرم افزاری در لینوکس با استفاده از YUM برای شما نیز مفید و کاربردی باشد. با ما همراه باشید.

YUM

YUM

در این مقاله می آموزیم که چطور از ابزار YUM گسترش یافته توسـط  Red Hat  برای نصب ، آپدیـت ، پاک ، جستجو، و مدیریت نرم افزار بهره گیری کنیم . یام (Yellowdog Updater Modified) که به اختصار به آن YUM گفته می شود یک خط فرمان متن باز و ابزاری برای مدیریت بسته گرافیکـی مبتنی بر RPM (red hat package manager) در سیستم عامل لینوکس است و به کاربران و مدیران سیستم اجازه خواهـد داد که به آسانـی بسته نرم افزاری در سیستم را نصب، ایجاد رسانی، پاک و یا پیدا کردن کنند. این ابزار متن باز گسترش یافته توسـط Seth Vidal حاوی جواز GPL (General Public License) می باشد.

 

YUM

YUM

مدیریت بسته های نرم افزاری در لینوکس

۱٫ نصب بسته نرم افزاری با بهره گیری از YUM

برای نصب یک بسته گیت git تنها دستور پایین را اجرا نمایید تا بطور اتوماتیک همـه پکیج های وابسته به git پیدا و نصب شود.

[root@devops ~]# yum install git Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.grandcloud.cn * extras: mirrors.grandcloud.cn * بروزرسانی s: mirrors.grandcloud.cn Setting up Install Process Resolving Dependencies –> Running transaction check —> Package git.x86_64 0:1.7.1-3.el6_4.1 will be installed –> Processing Dependency: perl-Git = 1.7.1-3.el6_4.1 for package: git-1.7.1-3.el6_4.1.x86_64 –> Processing Dependency: rsync for package: git-1.7.1-3.el6_4.1.x86_64 –> Processing Dependency: perl(Git) for package: git-1.7.1-3.el6_4.1.x86_64 –> Processing Dependency: perl(Error) for package: git-1.7.1-3.el6_4.1.x86_64 –> Running transaction check —> Package perl-Error.noarch 1:0.17015-4.el6 will be installed —> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be installed —> Package rsync.x86_64 0:3.0.6-9.el6_4.1 will be installed –> Finished Dependency Resolution Dependencies Resolved ========================================================================================================== Package Arch Version Repository Size ========================================================================================================== Installing: git x86_64 1.7.1-3.el6_4.1 base 4.6 M Installing for dependencies: perl-Error noarch 1:0.17015-4.el6 base 29 k perl-Git noarch 1.7.1-3.el6_4.1 base 28 k rsync x86_64 3.0.6-9.el6_4.1 base 334 k Transaction Summary ========================================================================================================== Install 4 Package(s) Total download size: 5.0 M Installed size: 15 M Is this ok [y/N]: y Downloading Packages: (1/4): git-1.7.1-3.el6_4.1.x86_64.rpm | 4.6 MB 00:03 (2/4): perl-Error-0.17015-4.el6.noarch.rpm | 29 kB 00:00 (3/4): perl-Git-1.7.1-3.el6_4.1.noarch.rpm | 28 kB 00:00 (4/4): rsync-3.0.6-9.el6_4.1.x86_64.rpm | 334 kB 00:00 ———————————————————————————————————- Total 1.1 MB/s | 5.0 MB 00:04 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 1:perl-Error-0.17015-4.el6.noarch 1/4 Installing : rsync-3.0.6-9.el6_4.1.x86_64 2/4 Installing : perl-Git-1.7.1-3.el6_4.1.noarch 3/4 Installing : git-1.7.1-3.el6_4.1.x86_64 4/4 Verifying : rsync-3.0.6-9.el6_4.1.x86_64 1/4 Verifying : git-1.7.1-3.el6_4.1.x86_64 2/4 Verifying : perl-Git-1.7.1-3.el6_4.1.noarch 3/4 Verifying : 1:perl-Error-0.17015-4.el6.noarch 4/4 Installed: git.x86_64 0:1.7.1-3.el6_4.1 Dependency Installed: perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-3.el6_4.1 rsync.x86_64 0:3.0.6-9.el6_4.1 Complete! [root@devops ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

[root@devops ~]# yum install git

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.grandcloud.cn

* extras: mirrors.grandcloud.cn

* بروزرسانی s: mirrors.grandcloud.cn

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package git.x86_64 0:1.7.1-3.el6_4.1 will be installed

–> Processing Dependency: perl-Git = 1.7.1-3.el6_4.1 for package: git-1.7.1-3.el6_4.1.x86_64

–> Processing Dependency: rsync for package: git-1.7.1-3.el6_4.1.x86_64

–> Processing Dependency: perl(Git) for package: git-1.7.1-3.el6_4.1.x86_64

–> Processing Dependency: perl(Error) for package: git-1.7.1-3.el6_4.1.x86_64

–> Running transaction check

—> Package perl-Error.noarch 1:0.17015-4.el6 will be installed

—> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be installed

—> Package rsync.x86_64 0:3.0.6-9.el6_4.1 will be installed

–> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================

Package Arch Version Repository Size

==========================================================================================================

Installing:

git x86_64 1.7.1-3.el6_4.1 base 4.6 M

Installing for dependencies:

perl-Error noarch 1:0.17015-4.el6 base 29 k

perl-Git noarch 1.7.1-3.el6_4.1 base 28 k

rsync x86_64 3.0.6-9.el6_4.1 base 334 k

Transaction Summary

==========================================================================================================

Install 4 Package(s)

Total download size: 5.0 M

Installed size: 15 M

Is this ok [y/N]: y

Downloading Packages:

(1/4): git-1.7.1-3.el6_4.1.x86_64.rpm | 4.6 MB 00:03

(2/4): perl-Error-0.17015-4.el6.noarch.rpm | 29 kB 00:00

(3/4): perl-Git-1.7.1-3.el6_4.1.noarch.rpm | 28 kB 00:00

(4/4): rsync-3.0.6-9.el6_4.1.x86_64.rpm | 334 kB 00:00

———————————————————————————————————-

Total 1.1 MB/s | 5.0 MB 00:04

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : 1:perl-Error-0.17015-4.el6.noarch 1/4

Installing : rsync-3.0.6-9.el6_4.1.x86_64 2/4

Installing : perl-Git-1.7.1-3.el6_4.1.noarch 3/4

Installing : git-1.7.1-3.el6_4.1.x86_64 4/4

Verifying : rsync-3.0.6-9.el6_4.1.x86_64 1/4

Verifying : git-1.7.1-3.el6_4.1.x86_64 2/4

Verifying : perl-Git-1.7.1-3.el6_4.1.noarch 3/4

Verifying : 1:perl-Error-0.17015-4.el6.noarch 4/4

Installed:

git.x86_64 0:1.7.1-3.el6_4.1

Dependency Installed:

perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-3.el6_4.1 rsync.x86_64 0:3.0.6-9.el6_4.1

Complete!

[root@devops ~]#

دستور فوق به اثبات نیازخواهد داشت، پـس از آن بسته نرم افزار بر روی سیستم شما نصب می شود . چنان چه برای نصب نرم افزار بطور اتوماتیک هیچ تائیدیه ای از شما خواسته نشد ، همان گونه که در مثال پایین نشان داده شده است خواهید توانست از مورد y- بهره گیری نمایید .

[root@devops ~]# yum -y install gcc

1[root@devops ~]# yum -y install gcc

۲٫ پاک بسته های نرم افزاری با بهره گیری از YUM

اگر می خواهید بسته را با همـه وابستگیهای آن بطور تکمیل پاک نمایید ، تنها می بایست دستور پایین را اجرا نمایید :

[root@devops ~]# yum remove git Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies –> Running transaction check —> Package git.x86_64 0:1.7.1-3.el6_4.1 will be erased –> Processing Dependency: git = 1.7.1-3.el6_4.1 for package: perl-Git-1.7.1-3.el6_4.1.noarch –> Running transaction check —> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be erased –> Finished Dependency Resolution Dependencies Resolved ========================================================================================================== Package Arch Version Repository Size ========================================================================================================== Removing: git x86_64 1.7.1-3.el6_4.1 @base 15 M Removing for dependencies: perl-Git noarch 1.7.1-3.el6_4.1 @base 35 k Transaction Summary ========================================================================================================== Remove 2 Package(s) Installed size: 15 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Erasing : perl-Git-1.7.1-3.el6_4.1.noarch 1/2 Erasing : git-1.7.1-3.el6_4.1.x86_64 2/2 Verifying : git-1.7.1-3.el6_4.1.x86_64 1/2 Verifying : perl-Git-1.7.1-3.el6_4.1.noarch 2/2 Removed: git.x86_64 0:1.7.1-3.el6_4.1 Dependency Removed: perl-Git.noarch 0:1.7.1-3.el6_4.1 Complete! [root@devops ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

[root@devops ~]# yum remove git

Loaded plugins: fastestmirror

Setting up Remove Process

Resolving Dependencies

–> Running transaction check

—> Package git.x86_64 0:1.7.1-3.el6_4.1 will be erased

–> Processing Dependency: git = 1.7.1-3.el6_4.1 for package: perl-Git-1.7.1-3.el6_4.1.noarch

–> Running transaction check

—> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be erased

–> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================

Package Arch Version Repository Size

==========================================================================================================

Removing:

git x86_64 1.7.1-3.el6_4.1 @base 15 M

Removing for dependencies:

perl-Git noarch 1.7.1-3.el6_4.1 @base 35 k

Transaction Summary

==========================================================================================================

Remove 2 Package(s)

Installed size: 15 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Erasing : perl-Git-1.7.1-3.el6_4.1.noarch 1/2

Erasing : git-1.7.1-3.el6_4.1.x86_64 2/2

Verifying : git-1.7.1-3.el6_4.1.x86_64 1/2

Verifying : perl-Git-1.7.1-3.el6_4.1.noarch 2/2

Removed:

git.x86_64 0:1.7.1-3.el6_4.1

Dependency Removed:

perl-Git.noarch 0:1.7.1-3.el6_4.1

Complete!

[root@devops ~]#

۳٫ به روز رسانی بسته های نرم افزاری با بهره گیری از YUM

فرض نمایید که میخواهید بسته نرم افزار GCC خود را به آخرین ورژن پایدار آپدیـت نمایید . برای اینکار تنها می بایست فرمان پایین را اجرا نمایید ، تا بطور اتوماتیک همـه پکیج های وابسته را آپدیـت و نصب نماید .

[root@devops ~]# yum بروزرسانی gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.grandcloud.cn * extras: mirrors.grandcloud.cn * بروزرسانی s: mirrors.grandcloud.cn Setting up Update Process Resolving Dependencies –> Running transaction check —> Package gcc.x86_64 0:4.4.7-3.el6 will be بروزرسانی d –> Processing Dependency: gcc = 4.4.7-3.el6 for package: gcc-c++-4.4.7-3.el6.x86_64 —> Package gcc.x86_64 0:4.4.7-4.el6 will be an بروزرسانی –> Processing Dependency: libgomp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64 –> Processing Dependency: cpp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64 –> Processing Dependency: libgcc >= 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64 –> Running transaction check —> Package cpp.x86_64 0:4.4.7-3.el6 will be بروزرسانی d —> Package cpp.x86_64 0:4.4.7-4.el6 will be an بروزرسانی —> Package gcc-c++.x86_64 0:4.4.7-3.el6 will be بروزرسانی d —> Package gcc-c++.x86_64 0:4.4.7-4.el6 will be an بروزرسانی –> Processing Dependency: libstdc++-devel = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64 –> Processing Dependency: libstdc++ = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64 —> Package libgcc.x86_64 0:4.4.7-3.el6 will be بروزرسانی d —> Package libgcc.x86_64 0:4.4.7-4.el6 will be an بروزرسانی —> Package libgomp.x86_64 0:4.4.7-3.el6 will be بروزرسانی d —> Package libgomp.x86_64 0:4.4.7-4.el6 will be an بروزرسانی –> Running transaction check —> Package libstdc++.x86_64 0:4.4.7-3.el6 will be بروزرسانی d —> Package libstdc++.x86_64 0:4.4.7-4.el6 will be an بروزرسانی —> Package libstdc++-devel.x86_64 0:4.4.7-3.el6 will be بروزرسانی d —> Package libstdc++-devel.x86_64 0:4.4.7-4.el6 will be an بروزرسانی –> Finished Dependency Resolution Dependencies Resolved ========================================================================================================== Package Arch Version Repository Size ========================================================================================================== Updating: gcc x86_64 4.4.7-4.el6 base 10 M Updating for dependencies: cpp x86_64 4.4.7-4.el6 base 3.7 M gcc-c++ x86_64 4.4.7-4.el6 base 4.7 M libgcc x86_64 4.4.7-4.el6 base 101 k libgomp x86_64 4.4.7-4.el6 base 118 k libstdc++ x86_64 4.4.7-4.el6 base 293 k libstdc++-devel x86_64 4.4.7-4.el6 base 1.6 M Transaction Summary ========================================================================================================== Upgrade 7 Package(s) Total download size: 21 M Is this ok [y/N]:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

[root@devops ~]# yum بروزرسانی gcc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.grandcloud.cn

* extras: mirrors.grandcloud.cn

* بروزرسانی s: mirrors.grandcloud.cn

Setting up Update Process

Resolving Dependencies

–> Running transaction check

—> Package gcc.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

–> Processing Dependency: gcc = 4.4.7-3.el6 for package: gcc-c++-4.4.7-3.el6.x86_64

—> Package gcc.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

–> Processing Dependency: libgomp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64

–> Processing Dependency: cpp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64

–> Processing Dependency: libgcc >= 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64

–> Running transaction check

—> Package cpp.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

—> Package cpp.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

—> Package gcc-c++.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

—> Package gcc-c++.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

–> Processing Dependency: libstdc++-devel = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64

–> Processing Dependency: libstdc++ = 4.4.7-4.el6 for package: gcc-c++-4.4.7-4.el6.x86_64

—> Package libgcc.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

—> Package libgcc.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

—> Package libgomp.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

—> Package libgomp.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

–> Running transaction check

—> Package libstdc++.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

—> Package libstdc++.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

—> Package libstdc++-devel.x86_64 0:4.4.7-3.el6 will be بروزرسانی d

—> Package libstdc++-devel.x86_64 0:4.4.7-4.el6 will be an بروزرسانی

–> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================

Package Arch Version Repository Size

==========================================================================================================

Updating:

gcc x86_64 4.4.7-4.el6 base 10 M

Updating for dependencies:

cpp x86_64 4.4.7-4.el6 base 3.7 M

gcc-c++ x86_64 4.4.7-4.el6 base 4.7 M

libgcc x86_64 4.4.7-4.el6 base 101 k

libgomp x86_64 4.4.7-4.el6 base 118 k

libstdc++ x86_64 4.4.7-4.el6 base 293 k

libstdc++-devel x86_64 4.4.7-4.el6 base 1.6 M

Transaction Summary

==========================================================================================================

Upgrade 7 Package(s)

Total download size: 21 M

Is this ok [y/N]:

۴٫لیست کردن بسته نرم افزاری نصب شده با بهره گیری از YUM

با بهره گیری از تابع list، خواهید توانست یک نرم افزار ویـژه را با نام آن بسته پیدا کردن نمایید . به عنوان مثال، برای پیدا کردن بسته gcc  از دستور پایین بهره گیری نمایید :

[root@devops ~]# yum list gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.grandcloud.cn * extras: mirrors.grandcloud.cn * بروزرسانی s: mirrors.grandcloud.cn base | 3.7 kB 00:00 extras | 3.4 kB 00:00 بروزرسانی s | 3.4 kB 00:00 بروزرسانی s/primary_db | 2.1 MB 00:06 Installed Packages gcc.x86_64 4.4.7-3.el6 @base Available Packages gcc.x86_64 4.4.7-4.el6 base [root@devops ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

[root@devops ~]# yum list gcc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.grandcloud.cn

* extras: mirrors.grandcloud.cn

* بروزرسانی s: mirrors.grandcloud.cn

base                                                                                                         | 3.7 kB     00:00

extras                                                                                                       | 3.4 kB     00:00

بروزرسانی s                                                                                                      | 3.4 kB     00:00

بروزرسانی s/primary_db                                                                                           | 2.1 MB     00:06

Installed Packages

gcc.x86_64                                                     4.4.7-3.el6                                                     @base

Available Packages

gcc.x86_64                                                     4.4.7-4.el6                                                     base

[root@devops ~]#

۵٫ بازبینی چ تاریخ بهره گیری از YUM

برای مشاهده تاریخ بهره گیری از دستور یام تا پیش از انجام دستور پایین :

[root@devops ~]# yum history Loaded plugins: fastestmirror ID | Login user | Date and time | Action(s) | Altered ——————————————————————————- 8 | root | 2014-03-04 22:24 | Erase | 2 7 | root | 2014-03-04 22:22 | Install | 4 6 | root | 2014-02-27 18:16 | Install | 2 5 | root | 2014-01-07 10:53 | Install | 1 4 | root | 2013-07-31 17:58 | I, U | 52 3 | root | 2013-07-31 17:58 | Install | 1 2 | root | 2013-07-31 17:53 | Install | 1 1 | System | 2012-12-17 09:06 | Install | 218 history list [root@devops ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

[root@devops ~]# yum history

Loaded plugins: fastestmirror

ID     | Login user               | Date and time    | Action(s)      | Altered

——————————————————————————-

8 | root               | 2014-03-04 22:24 | Erase          |    2

7 | root               | 2014-03-04 22:22 | Install        |    4

6 | root               | 2014-02-27 18:16 | Install        |    2

5 | root               | 2014-01-07 10:53 | Install        |    1

4 | root               | 2013-07-31 17:58 | I, U           |   52

3 | root               | 2013-07-31 17:58 | Install        |    1

2 | root               | 2013-07-31 17:53 | Install        |    1

1 | System            | 2012-12-17 09:06 | Install        |  218

history list

[root@devops ~]#

۶٫ پاک کردن کش YUM

YUM بطور پیش فرض، همـه داده های کتابخانه نرم افزار libiray sotware را در /var/cache/yum/ ذخیره می کند ، چنان چه می خواهید همـه فایل ذخیره شده را پاک نمایید ، می بایست به شیوه عصری ای دستور پایین را اجرا نمایید :

[root@devops ~]# yum clean all Loaded plugins: fastestmirror Cleaning repos: base extras بروزرسانی s Cleaning up Everything Cleaning up list of fastest mirrors [root@devops ~]#

1

2

3

4

5

6

[root@devops ~]# yum clean all

Loaded plugins: fastestmirror

Cleaning repos: base extras بروزرسانی s

Cleaning up Everything

Cleaning up list of fastest mirrors

[root@devops ~]#

۷٫ بروزرسـانی سیستم لینوکس با بهره گیری از دستور yum بروزرسانی

اگر می خواهید سیستم خود را با همـه بسته های باینری و امنیتی ایجاد نگهدارید، دستور پایین را اجرا نمایید .

[root@devops ~]# yum بروزرسانی Loaded plugins: fastestmirror Determining fastest mirrors * base: mirrors.163.com * extras: mirrors.163.com * بروزرسانی s: mirrors.163.com base | 3.7 kB 00:00 base/primary_db | 4.4 MB 00:04 extras | 3.4 kB 00:00 extras/primary_db | 19 kB 00:00 بروزرسانی s | 3.4 kB 00:00 بروزرسانی s/primary_db | 2.1 MB 00:01 Setting up Update Process Resolving Dependencies –> Running transaction check —> Package authconfig.x86_64 0:6.1.12-10.el6 will be بروزرسانی d —> Package authconfig.x86_64 0:6.1.12-13.el6 will be an بروزرسانی —> Package bash.x86_64 0:4.1.2-9.el6_2 will be بروزرسانی d —> Package bash.x86_64 0:4.1.2-15.el6_4 will be an بروزرسانی —> Package bfa-firmware.noarch 0:3.0.0.0-1.el6 will be بروزرسانی d … Total download size: 134 M Is this ok [y/N]: n

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

[root@devops ~]# yum بروزرسانی

Loaded plugins: fastestmirror

Determining fastest mirrors

* base: mirrors.163.com

* extras: mirrors.163.com

* بروزرسانی s: mirrors.163.com

base                                                                                                         | 3.7 kB     00:00

base/primary_db                                                                                              | 4.4 MB     00:04

extras                                                                                                       | 3.4 kB     00:00

extras/primary_db                                                                                            |  19 kB     00:00

بروزرسانی s                                                                                                      | 3.4 kB     00:00

بروزرسانی s/primary_db                                                                                           | 2.1 MB     00:01

Setting up Update Process

Resolving Dependencies

–> Running transaction check

—> Package authconfig.x86_64 0:6.1.12-10.el6 will be بروزرسانی d

—> Package authconfig.x86_64 0:6.1.12-13.el6 will be an بروزرسانی

—> Package bash.x86_64 0:4.1.2-9.el6_2 will be بروزرسانی d

—> Package bash.x86_64 0:4.1.2-15.el6_4 will be an بروزرسانی

—> Package bfa-firmware.noarch 0:3.0.0.0-1.el6 will be بروزرسانی d

Total download size: 134 M

Is this ok [y/N]: n

۸٫ پیدا کردن پکیج با  بهره گیری از دستور YUM

چنان چه که شما نام دقیق پکیج را به یاد داشته باشید، خواهید توانست با بهره گیری از تابع search تمام پکیج های موجود که با نام مورد نظـر شما مطابقت دارند را پیدا نمایید . به عنوان مثال، برای پیدا کردن یک بسته نرم افزار کلمه ”  GCC” را در تابع  search قرار دهید:

[root@devops ~]# yum search gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * بروزرسانی s: mirrors.163.com ========================================================= N/S Matched: gcc ========================================================= gcc-c++.x86_64 : C++ support for GCC gcc-gnat.x86_64 : Ada 95 support for GCC gcc-java.x86_64 : Java support for GCC gcc-objc.x86_64 : Objective-C support for GCC gcc-objc++.x86_64 : Objective-C++ support for GCC libgcc.x86_64 : GCC version 4.4 shared support library mingw32-gcc.x86_64 : MinGW Windows cross-compiler (GCC) for C compat-gcc-34.x86_64 : Compatibility GNU Compiler Collection compat-gcc-34-c++.x86_64 : C++ support for compatibility compiler compat-gcc-34-g77.x86_64 : Fortran 77 support for compatibility compiler gcc.x86_64 : Various compilers (C, C++, Objective-C, Java, …) gcc-gfortran.x86_64 : Fortran support libgcj.x86_64 : Java runtime library for gcc libgcj-devel.x86_64 : Libraries for Java development using GCC libgcj-src.x86_64 : Java library sources from GCC4 preview libgomp.x86_64 : GCC OpenMP v3.0 shared support library libmudflap.x86_64 : GCC mudflap shared support library libmudflap-devel.x86_64 : GCC mudflap support mingw32-gcc-c++.x86_64 : MinGW Windows cross-compiler for C++ mingw32-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN mingw32-gcc-objc.x86_64 : MinGW Windows cross-compiler support for Objective C mingw32-gcc-objc++.x86_64 : MinGW Windows cross-compiler support for Objective C++ Name and summary matches only, use “search all” for everything. [root@devops ~]#

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

[root@devops ~]# yum search  gcc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.163.com

* extras: mirrors.163.com

* بروزرسانی s: mirrors.163.com

========================================================= N/S Matched: gcc =========================================================

gcc-c++.x86_64 : C++ support for GCC

gcc-gnat.x86_64 : Ada 95 support for GCC

gcc-java.x86_64 : Java support for GCC

gcc-objc.x86_64 : Objective-C support for GCC

gcc-objc++.x86_64 : Objective-C++ support for GCC

libgcc.x86_64 : GCC version 4.4 shared support library

mingw32-gcc.x86_64 : MinGW Windows cross-compiler (GCC) for C

compat-gcc-34.x86_64 : Compatibility GNU Compiler Collection

compat-gcc-34-c++.x86_64 : C++ support for compatibility compiler

compat-gcc-34-g77.x86_64 : Fortran 77 support for compatibility compiler

gcc.x86_64 : Various compilers (C, C++, Objective-C, Java, …)

gcc-gfortran.x86_64 : Fortran support

libgcj.x86_64 : Java runtime library for gcc

libgcj-devel.x86_64 : Libraries for Java development using GCC

libgcj-src.x86_64 : Java library sources from GCC4 preview

libgomp.x86_64 : GCC OpenMP v3.0 shared support library

libmudflap.x86_64 : GCC mudflap shared support library

libmudflap-devel.x86_64 : GCC mudflap support

mingw32-gcc-c++.x86_64 : MinGW Windows cross-compiler for C++

mingw32-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN

mingw32-gcc-objc.x86_64 : MinGW Windows cross-compiler support for Objective C

mingw32-gcc-objc++.x86_64 : MinGW Windows cross-compiler support for Objective C++

Name and summary matches only, use “search all” for everything.

[root@devops ~]#

۹٫ اخذ اطلاعات بسته نرم افزاری با بهره گیری از دستور YUM

برای اخذ بعضـی اطلاعات دربـاره بسته، تنها فرمان پایین را اجرا نمایید :

[root@devops ~]# yum info gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * بروزرسانی s: mirrors.163.com Installed Packages Name : gcc Arch : x86_64 Version : 4.4.7 Release : 3.el6 Size : 19 M Repo : installed From repo : base Summary : Various compilers (C, C++, Objective-C, Java, …) URL : http://gcc.gnu.org License : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions Description : The gcc package contains the GNU Compiler Collection version 4.4. : You’ll need this package in order to compile C code. Available Packages Name : gcc Arch : x86_64 Version : 4.4.7 Release : 4.el6 Size : 10 M Repo : base Summary : Various compilers (C, C++, Objective-C, Java, …) URL : http://gcc.gnu.org License : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions Description : The gcc package contains the GNU Compiler Collection version 4.4. : You’ll need this package in order to compile C code.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

[root@devops ~]# yum info gcc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.163.com

* extras: mirrors.163.com

* بروزرسانی s: mirrors.163.com

Installed Packages

Name        : gcc

Arch        : x86_64

Version     : 4.4.7

Release     : 3.el6

Size        : 19 M

Repo        : installed

From repo   : base

Summary     : Various compilers (C, C++, Objective-C, Java, …)

URL         : http://gcc.gnu.org

License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions

Description : The gcc package contains the GNU Compiler Collection version 4.4.

: You’ll need this package in order to compile C code.

Available Packages

Name        : gcc

Arch        : x86_64

Version     : 4.4.7

Release     : 4.el6

Size        : 10 M

Repo        : base

Summary     : Various compilers (C, C++, Objective-C, Java, …)

URL         : http://gcc.gnu.org

License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions

Description : The gcc package contains the GNU Compiler Collection version 4.4.

: You’ll need this package in order to compile C code.

۱۰ – فهرست کردن همـه بسته های موجود در دیتابیس یام با بهره گیری از دستور YUM list

اگر میخواهید همـه پکیج های موجود در دیتابیس YUM را لیست نمایید دستور پایین را اجرا نمایید :

[root@devops ~]# yum list | more Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * بروزرسانی s: mirrors.163.com Installed Packages MAKEDEV.x86_64 3.24-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 acl.x86_64 2.2.49-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 aic94xx-firmware.noarch 30-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 atmel-firmware.noarch 1.3-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 attr.x86_64 2.4.44-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit-libs.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 authconfig.x86_64 6.1.12-10.el6 @anaconda-CentOS-201207061011.x86_64/6.3 autoconf.noarch 2.63-5.1.el6 @base automake.noarch 1.11.1-4.el6 @base b43-openfwwf.noarch 5.2-4.el6 @anaconda-CentOS-201207061011.x86_64/6.3 basesystem.noarch 10.0-4.el6 @anaconda-CentOS-201207061011.x86_64/6.3 bash.x86_64 4.1.2-9.el6_2 @anaconda-CentOS-201207061011.x86_64/6.3 bfa-firmware.noarch 3.0.0.0-1.el6 @an 11. List all installed packages using YUM command List all installed packages to, just execute the following command, it will show all of the installed packages. [root@devops ~]# yum list installed | more Loaded plugins: fastestmirror Installed Packages MAKEDEV.x86_64 3.24-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 acl.x86_64 2.2.49-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 aic94xx-firmware.noarch 30-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 atmel-firmware.noarch 1.3-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 attr.x86_64 2.4.44-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit-libs.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 authconfig.x86_64 6.1.12-10.el6 @anaconda-CentOS-201207061011.x86_64/6.3 …

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

[root@devops ~]# yum list | more

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.163.com

* extras: mirrors.163.com

* بروزرسانی s: mirrors.163.com

Installed Packages

MAKEDEV.x86_64                            3.24-6.el6                    @anaconda-CentOS-201207061011.x86_64/6.3

acl.x86_64                                2.2.49-6.el6                  @anaconda-CentOS-201207061011.x86_64/6.3

aic94xx-firmware.noarch                   30-2.el6                      @anaconda-CentOS-201207061011.x86_64/6.3

atmel-firmware.noarch                     1.3-7.el6                     @anaconda-CentOS-201207061011.x86_64/6.3

attr.x86_64                               2.4.44-7.el6                  @anaconda-CentOS-201207061011.x86_64/6.3

audit.x86_64                              2.2-2.el6                     @anaconda-CentOS-201207061011.x86_64/6.3

audit-libs.x86_64                         2.2-2.el6                     @anaconda-CentOS-201207061011.x86_64/6.3

authconfig.x86_64                         6.1.12-10.el6                 @anaconda-CentOS-201207061011.x86_64/6.3

autoconf.noarch                           2.63-5.1.el6                  @base

automake.noarch                           1.11.1-4.el6                  @base

b43-openfwwf.noarch                       5.2-4.el6                     @anaconda-CentOS-201207061011.x86_64/6.3

basesystem.noarch                         10.0-4.el6                    @anaconda-CentOS-201207061011.x86_64/6.3

bash.x86_64                               4.1.2-9.el6_2                 @anaconda-CentOS-201207061011.x86_64/6.3

bfa-firmware.noarch                       3.0.0.0-1.el6                 @an

11. List all installed packages using YUM command

List all installed packages to, just execute the following command, it will show all of the installed packages.

[root@devops ~]# yum list installed | more

Loaded plugins: fastestmirror

Installed Packages

MAKEDEV.x86_64         3.24-6.el6       @anaconda-CentOS-201207061011.x86_64/6.3

acl.x86_64             2.2.49-6.el6     @anaconda-CentOS-201207061011.x86_64/6.3

aic94xx-firmware.noarch

30-2.el6         @anaconda-CentOS-201207061011.x86_64/6.3

atmel-firmware.noarch  1.3-7.el6        @anaconda-CentOS-201207061011.x86_64/6.3

attr.x86_64            2.4.44-7.el6     @anaconda-CentOS-201207061011.x86_64/6.3

audit.x86_64           2.2-2.el6        @anaconda-CentOS-201207061011.x86_64/6.3

audit-libs.x86_64      2.2-2.el6        @anaconda-CentOS-201207061011.x86_64/6.3

authconfig.x86_64      6.1.12-10.el6    @anaconda-CentOS-201207061011.x86_64/6.3

خب دوستان به انتهای مقاله آموزشی نحوه مدیریت بسته های نرم افزاری در لینوکس رسیدیم . از توجه و همراهی شما سپاسگزاریم. برای کسب اطلاعات بیشتر درمورد سرور مجازی و هاستینگ کلیک کنید.