yum之如何手动创建本地yum仓库
生活随笔
收集整理的這篇文章主要介紹了
yum之如何手动创建本地yum仓库
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先先安裝createrepo-0.9.9-17.el6.noarch.rpm
?????? 我之前搭建過yum,所以我直接用yum install直接安裝
???????我的系統是redhat6
我已經安裝成功
2.? 在/root下mkdir一個文件夾epel,我把我之前掛載在/mnt/Packages下的*.rpm? copy到/root/epel
3. 在/etc/yum.repos.d下修改rhel-source.repo文件(可能文件名稱不同)
[root@localhost?yum.repos.d]#?pwd /etc/yum.repos.d [root@localhost?yum.repos.d]#?ls rhel-source.repo [root@localhost?yum.repos.d]#?cat?rhel-source.repo [rhel-Base] name=Red?Hat baseurl=file:///mnt enabled=1 gpgcheck=0 [epel] name=epel baseurl=file:///root/epel enabled=1 gpgcheck=0 [root@localhost?yum.repos.d]#【epel】是我新添加的配置
4. 我們執行 yum repolist命令看一下
[root@localhost?yum.repos.d]#?yum?repolist Loaded?plugins:?product-id,?refresh-packagekit,?security,?subscription-manager This?system?is?not?registered?to?Red?Hat?Subscription?Management.?You?can?use?subscription-manager?to?register. file:///root/epel/repodata/repomd.xml:?[Errno?14]?Could?not?open/read?file:///root/epel/repodata/repomd.xml Trying?other?mirror. repo?id???????????????????????????????repo?name???????????????????????????status epel??????????????????????????????????epel????????????????????????????????0 rhel-Base?????????????????????????????Red?Hat?????????????????????????????0 repolist:?0 [root@localhost?yum.repos.d]#repo id? 和repo name已經顯示出了新添加的epel,但是出錯了缺少repomd.xml,下面我來創建一個repomd.xml
5.
[root@localhost?yum.repos.d]#?createrepo?/root/epel/ Spawning?worker?0?with?15?pkgs Workers?Finished Gathering?worker?results Saving?Primary?metadata Saving?file?lists?metadata Saving?other?metadata Generating?sqlite?DBs Sqlite?DBs?complete [root@localhost?yum.repos.d]#?ls?/root/epel/ php-5.3.3-22.el6.x86_64.rpm?????????php-pear-1.9.4-4.el6.noarch.rpm php-cli-5.3.3-22.el6.x86_64.rpm?????php-pecl-apc-3.1.9-2.el6.x86_64.rpm php-common-5.3.3-22.el6.x86_64.rpm??php-pecl-memcache-3.0.5-4.el6.x86_64.rpm php-gd-5.3.3-22.el6.x86_64.rpm??????php-pgsql-5.3.3-22.el6.x86_64.rpm php-ldap-5.3.3-22.el6.x86_64.rpm????php-soap-5.3.3-22.el6.x86_64.rpm php-mysql-5.3.3-22.el6.x86_64.rpm???php-xml-5.3.3-22.el6.x86_64.rpm php-odbc-5.3.3-22.el6.x86_64.rpm????php-xmlrpc-5.3.3-22.el6.x86_64.rpm php-pdo-5.3.3-22.el6.x86_64.rpm?????repodata [root@localhost?yum.repos.d]#?? 我先yum clean all清除下緩存并yum repolist下看有沒有出錯
[root@localhost?yum.repos.d]#?yum?clean?all Loaded?plugins:?product-id,?refresh-packagekit,?security,?subscription-manager This?system?is?not?registered?to?Red?Hat?Subscription?Management.?You?can?use?subscription-manager?to?register. Cleaning?repos:?epel?rhel-Base Cleaning?up?Everything [root@localhost?yum.repos.d]#?yum?repolist Loaded?plugins:?product-id,?refresh-packagekit,?security,?subscription-manager This?system?is?not?registered?to?Red?Hat?Subscription?Management.?You?can?use?subscription-manager?to?register. epel?????????????????????????????????????????????????????|?2.9?kB?????00:00?... epel/primary_db??????????????????????????????????????????|??14?kB?????00:00?... rhel-Base????????????????????????????????????????????????|?3.9?kB?????00:00?... rhel-Base/primary_db?????????????????????????????????????|?3.1?MB?????00:02?... repo?id???????????????????????????????repo?name???????????????????????????status epel??????????????????????????????????epel???????????????????????????????????15 rhel-Base?????????????????????????????Red?Hat?????????????????????????????3,648 repolist:?3,663 [root@localhost?yum.repos.d]#yum repolist沒有出錯,看來我們創建成功了。
6.? 測試
????????yum list
????????yum list all???
????????yum install 安裝一個軟件
[root@localhost?epel]#?yum?install?php-5.3.3-22.el6.x86_64.rpm Loaded?plugins:?product-id,?refresh-packagekit,?security,?subscription-manager This?system?is?not?registered?to?Red?Hat?Subscription?Management.?You?can?use?subscription-m???anager?to?register. Setting?up?Install?Process Examining?php-5.3.3-22.el6.x86_64.rpm:?php-5.3.3-22.el6.x86_64 Marking?php-5.3.3-22.el6.x86_64.rpm?to?be?installed Resolving?Dependencies -->?Running?transaction?check --->?Package?php.x86_64?0:5.3.3-22.el6?will?be?installed -->?Processing?Dependency:?php-cli(x86-64)?=?5.3.3-22.el6?for?package:?php-5.3.3-22.el6.x86_???64 -->?Processing?Dependency:?php-common(x86-64)?=?5.3.3-22.el6?for?package:?php-5.3.3-22.el6.x???86_64 -->?Running?transaction?check --->?Package?php-cli.x86_64?0:5.3.3-22.el6?will?be?installed --->?Package?php-common.x86_64?0:5.3.3-22.el6?will?be?installed -->?Finished?Dependency?Resolution Dependencies?Resolved ============================================================================================Package???????????Arch??????????Version??????????????Repository???????????????????????Size ============================================================================================ Installing:php???????????????x86_64????????5.3.3-22.el6?????????/php-5.3.3-22.el6.x86_64????????3.5?M Installing?for?dependencies:php-cli???????????x86_64????????5.3.3-22.el6?????????epel????????????????????????????2.2?Mphp-common????????x86_64????????5.3.3-22.el6?????????epel????????????????????????????524?k Transaction?Summary ============================================================================================ Install???????3?Package(s) Total?size:?6.2?M Total?download?size:?2.7?M Installed?size:?13?M Is?this?ok?[y/N]:?^CExiting?on?user?Command [root@localhost?epel]#轉載于:https://blog.51cto.com/bosszhang/1678304
總結
以上是生活随笔為你收集整理的yum之如何手动创建本地yum仓库的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 用Xamarin 实现园友的 :Andr
- 下一篇: sql server 主从数据库同步