linux8

# 軟件包的安裝:
 - rpm

創(chuàng)新互聯(lián)建站是專業(yè)的海門網(wǎng)站建設公司,海門接單;提供網(wǎng)站制作、成都做網(wǎng)站,網(wǎng)頁設計,網(wǎng)站設計,建網(wǎng)站,PHP網(wǎng)站建設等專業(yè)做網(wǎng)站服務;采用PHP框架,可快速的進行海門網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!

linux 8 - yum
# rpm包安裝
- 準備工作: 下載iso鏡像
- 掛載設備到某個目錄:mount xxx.iso /mnt/
- 進入Packages包執(zhí)行命令:
 rpm -ivh xxx.rpm  # 安裝軟件, i:install,v,顯示過程
 rpm -qp xxx.rpm  # 找出rpm包在系統(tǒng)中安裝后的名字
 rpm -e xxx  # 刪除軟件

 查詢:
  rpm -ql xxx.rpm  # 查詢該軟件生成了哪些文件;
  rpm -qc xxx.rpm  # 查詢軟件生成的配置文件;
  rpm -qa   # 查詢已經(jīng)安裝的軟件包
  rpm -qa | grep http # 查詢與http相關的軟件是否安裝;
  rpm -qf /bin/ls  # 查看/bin/ls是由哪個軟件包生成的;

- 缺點:必須切換到軟件包所在的目錄;依賴性需要自己查找安裝;

linux 8

linux 8

linux 8

linux 8


# yum安裝

- 前提
 iso鏡像
 需要你的軟件包倉庫;


## 搭建本地yum倉庫
1. 掛載iso鏡像到本地的某個目錄:
 mount xxx.iso /mnt/
 # 你可以在/mnt目錄里面訪問到iso鏡像的內(nèi)容;
2. 告訴yum倉庫你的軟件位置:
 # 切換到y(tǒng)um倉庫配置文件所在目錄
 cd /etc/yum.repos.d/
 
 # 刪除裝系統(tǒng)時默認設置配置文件
 rm -fr *

 # 編輯屬于你的配置文件
 vim westos.repo  # 一定要以.repo結尾,前面任意
 ```
 [rhel7]   # 倉庫名稱
 name=rhel7  # 倉庫描述
 baseurl=file:///mnt # 倉庫地址,file://是協(xié)議,/mnt是本地所在位置;
 gpgcheck=0  # 不檢測key
 enabled=1  # 1,倉庫生效; 0,不生效; 
 ```
3. 清除緩存:
 # 默認會去/var/cache/yum去找軟件信息,更改配置后一定要清緩存;
 yum clean all

4. 檢測
 - 方法一: 
  # 列出所有的軟件倉庫包含的軟件包;
  yum repolist

 - 方法二:
  # 任意安裝一個軟件
  yum install lftp -y

linux 8

linux 8

linux 8

linux 8

linux 8

linux 8


1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
## 搭建網(wǎng)絡yum倉庫


** desktop主機
1. 準備工作: 把本機文件讓其他主機可以訪問(httpd)
 # 一般把安裝了httpd軟件的主機稱為Web服務器,可以共享文件給其他主機;
 yum install httpd -y
 systemctl start httpd
 systemctl enabled httpd
 systemctl stop firewalld
 systemctl disable firewalld


2. 把iso鏡像的內(nèi)容讓其他主機可以訪問:
 # /var/www/html,是http的默認發(fā)布目錄,http://ip/rhel7訪問;
 mkdir /var/www/html/rhel7

 # iso掛載到http的默認發(fā)布目錄
 mount xxx.iso /var/www/html/rhel7

3. 修改yum倉庫的配置文件
 # 只需要修改baseurl
 vim westos.repo  # 一定要以.repo結尾,前面任意
 ```
 [rhel7]   # 倉庫名稱
 name=rhel7  # 倉庫描述
 baseurl=http://ip/rhel7 # 倉庫地址,http://是協(xié)議,/rhel7是ip主機/var/www/html/rhel7目錄;
 gpgcheck=0  # 不檢測key
 enabled=1  # 1,倉庫生效; 0,不生效; 
 ```
4. 清空緩存和檢測


*** 其他主機(想使用desktop搭建好的yum倉庫)
 # 只需要修改yum倉庫的配置文件,同desktop第3步;

 

linux 8

linux 8

linux 8

linux 8

linux 8


## 搭建網(wǎng)絡第三方軟件倉庫

- 理解什么是第三方軟件?
 iso鏡像里面包含4000多個軟件包,但還有一些軟件(eg:wps,smplayer,ntfs)沒有;
 從其他地方(eg:baidu,www.pkgs.org)下載的其他軟件包;


** desktop主機
1. 創(chuàng)建software目錄,可讓其他主機訪問
 mkdir /var/www/html/software

2. 將第三方軟件放在/var/www/html/software目錄下;
 # 可通過網(wǎng)址http://ip/software訪問;
 cp xxxx.rpm /var/www/html/software/
3. 對software目錄生成repodata元數(shù)據(jù),讓系統(tǒng)知道該目錄下有軟件包;
 createrepo /var/www/html/software/

4. 修改yum倉庫的配置文件;
 vim westos.repo  # 一定要以.repo結尾,前面任意
 ```
 [rhel7]   # 倉庫名稱
 name=rhel7  # 倉庫描述
 baseurl=http://ip/rhel7 # 倉庫地址,http://是協(xié)議,/rhel7是ip主機/var/www/html/rhel7目錄;
 gpgcheck=0  # 不檢測key
 enabled=1  # 1,倉庫生效; 0,不生效; 


 [soft]   # 倉庫名稱
 name=soft  # 倉庫描述
 baseurl=http://ip/software # 倉庫地址,http://是協(xié)議,/software是ip主機/var/www/html/software目錄;
 gpgcheck=0  # 不檢測key
 enabled=1  # 1,倉庫生效; 0,不生效; 

 ```

5. 清空緩存和檢測;

 

**** 其他主機要使用第三方軟件倉庫:
 # 只需要修改yum倉庫的配置文件,同desktop主機第4步操作;

 

linux 8

linux 8

linux 8

linux 8

linux 8

linux 8

網(wǎng)站欄目:linux8
分享地址:http://muchs.cn/article24/pidgje.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設計、面包屑導航、網(wǎng)站收錄、服務器托管、電子商務、網(wǎng)站設計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)