1. 程式人生 > >RHEL6 學習:配置 YUM 倉庫

RHEL6 學習:配置 YUM 倉庫

       今天學習了 RHEL6 yum 源配置,RHEL6 的配置過程和 RHEL5 大體相同,以下是實驗過程。


一配置本地 YUM 源
--1.1 實驗環境
RHEL6:虛擬機器


--1.2 掛載光碟機
[[email protected] yum.repos.d]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

  備註:將光碟 ISO 檔案掛載到目錄 /mnt


--1.3 建立本地目錄,用來 copy 光碟包
[[email protected] local_repo]# mkdir -p /opt/rpm/local_repo


--1.4 copy RPM 包到指定目錄
[[email protected] log]# cd /mnt/Packages/
[[email protected] Packages]# cp * /opt/rpm/local_repo


--1.5 安裝 createrepo 包
[root[email protected] local_repo]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
error: Failed dependencies:
        deltarpm is needed by createrepo-0.9.8-4.el6.noarch
        python-deltarpm is needed by createrepo-0.9.8-4.el6.noarch
You have new mail in /var/spool/mail/root


--1.5.1根據提示,安裝需要的包

 [[email protected] local_repo]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm
warning: deltarpm-3.5-0.5.20090913git.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]
[
[email protected]
local_repo]#
[[email protected] local_repo]#
[[email protected] local_repo]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]
[[email protected] local_repo]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
      
   備註:createrepo 包安裝成功
  
 
--1.6 建立 repo 資料庫

 [[email protected] local_repo]# createrepo -d /opt/rpm/local_repo
1944/2804 - MAKEDEV-3.24-6.el6.i686.rpm                                        
iso-8859-1 encoding on Ville [email protected]> - 2.8.2-2

2804/2804 - perl-Archive-Extract-0.38-119.el6_1.1.i686.rpm                     
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

         
  備註:這個步驟需要點時間。

  
--1.7 編寫 /etc/yum.repos.d/local_repo.repo 檔案

   檔案 /etc/yum.repos.d/local_repo.repo   內容如下。

 [rhel-source]
name=Red Hat Enterprise Linux Local repo   ##倉庫描述
baseurl=file:///opt/rpm/local_repo         ##軟體倉庫位置
enabled=1                                  ##是否啟用
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release   ##簽名祕鑰

   
 
二 yum 源測試
--2.1 查詢 ruby 相關包

 [[email protected] yum.repos.d]# yum search ruby
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Repository rhel-source is listed more than once in the configuration
rhel-source                                                                                                  | 2.7 kB     00:00 ...
rhel-source/primary_db                                                                                       | 2.5 MB     00:00 ...
======================================================== N/S Matched: ruby =========================================================
ruby-irb.i686 : The Interactive Ruby
ruby-libs.i686 : Libraries necessary to run Ruby
ruby-qpid.i686 : Ruby language client for AMQP
ruby-qpid-qmf.i686 : The QPID Management Framework bindings for ruby
ruby.i686 : An interpreter of object-oriented scripting language
saslwrapper.i686 : Ruby and Python wrappers for the cyrus sasl library.

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

   
--2.2 安裝包 ruby.i68

 [[email protected] yum.repos.d]# yum install ruby.i686
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Repository rhel-source is listed more than once in the configuration
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ruby.i686 0:1.8.7.352-3.el6 will be installed
--> Processing Dependency: ruby-libs = 1.8.7.352-3.el6 for package: ruby-1.8.7.352-3.el6.i686
--> Processing Dependency: libruby.so.1.8 for package: ruby-1.8.7.352-3.el6.i686
--> Running transaction check
---> Package ruby-libs.i686 0:1.8.7.352-3.el6 will be installed
--> Processing Dependency: libreadline.so.5 for package: ruby-libs-1.8.7.352-3.el6.i686
--> Running transaction check
---> Package compat-readline5.i686 0:5.2-17.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                            Arch                   Version                              Repository                     Size
====================================================================================================================================
Installing:
 ruby                               i686                   1.8.7.352-3.el6                      rhel-source                   532 k
Installing for dependencies:
 compat-readline5                   i686                   5.2-17.1.el6                         rhel-source                   127 k
 ruby-libs                          i686                   1.8.7.352-3.el6                      rhel-source                   1.6 M

Transaction Summary
====================================================================================================================================
Install       3 Package(s)

