国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Linux > 正文

linux中yum軟件包管理例子

2024-08-27 23:58:44
字體:
供稿:網(wǎng)友

yum對于使用linux系統(tǒng)服務(wù)器的朋友估計并不陌生了,今天我們給各位介紹linux中yum軟件包管理例子,希望下文可以幫助到各位.

Yum(全稱為 Yellow dog Updater, Modified)是一個在Fedora、RedHat、CentOS中的Shell前端軟件包管理器,基于RPM包管理,能夠從指定的服務(wù)器自動下載RPM包并且安裝,可以自動處理依賴性關(guān)系,并且一次安裝所有依賴的軟件包,下面總結(jié)下yum的常用參數(shù).

yum的命令形式一般是如下:yum [options] [command] [package ...]

其中的[options]是可選的,選項包括-h(幫助),-y(當(dāng)安裝過程提示選擇全部為"yes"),-q(不顯示安裝的過程)等等,[command]為所要進行的操作,[package ...]是操作的對象.

概括了部分常用的命令包括:

自動搜索最快鏡像插件:yum install yum-fastestmirror

安裝yum圖形窗口插件:yum install yumex

查看可能批量安裝的列表:yum grouplist

1、yum安裝軟件包

#yum install curl 或 #yum -y install curl 或 不加y參數(shù)時是交互式的安裝,需要按提示確認(rèn)后才能安裝,而加-y是靜默模式,直接進行安裝.

2、yum移除軟件包

完全移除軟件包及所有依賴包.

#yum remove curl 或 #yum -y remove curl

3、yum更新軟件包

# yum update mysql

4、列出軟件包

使用list函數(shù),可搜索帶名稱的特定軟件包,比如說,想搜索一個名為openssh的軟件包,使用該命令.

  1. # yum list openssh 
  2. Loaded plugins: fastestmirror 
  3. Loading mirror speeds from cached hostfile 
  4. * base: mirror.neu.edu.cn 
  5. * epel: mirror.neu.edu.cn 
  6. * extras: mirror.neu.edu.cn 
  7. * rpmforge: mirror.nl.leaseweb.net 
  8. * updates: mirror.nus.edu.sg 
  9. Installed Packages 
  10. openssh.i386    4.3p2-72.el5_6.3    installed 
  11. Available Packages   4.3p2-82.el5   base  

想讓你的搜索更精確,明確軟件包名稱的版本,如果你知道的話,比如說,想搜索軟件包的特定版本openssh-4.3p2,使用該命令.

# yum list openssh-4.3p2

5、Yum搜索軟件包

要是你不記得軟件包的確切名稱,那么可以使用search或search all,搜索與指定軟件包的名稱相匹配的所有可用軟件包,比如說,想搜索與vsftpd這個單詞匹配的所有軟件包.

  1. [root@api test]# yum search vsftpd 
  2. Loaded plugins: fastestmirror, security 
  3. Determining fastest mirrors 
  4.  * base: mirrors.yun-idc.com 
  5.  * extras: mirrors.yun-idc.com 
  6.  * updates: mirrors.yun-idc.com 
  7. base                                                                 | 3.7 kB     00:00 
  8. extras                                                               | 3.4 kB     00:00 
  9. updates                                                              | 3.4 kB     00:00 
  10. updates/primary_db                                                   | 2.1 MB     00:02 
  11. =============================== N/S Matched: vsftpd =================================== 
  12. vsftpd.x86_64 : Very Secure Ftp Daemon 
  13.   Name and summary matches only, use "search all" for everything. 
  14. [root@api test]# yum search all vsftpd 
  15. Loaded plugins: fastestmirror, security 
  16. Loading mirror speeds from cached hostfile 
  17.  * base: mirrors.yun-idc.com --Vevb.com 
  18.  * extras: mirrors.yun-idc.com 
  19.  * updates: mirrors.yun-idc.com 
  20. ==============================================Matched: vsftpd ========================== 
  21. vsftpd.x86_64 : Very Secure Ftp Daemon 

