亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1582 | 回復(fù): 0
打印 上一主題 下一主題

為redhat增加apt軟件包管理工具 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2004-10-08 20:52 |只看該作者 |倒序瀏覽

    redhat 6.2   
   
http://ftp.freshrpms.net/pub/freshrpms/redhat/6.2/apt/apt-0.5.4cnc7-fr0.62.1.i386.rpm
    redhat 7.2   
   
http://ftp.freshrpms.net/pub/freshrpms/redhat/7.2/apt/apt-0.3.19cnc55-fr7.i386.rpm
    redhat 7.3      
   
http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/apt-0.5.4cnc9-fr0.1.rh73.i386.rpm
    redhat 8.0   
   
http://ftp.freshrpms.net/pub/freshrpms/redhat/8.0/apt/apt-0.5.4cnc9-fr1.i386.rpm
    redhat 9.0   
   
http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc6-fr1.i386.rpm

    rpm http://people.ecsc.co.uk/ ~matt/downloads/apt/fedora-2-i386 production
為redhat增加apt軟件包管理工具  
一、 簡介
    redhat采用了RPM軟件包管理系統(tǒng),RPM軟件包管理系統(tǒng)具有強大的編譯安裝功能,但是由于歷史原因,RPM軟件包管理系統(tǒng)對軟件之間的依存關(guān)系沒有內(nèi)部定義,造成安裝RPM軟件時經(jīng)常出現(xiàn)令人無法理解的軟件依賴問題。
    debian系統(tǒng)則基于apt(Advanced Packaging Tool)工具進(jìn)行軟件包管理,可以自動解決并安裝倚賴軟件包,因此debian linux被認(rèn)為是最容易管理和升級的系統(tǒng),apt工具也被認(rèn)為是目前最好的軟件包管理工具之一。為了解決redhat包管理系統(tǒng)的致命問題,Conectiva Linux將apt系統(tǒng)移植到了使用rpm軟件包管理系統(tǒng)的Linux系統(tǒng)下,使得基于RPM軟件包的系統(tǒng)可以利用apt工具提供的自動解決倚賴關(guān)系的能力。目前已經(jīng)有很多為redhat linux提供apt方式升級管理軟件包的站點,如
http://freshrpms.net
,
http://apt.unl.edu
等等,使得redhat也成為可以利用apt工具的發(fā)行版之一,本文介紹如何在redhat linux系統(tǒng)安裝和使用apt軟件包管理工具。
    為了對apt工具的特性有一個大致的了解,下面先介紹幾個使用apt with rpm管理系統(tǒng)的實例:
    (1)刪除一個軟件包時自動刪除相關(guān)軟件包:
    [root@linux root]# apt-get remove nessus-common
   
    2)自動下載安裝依賴包:
    [root@linux root]# apt-get install nessus-server
   
    (3)維護(hù)系統(tǒng)軟件,自動更新系統(tǒng) :
    [root@linux root]# apt-get upgrade
二、APT 簡易運作原理
    我們的機(jī)器安裝了 APT 套件之后就成了 APT 的使用者端,當(dāng)我們在安裝、升級 RPM 的時候,事實上,都是透過網(wǎng)絡(luò)連到遠(yuǎn)程的 APT 服務(wù)器去下載 RPM 回來安裝的,APT 服務(wù)器我們是可以自己指定的,而 APT 使用者端也可以同時成為 APT 服務(wù)器(在第二節(jié)我們會講到 APT 服務(wù)器的架設(shè))
    apt-get update 指令會同步使用者端和 APT 服務(wù)器的 RPM 索引清單(package list),APT 服務(wù)器的 RPM 索引清單置于 base 資料夾內(nèi)(base 數(shù)據(jù)夾是由 genbasedir 指令所產(chǎn)生),使用者端計算機(jī)取得 base 資料夾內(nèi)的 bz2 RPM 索引清單壓縮文件后,會將其解壓置放于 /var/state/apt/lists/,而使用者使用 apt-get install 或 apt-get dist-upgrade 指令的時候,就會將這個資料夾內(nèi)的資料和使用者端計算機(jī)內(nèi)的 RPM 數(shù)據(jù)庫比對,如此一來就可以知道那些 RPM 已安裝、未安裝、或是可以升級的,所以一旦 APT 服務(wù)器內(nèi)的 RPM 有所更動,一定要記得使用 genbasedir 指令產(chǎn)生新的RPM索引清單。