Total download size: 2.3 M
Installed size: 7.7 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                16 MB/s | 2.3 MB     00:00    
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Importing GPG key 0xFD431D51:
 Userid : Red Hat, Inc. (release key 2) <[email protected]>
 Package: redhat-release-server-6Server-6.2.0.3.el6.i686 (@anaconda-RedHatEnterpriseLinux-201111171035.i386/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Importing GPG key 0x2FA658E0:
 Userid : Red Hat, Inc. (auxiliary key) <[email protected]>
 Package: redhat-release-server-6Server-6.2.0.3.el6.i686 (@anaconda-RedHatEnterpriseLinux-201111171035.i386/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : compat-readline5-5.2-17.1.el6.i686                                                                               1/3
  Installing : ruby-libs-1.8.7.352-3.el6.i686                                                                                   2/3
  Installing : ruby-1.8.7.352-3.el6.i686                                                                                        3/3
Installed products updated.

Installed:
  ruby.i686 0:1.8.7.352-3.el6                                                                                                      

Dependency Installed:
  compat-readline5.i686 0:5.2-17.1.el6                               ruby-libs.i686 0:1.8.7.352-3.el6                             

Complete!

   
  備註:本地 yum 源配置成功。
 
 
--2.3 列出已安裝的包
 [[email protected] yum.repos.d]# yum list | grep ruby
Repository rhel-source is listed more than once in the configuration
ruby.i686                              1.8.7.352-3.el6               @rhel-source
ruby-libs.i686                         1.8.7.352-3.el6               @rhel-source
ruby-irb.i686                          1.8.7.352-3.el6               rhel-source
ruby-qpid.i686                         0.7.946106-2.el6              rhel-source
ruby-qpid-qmf.i686                     0.12-6.el6                    rhel-source 
   
--2.4 檢視包資訊
 [[email protected] yum.repos.d]# yum info ruby.i686
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Repository rhel-source is listed more than once in the configuration
Installed Packages
Name        : ruby
Arch        : i686
Version     : 1.8.7.352
Release     : 3.el6
Size        : 1.8 M
Repo        : installed
From repo   : rhel-source
Summary     : An interpreter of object-oriented scripting language
URL         : http://www.ruby-lang.org/
License     : Ruby or GPLv2
Description : Ruby is the interpreted scripting language for quick and easy
            : object-oriented programming.  It has many features to process text
            : files and to do system management tasks (as in Perl).  It is simple,
            : straight-forward, and extensible.
               
           
--2.5 刪除  yum 快取資料
 [[email protected] yum.repos.d]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Repository rhel-source is listed more than once in the configuration
Cleaning repos: rhel-source
Cleaning up Everything         
     

相關推薦

RHEL6 學習配置 YUM 倉庫

       今天學習了 RHEL6 yum 源配置,RHEL6 的配置過程和 RHEL5 大體相同,以下是實驗過程。 一配置本地 YUM 源--1.1 實驗環境RHEL6:虛擬機器 --1.2 掛載光碟機[[email protected] yum.repos.d]# mount /dev/cd

linux學習筆記之yum倉庫配置

1.yum簡介    YUM(全稱為 Yellow dog Updater, Modified)是一個在Fedora和RedHat以及CentOS中的Shell前端軟體包管理器。基於RPM包管理,能夠從指定的伺服器自動下載RPM包並且安裝,可以自動處理依賴性關係,並且一次安裝所有依賴的軟

安裝與現在軟件的方法更換yum倉庫源、yum下載rpm包、源碼包安裝

cde water 方法 -o ebe 12c text ges 更換 更換yum倉庫源 安裝擴展源epel yum下載rpm包 源碼包安裝 安裝與現在軟件的方法:更換yum倉庫源、yum下載rpm包、源碼包安裝

RHEL7配置YUM倉庫

就是 href 技術分享 創建 iss 重啟 pro alt type 掛載光盤,沒有光盤的話,可以自己下載,鏈接:https://pan.baidu.com/s/166kxNhc2pISSmKZLjFJrLA 密碼:xvxo 創建目錄並掛載光盤,前提是你一定要掛載光

新手學習Linux——配置yum

gpg 學習linux dir 修改 登錄 release 使用 新手學 創建文件夾 1、使用root用戶登錄系統,在任意目錄下創建文件夾cdrommkdir /mnt/cdrom2、在任意目錄下執行下面命令:mount -o loop /dev/cdrom /mnt/cd

配置Yum倉庫

第1步:進入到/etc/yum.repos.d/目錄中(因為該目錄存放著Yum軟體倉庫的配置檔案)。 第2步:使用Vim編輯器建立一個名為rhel7.repo的新配置檔案(檔名稱可隨意,但字尾必須為.repo),逐項寫入下面加粗的配置引數並儲存退出(不要寫後面的中文註釋)。 [rhel-media]

Linux如何配置yum倉庫並掛載yum

文章目錄 yum軟體倉庫的介紹 yum的配置 配置完成後要將yum源進行掛載操作 yum軟體倉庫的介紹         yum軟體倉庫的作用是進一步簡化RPM管理軟體的難度以及自動分析所需要的軟體

linux 學習配置JAVA環境

第一步:解壓JDK包 tar zxvf jdk-8u144-linux-x64.tar.gz 第二步:移動jdk包到自己想要放的位置 sudo mv jdk1.8.0_181 /usr/local

(二)flutter學習配置編輯器

使用flutter進行移動開發工作,可以使用使用文字編輯器編寫flutter,但是建議使用編輯器外掛,可以實現程式碼自動完成、語法高亮、程式碼輔助以及除錯支援等等。下面介紹vs code 開發外掛的安裝一、VS Code一款輕量級flutter執行和除錯支援編輯器1、版本最好

Centos7 配置yum倉庫

5、切換到 /etc/yum.repos.d/ ,建立一個目錄,把原有.repo的移動到裡面,然後再手動建立一個新iso.repo [root@localhost ~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ll 總用量 28 -rw-r--

Linux軟體安裝管理在VMware掛載本地iso光碟映象、配置yum軟體倉庫

問題描述 在操作VMware安裝Linux系統後由於安裝CentOS 7的最小化安裝少了一些工具,比如 ifconfig 及 netstat 等,由於沒問外部線上網路環境訪問下載相關依賴包,則我們需要配置離線依賴庫。 本次操作是在Vmware上操作

Pro Android學習筆記(一三七)Home Screen Widgets(3)配置Activity

map onclick widgets info xtra ces extends height appwidget 文章轉載僅僅能用於非商業性質,且不能帶有虛擬貨幣、積分、註冊等附加條件。轉載須註明出處http://blog.csdn.net/flowingfly

VMware中RHEL7配置本地Yum倉庫

本地yum源 rhel71.進入到 /etc/yum.repos.d 目錄中(該目錄是存放yum倉庫配置文件的)[[email protected] ~]# cd /etc/yum.repos.d/2.使用vim編輯器創建名為 rhel7.repo 的配置文件(文件名稱可以自定義,但後綴必須是rep

CentOS7之yum倉庫配置

系統服務 /etc/ ext 圖片 指定 roo vim div linux系統服務 操作系統版本:CentOS Linux release 7.2.1511 (Core) Yum軟件版本:yum-3.4.3-132.el7.centos.0.1.noarch Yum主

大數據學習系列(5)-- 局域網yum倉庫搭建

http 數據 str htm bsp ron lan class tle https://www.cnblogs.com/nulige/p/6081192.html 大數據學習系列(5)-- 局域網yum倉庫搭建

YUM倉庫服務與PXE網絡裝機的配置安裝與使用

兩個 查看 p s edi 文件 ati 安裝軟件 rem ... 前言 前面我們安裝軟件主要使用rpm和源碼編譯安裝,尤其在rpm安裝軟件的時候有些軟件需要依賴關系,安裝起來非常麻煩,今天講的YUM倉庫安裝,可以自動解決依賴關系,只需要一條命令:yum -y ins

hibernate框架學習筆記2配置文件詳解

格式化 version validate ret root 主鍵生成策略 -m color 格式 實體類: package domain; public class Customer { private Long cust_id; priva

本地yum倉庫與局域網yum倉庫配置

無法連接到 配置 speed package odata debug 檢查 lin utility 一、CentOS本地源設置 1.備份並刪除原始的repo源文件 [root@rd-proxy yum.repos.d]# tar -jcv -f CentOS.repo.ta

struts2框架學習筆記2配置詳解

true class 規範 開發規範 刪除用戶 建議 類名 esp 需要 核心配置文件: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Soft

CentOS-7 ,yum倉庫搭建及ftp和http配置

yum ftp http 掛載光盤,光盤放入光驅# mkdir /media/cdrom //創建掛載目錄,個人習慣# mount /dev/cdrom /media/cdrom/ //掛載ls /media/cdrom/ //查看是否掛載成功 安裝 vsftprpm -ivh /med