6、Yum獲取軟件包信息

假設(shè)你想在安裝軟件包之前先知道它的信息,想獲得某軟件包的信息,只要執(zhí)行下面這個命令.

  1. [root@api test]# yum info vsftpd 
  2. Loaded plugins: fastestmirror, security 
  3. Loading mirror speeds from cached hostfile 
  4.  * base: mirrors.yun-idc.com 
  5.  * extras: mirrors.yun-idc.com 
  6.  * updates: mirrors.yun-idc.com 
  7. Installed Packages 
  8. Name        : vsftpd 
  9. Arch        : x86_64 
  10. Version     : 2.2.2 
  11. Release     : 11.el6 
  12. Size        : 331 k 
  13. Repo        : installed 
  14. From repo   : anaconda-CentOS-201207061011.x86_64 
  15. Summary     : Very Secure Ftp Daemon 
  16. URL         : http://vsftpd.beasts.org/ 
  17. License     : GPLv2 with exceptions 
  18. Description : vsftpd is a Very Secure FTP daemon. It was written completely from 
  19.             : scratch. 
  20. Available Packages 
  21. Name        : vsftpd 
  22. Arch        : x86_64 
  23. Version     : 2.2.2 
  24. Release     : 11.el6_4.1 
  25. Size        : 151 k 
  26. Repo        : base 
  27. Summary     : Very Secure Ftp Daemon 
  28. URL         : http://vsftpd.beasts.org/ 
  29. License     : GPLv2 with exceptions 
  30. Description : vsftpd is a Very Secure FTP daemon. It was written completely from 
  31.             : scratch. 

7、列出軟件

列出所有軟件:# yum list | less

只列出已經(jīng)安裝的軟件:# yum list installed | less

8、查看文件歸屬

  1. [root@api test]# yum provides /etc/httpd/conf/httpd.conf 
  2. Loaded plugins: fastestmirror, security 
  3. Loading mirror speeds from cached hostfile 
  4.  * base: mirrors.yun-idc.com 
  5.  * extras: mirrors.yun-idc.com 
  6.  * updates: mirrors.yun-idc.com 
  7. httpd-2.2.15-29.el6.centos.x86_64 : Apache HTTP Server 
  8. Repo        : base 
  9. Matched from: 
  10. Filename    : /etc/httpd/conf/httpd.conf 
  11. httpd-2.2.15-15.el6.centos.1.x86_64 : Apache HTTP Server 
  12. Repo        : installed 
  13. Matched from: 
  14. Other       : Provides-match: /etc/httpd/conf/httpd.conf 

9、檢查可用版本更新

# yum check-update

10、系統(tǒng)更新

想確保系統(tǒng)版本最新,打上了所有的安全補丁和二進制軟件包更新,只要運行下面這個命令,它會為你的系統(tǒng)安裝所有最新的補丁和安全更新版.

# yum update

11、列出所有的可用群組軟件包

# yum grouplist

注:如果語言環(huán)境設(shè)置的是中文,列出的是組句會是中文名稱.

12、群組安裝

# yum groupinstall 'MySQL Database' 以上是安裝mysql數(shù)據(jù)庫。

13、更新群組軟件包

# yum groupupdate 'DNS Name Server'

14、移除群組軟件包

# yum groupremove 'DNS Name Server'

15、列出啟用的Yum軟件庫

  1. [root@api test]# yum repolist 
  2. Loaded plugins: fastestmirror, security 
  3. Loading mirror speeds from cached hostfile 
  4.  * base: mirrors.yun-idc.com 
  5.  * extras: mirrors.yun-idc.com 
  6.  * updates: mirrors.yun-idc.com 
  7. repo id                                repo name                                         status 
  8. base                                   CentOS-6 - Base                                   6,367 
  9. extras                                 CentOS-6 - Extras                                    14 
  10. updates                                CentOS-6 - Updates                                  609 
  11. repolist: 6,990 

16、列出所有啟用或禁用的yum軟件庫

