目錄
一.關於軟件包
在linux中安裝軟件是需要安裝包的,軟件的安裝包有各種類型:.zip,.rar,.rpm,.tar.gz,.tar。軟件包還可以分為源代碼包和二進制
包,源代碼包是沒有經過編譯的包,需要經過GCC、C++編譯器環境編譯才能運行。二進制包無需編譯,可以直接安裝使用。區分是否為
源代碼包還是二進制包還得基於軟件包里面的文件來判斷,包含.h、.c、.cpp、.cc等結尾的源碼文件,稱之為源代碼包,而軟件包里面存
在bin目錄(bin目錄里有可執行文件),稱之為二進制包。源碼包高度可定制,可以自由選擇自己需要的功能。
二.關於YUM
yum(全稱為 Yellow dog Updater, Modified)是一個前端軟件包管理器。基於RPM包管理,能夠從指定的服務器自動下載RPM包並
且安裝,可以自動處理依賴性關系,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。yum提供了查找、安裝、刪除某一
個、一組甚至全部軟件包的命令,而且命令簡潔而又好記。yum是基於C/S的架構,C=client,S=ftp/http/file。
三.yum工具的使用
3.1 yum安裝軟件功能
#安裝軟件包,-y直接安裝
[root@node5 ~]# yum -y install telnet
3.2 yum升級軟件包功能
[root@node5 ~]# yum -y update #升級軟件包,改變軟件設置和系統設置,系統版本內核都升級,不加任何包,表示整個系統進行升級
[root@node5 ~]# yum -y upgrade #升級軟件包,不改變軟件設置和系統設置,系統版本升級,內核不改變
3.3 yum查看,搜索功能
#查詢rpm包telnet作用
[root@node5 ~]# yum info telnet
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Installed Packages
Name : telnet
Arch : x86_64
Epoch : 1
Version : 0.17
Release : 65.el7_8
Size : 113 k
Repo : installed
From repo : updates
Summary : The client program for the Telnet remote login protocol
URL : http://web.archive.org/web/20070819111735/www.hcs.harvard.edu/~dholland/computers/old-netkit.html
License : BSD
Description : Telnet is a popular protocol for logging into remote systems over the
: Internet. The package provides a command line Telnet client
#查看命令是哪個軟件包安裝的
[root@node5 ~]# yum provides /usr/bin/find
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
1:findutils-4.5.11-6.el7.x86_64 : The GNU versions of find utilities (find and xargs)
Repo : base
Matched from:
Filename : /usr/bin/find
1:findutils-4.5.11-5.el7.x86_64 : The GNU versions of find utilities (find and xargs)
Repo : @anaconda
Matched from:
Filename : /usr/bin/find
#按關鍵字搜索軟件包
[root@node5 ~]# yum search extundelet
============================================================================================ N/S matched: extundelet ============================================================================================
extundelete.x86_64 : An ext3 and ext4 file system undeletion utility
Name and summary matches only, use "search all" for everything.
3.4 yum卸載功能
#卸載telnet
[root@node5 ~]# yum -y remove telnet
總結:如果yum報錯,需要注意的幾個小問題:
- 確定光盤是否連接,光盤是否掛載
- 配置文件中格式是否正確,字母,符號有沒有少寫,掛載點和配置文件中設置的是否一致
- 網絡源需要聯網,操作和RPM類似,並且會自動安裝依賴項
3.5 yum安裝軟件包組功能
1.安裝軟件包組語法:yum groupinstall GROUPNAME
#查看有哪些軟件包組
[root@node5 ~]# yum grouplist
#安裝軟件包組
[root@node5 ~]# yum groupinstall 'Compatibility Libraries' -y