三、安裝apt with rpm及其圖形界面前端synaptic
    下面簡單介紹一下如何下載和安裝apt with rpm
    apt with rpm可以直接到 http://freshrpms.net 下載安裝,目前該站點提供了redhat 6.2, 7.x和8.0的軟件升級服務(wù),下面是幾個常用redhat版本的apt下載地址:
    redhat 6.2   
http://ftp.freshrpms.net/pub/freshrpms/redhat/6.2/apt/apt-0.5.4cnc7-fr0.62.1.i386.rpm
    redhat 7.2   
http://ftp.freshrpms.net/pub/freshrpms/redhat/7.2/apt/apt-0.3.19cnc55-fr7.i386.rpm
    redhat 7.3   
http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/apt-0.5.4cnc9-fr0.1.rh73.i386.rpm
    redhat 8.0   
http://ftp.freshrpms.net/pub/freshrpms/redhat/8.0/apt/apt-0.5.4cnc9-fr1.i386.rpm
    redhat 9.0   
http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc6-fr1.i386.rpm
    下載后使用rpm命令安裝:
    [root@linux root]# rpm -ihv apt-0.5.4cnc9-fr1.i386.rpm
    freshrpms.net同時提供了一個圖形界面的apt-rpm接口synaptic,使用圖形界面的apt更加方便,安裝了apt后,可以直接利用apt安裝synaptic:
    [root@linux root]# apt-get update
    [root@linux root]# apt-get install synaptic
    在幾行提示之后Synaptic就安裝好了,進(jìn)入Xwindow,synaptic會出現(xiàn)在“系統(tǒng)設(shè)置”菜單里面。
三、使用apt
    在redhat上面使用apt和在debian下面使用幾乎完全一樣,配置文件在/etc/apt/,按照前面介紹安裝好apt之后就可以使用并可以更新redhat提供的RPM更新以及freshrpms.net提供的更新了。主要運行命令如下:
   (1)更新軟件列表,獲取遠(yuǎn)程rpm服務(wù)器上的軟件列表和相互依賴關(guān)系列表,所有可用軟件的下載地址都在/etc/apt/sources.list里面定義,下面的多數(shù)下載操作地址也是在這里定義的。
    [root@linux root]# apt-get update
   (2)檢查本地軟件依賴關(guān)系合法性,由于rpm系統(tǒng)的問題,很多系統(tǒng)會存在一些依賴問題,用下面命令檢查依賴關(guān)系,同時apt-get會提供一些修復(fù)方案,只有本機(jī)沒有依賴關(guān)系問題了才能良好地使用apt-rpm。一個新安裝的干凈系統(tǒng)不會有依賴關(guān)系問題。
    [root@linux root]# apt-get check
   (3)安裝或升級一個新軟件
    [root@linux root]# apt-get install package-name
    package-name是rpm包的名字的前面部分,不包含版本號,如果選擇不同的處理器類型,可以在后面添加@i686等標(biāo)識。
   (4)升級所有系統(tǒng)軟件
    [root@linux root]# apt-get upgrade
   (5)全面升級,比upgrade更加智能化的升級,同時解決升級時的一些依賴關(guān)系
    [root@linux root]# apt-get dist-upgrade
   (6)卸載軟件,同時卸載依賴軟件
    [root@linux root]# apt-get remove package-name
   (7)清除本地下載的rpm包,rpm包下載后保存在/var/cache/apt/archieves下面,本命令清除已下載安裝過的rpm文件
    [root@linux root]# apt-get clean
   
    (8)apt-cache showpkg
    顯示軟件包的一些常規(guī)信息
    [root@linux root]# apt-cache showpkg openssh
   
    (9)apt-cache stats
    顯示相關(guān)的統(tǒng)計信息顯示相關(guān)的統(tǒng)計信息
   
    (10)apt-cache dump
    顯示緩存中的每個軟件包的簡要描述信息
   
    (11)apt-cache unmet
    顯示不符合一致性的依賴關(guān)系
   
    (12)apt-cache show
    顯示指定軟件包的記錄信息。類似于rpm -qi
   
    (13)apt-cache search
    查找軟件包,類似于rpm -qa|grep package_name
    例: apt-cache search openssh
   
    (14)apt-cache depends
    顯示軟件包的依賴性關(guān)系
   
    (15)apt-cache pkgnames
    列出所有的軟件包
    例: $ apt-cache pkgnames openss
    openssh-askpass
    openssl096
    openssl-perl
    openssl095a
    openssl-python
    openssh-clients
    openssl-devel
    openssh-askpass-gnome
    openssh
    openssl
    openssh-server
    (16)apt-config dump 顯示目前的配置信息。
    以上所有命令都可以通過圖形界面的前端軟件synaptic完成,圖形化的軟件使用起來更加直觀,理解了前面幾個主要命令,就可以毫無困難地使用synaptic了,所以本文不再贅述Synaptic的使用方法了。