# yum repolist all

17、使用特定軟件庫安裝軟件

想安裝來自某個啟用或禁用的軟件庫的某個軟件包,必須在yum命令中使用-enablerepo選項,比如,想安裝PhpMyAdmin 3.5.2軟件包,只要執(zhí)行這個命令.

# yum --enablerepo=epel install phpmyadmin

18、交互式Y(jié)um shell

  1. # yum shell 
  2. Loaded plugins: fastestmirror 
  3. Setting up Yum Shell 
  4. > update httpd 
  5. Loading mirror speeds from cached hostfile 
  6. * base: mirrors.sin3.sg.voxel.net 
  7. * epel: ftp.riken.jp 
  8. * extras: mirrors.sin3.sg.voxel.net 
  9. * updates: mirrors.sin3.sg.voxel.net 
  10. Setting up Update Process 
  11. >  

19、yum緩存清理

默認(rèn)情況下,yum將所有軟件庫中啟用軟件包的數(shù)據(jù),連同每個子目錄保存在/var/cache/yum/中,想清除啟用軟件庫中的所有緩存文件,你要定期運行下面這個命令,清理所有緩存內(nèi)容,并確保沒有任何東西在使用不必要的存儲空間,我們不想給出下面這個命令的輸出結(jié)果,因為我們想保持緩存數(shù)據(jù)的原來樣子.

# yum clean all

20、查看yum的歷史記錄

  1. [root@api test]# yum history 
  2. Loaded plugins: fastestmirror, security 
  3. ID     | Login user               | Date and time    | Action(s)      | Altered 
  4. ------------------------------------------------------------------------------- 
  5.     19 | root <root>              | 2011-12-19 11:54 | Install        |    1 
  6.     18 | root <root>              | 2011-11-28 17:18 | I, U           |    2 
  7.     17 | root <root>              | 2011-11-11 14:26 | Install        |    1 
  8.     16 | root <root>              | 2011-09-27 17:11 | Install        |    1 
  9.     15 | root <root>              | 2011-09-23 10:50 | Update         |    2 
  10.     14 | root <root>              | 2011-09-23 10:48 | Update         |    4 
  11.     13 | root <root>              | 2011-08-28 11:45 | Update         |    1 
  12.     12 | root <root>              | 2011-08-21 13:27 | Install        |    8 
  13.     11 | root <root>              | 2011-08-21 13:19 | Install        |    2 
  14.     10 | root <root>              | 2011-07-12 16:33 | I, O, U        |   43 
  15.      9 | root <root>              | 2011-03-12 15:15 | I, U           |    3 
  16.      8 | root <root>              | 2011-03-12 15:12 | I, U           |   13 
  17.      7 | root <root>              | 2011-03-06 08:11 | Install        |    6 
  18.      6 | root <root>              | 2011-03-05 22:55 | Install        |    7 
  19.      5 | root <root>              | 2011-03-05 22:16 | Install        |    1 
  20.      4 | root <root>              | 2011-03-05 22:11 | I, U           |   10 
  21.      3 | root <root>              | 2011-03-05 22:07 | I, U           |    9 
  22.      2 | root <root>              | 2011-03-05 22:04 | Install        |    1 
  23.      1 | System <unset>           | 2011-03-05 18:37 | Install        |  648 
  24. history list

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 安泽县| 商丘市| 巴楚县| 商水县| 渭源县| 镇平县| 兴义市| 明溪县| 台山市| 玉溪市| 临沧市| 钦州市| 塔河县| 夏河县| 蓬莱市| 大荔县| 舒兰市| 沅江市| 西安市| 文水县| 郑州市| 湾仔区| 道孚县| 榆中县| 沁阳市| 萍乡市| 蛟河市| 龙陵县| 海宁市| 敖汉旗| 许昌县| 云龙县| 乐亭县| 中山市| 屏东市| 西乌珠穆沁旗| 南平市| 炎陵县| 靖江市| 获嘉县| 扎囊县|