四 定制apt-rpm
    (1)添加軟件資源列表
     在apt-rpm系統(tǒng)里面添加軟件資源非常容易,只需要按照提供apt服務(wù)的服務(wù)器的說明在/etc/apt/sources.list里面加入對網(wǎng)站的描述即可。這一行參數(shù)的格式為:
     rpm uri distribution [component1] [componenent2] [...]
     其中,uri為軟件資源的地址,可以是http,ftp,file等URL地址,distribution是redhat發(fā)行版本,如 7.2,7.3,8.0等等,后面的component可以忽略。有時候可能只對某軟件資源的一或幾部分部分感興趣,那么可以在這里明確指出。
     例如添加
http://apt.unl.edu/
提供的redhat KDE 3.1的測試軟件包,只需要在sources.list里面添加一行:
     rpm
ftp://apt.unl.edu/apt/
8.0 kde3-test
     就將該網(wǎng)站的kde3部分加入了列表。
     下面是一些目前可以用于redhat 的apt-rpm軟件資源列表,把它們加入你的 /etc/apt/sources.list 文件就可以通過apt-rpm使用他們提供的redhat軟件更新和維護(hù)了,參看網(wǎng)站說明。(前面是網(wǎng)站名,后面是適用redhat版本和簡介)
      
http://apt.freshrpms.net/
  - Red Hat Linux 6.2, 7.x 、8.0and 9.0 repositories (with all freshrpms included of course!)
      
http://www.linux.cz/apt-rpm/
  - Red Hat Linux 7.x repositories (with all freshrpms included too!)
      
http://apt-rpm.tuxfamily.org/
- Red Hat Linux 6.2, 7.x 、8.0and 9.0  repositories
      
http://apt.nlc.no/apt/
- Red Hat Linux 6.2, 7.x and Rawhide repositories
      
http://ftp.uninett.no/pub/linux/apt/
- Red Hat Linux 6.2, 7.x、8.0and 9.0  and Rawhide repositories
      
http://redhat.usu.edu/
- Red Hat Linux 7.2, 7.3 and 8.0 repositories
      
ftp://mirror.pa.msu.edu/apt/
- Red Hat Linux 7.2, 7.3 and 8.0 repositories
      
http://apt-rpm.codefactory.se/
- Red Hat Linux 7.2, 7.3 and 8.0 and gnomehide repositories
      
http://apt.42h.de/
- Red Hat Linux 7.2, 7.3 and 8.0 repositories
      
http://apt.toggletext.com.au/
- A few Red Hat Linux 7.2 custom packages
      
http://people.ecsc.co.uk/~matt/repository.html
- Lots of custom Red Hat Linux 8.0 GNOME 2 and related packages
      
http://ftp-stud.fht-esslingen.de/apt/
- Red Hat Linux 7.x, 8.x and rawhide
      
http://apt.unl.edu/
- Red Hat Linux 7.3 and 8.0
      
http://kde-redhat.sourceforge.net/
- KDE for Red Hat project
    (2)把redhat安裝盤添加到軟件源
     有的時候需要從redhat安裝光盤或者iso文件安裝、卸載軟件,這時可以把redhat安裝光盤設(shè)置為軟件源。這種工作方式需要首先掃面安裝光盤上的軟件包,并在 /var/lib/apt/cdroms.list文件中建立光盤軟件列表。
     如果使用redhat光盤,只需要把光盤插入光驅(qū),下面命令會自動mount光盤并建立列表
     [root@linux root]# apt-cdrom add
     如果是使用ISO文件安裝,首先mount ISO文件到mount-point,把mount point輸入,就可以自動搜索RPM軟件列表了。
     [root@linux root]# apt-cdrom -m -d mount-point add
     如果是解開的硬盤映像安裝,只需要把路徑輸入,就可以自動搜索RPM軟件列表了。
     [root@linux root]# apt-cdrom -m -d path add
五、 架設(shè)簡易 APT 服務(wù)器 (這里只講解Redhat 9)
    注意:在進(jìn)行下面操作前請先確認(rèn)自己的 apache 已經(jīng)在正常運做,且 /var 至少還有 2G 的空間
    1.為什么要架設(shè) APT 服務(wù)器
當(dāng)我們安裝 freshrpms 的 apt,安裝、升級都是透過網(wǎng)絡(luò)聯(lián)機(jī)到 freshrpms 下載檔案。若只維護(hù)一臺服務(wù)器,還好,可是若有十臺服務(wù)器,就需要花原本十倍的時間和頻寬來做同樣的事情,再加上若連外(美國)的頻寬不充裕,這要如何是好,所以當(dāng)有多臺服務(wù)器要維護(hù)的時候,架設(shè)一臺 APT 服務(wù)器,似乎是不錯的選擇。
    2.安裝 apt:
   
http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/
    請安裝這網(wǎng)站內(nèi)最新的 apt
    線上安裝:rpm -ivh
http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc5-fr2.i386.rpm
    3.建置放置 Red Hat Linux 9 相關(guān) rpm 的資料夾
    mkdir -p /var/www/html/redhat/9
    mkdir /var/www/html/redhat/9/RPMS.os
    mkdir /var/www/html/redhat/9/RPMS.updates
    4.將整個 Red Hat Linux 9 的 binary rpm 復(fù)制到 /var/www/html/redhat/9/RPMS.os 資料夾(底下提供二種方法,請依自己狀況挑選一種方法執(zhí)行)
    方法一:從光盤片復(fù)制(當(dāng)手上有 Red Hat Linux 9 光盤片的時候可以用這個方法)
    mount /mnt/cdrom
    cp -f /mnt/cdrom/RedHat/RPMS/* /var/www/html/redhat/9/RPMS.os/
    umount /mnt/cdrom
    依照上面方法,復(fù)制第二片、第三片光盤片內(nèi)的 rpm
    方法二:從 iso 文件復(fù)制(當(dāng)計算機(jī)內(nèi)有 Red Hat Linux 9 iso 檔的時候可以用這個方法用)
   
    mkdir /mnt/iso
   
    mount -o loop shrike-i386-disc1.iso /mnt/iso
    cp /mnt/iso/RedHat/RPMS/* /var/www/html/redhat/9/RPMS.os/
    umount /mnt/iso
   
    mount -o loop shrike-i386-disc2.iso /mnt/iso
    cp -f /mnt/iso/RedHat/RPMS/* /var/www/html/redhat/9/RPMS.os/
    umount /mnt/iso
   
    mount -o loop shrike-i386-disc3.iso /mnt/iso
    cp -f /mnt/iso/RedHat/RPMS/* /var/www/html/redhat/9/RPMS.os/
    umount /mnt/iso
    5.將 Red Hat Linux 9 updates 的 rpm 復(fù)制到 /var/www/html/redhat/9/RPMS.updates 資料夾
    cd /var/www/html/redhat/9/RPMS.updates
    wget
ftp://linux.sinica.edu.tw/pub1/redhat/updates/9/en/os/i386/
*(若網(wǎng)絡(luò)頻寬不高,會花很久時間,請耐心等候)


本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/60/showart_1119.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP