為redhat增加apt軟體包管理工具(轉)
為redhat增加apt軟體包管理工具(轉)[@more@]一、 簡介redhat採用了RPM軟體包管理系統,RPM軟體包管理系統具有強大的編譯安裝功能,但是由於歷史原因,RPM軟體包管理系統對軟體之間的依存關係沒有內部定義,造成安裝RPM軟體時經常出現令人無法理解的軟體依賴問題。debian系統則基於apt(Advanced Packaging Tool)工具進行軟體包管理,可以自動解決並安裝倚賴軟體包,因此debian linux被認為是最容易管理和升級的系統,apt工具也被認為是目前最好的軟體包管理工具之一。為了解決redhat包管理系統的致命問題, Conectiva Linux將apt系統移植到了使用rpm軟體包管理系統的Linux系統下,使得基於RPM軟體包的系統可以利用apt工具提供的自動解決倚賴關係的能力。目前已經有很多為redhat linux提供apt方式升級管理軟體包的站點,如 , 等等,使得redhat也成為可以利用apt工具的發行版之一,本文介紹如何在redhat linux系統安裝和使用apt軟體包管理工具。為了對apt工具的特性有一個大致的瞭解,下面先介紹幾個使用apt with rpm管理系統的例項:(1)刪除一個軟體包時自動刪除相關軟體包:[root@linux root]# apt-get remove nessus-commonProcessing File Dependencies... DoneReading Package Lists... DoneBuilding Dependency Tree... DoneThe following packages will be REMOVED:nessus-client nessus-common nessus-server0 packages upgraded, 0 newly installed, 3 to remove(replace) and 0 not upgraded.Need to get 0B of archives. After unpacking 4863kB will be freed.Do you want to continue? [Y/n]Executing RPM (-e)...warning: /etc/nessus/nessusd.conf saved as /etc/nessus/nessusd.conf.rpmsave[root@linux root]#(2)自動下載安裝依賴包:[root@linux root]# apt-get install nessus-serverProcessing File Dependencies... DoneReading Package Lists... DoneBuilding Dependency Tree... DoneThe following extra packages will be installed:nessus-common nmapThe following NEW packages will be installed:nessus-common nessus-server nmap0 packages upgraded, 3 newly installed, 0 to remove(replace) and 0 not upgraded.Need to get 1239kB of archives. After unpacking 4889kB will be used.Do you want to continue? [Y/n]Get:1 freshrpms/7.2/freshrpms nessus-common 1:1.1.12-fr1 [101kB]Get:2 freshrpms/7.2/freshrpms nessus-server 1:1.1.12-fr1 [895kB]Get:3 redhat/i386/7.2/os nmap 2.54BETA22-3 [243kB]Fetched 1239kB in 54s (22.8kB/s)Executing RPM (-U)...Preparing... ########################################### [100%]1:nessus-common ########################################### [ 33%]2:nmap ########################################### [ 66%]3:nessus-server ########################################### [100%][root@linux root]#(3)維護系統軟體,自動更新系統 :[root@linux root]# apt-get upgradeProcessing File Dependencies... DoneReading Package Lists... DoneBuilding Dependency Tree... DoneThe following packages will be upgradedat libxml2 libxml2-devel openldap openldap-clients openldap-devel rsync7 packages upgraded, 0 newly installed, 0 to remove(replace) and 0 not upgraded.Need to get 2132kB of archives. After unpacking 560kB will be freed.Do you want to continue? [Y/n]Get:1 redhat-updates-7.2/redhat/os at 3.1.8-23 [42.6kB]Get:2 redhat-updates-7.2/redhat/os libxml2 2.4.10-0.7x.2 [360kB]Get:3 redhat-updates-7.2/redhat/os libxml2-devel 2.4.10-0.7x.2 [617kB]Get:4 redhat-updates-7.2/redhat/os openldap 2.0.21-1 [424kB]Get:5 redhat-updates-7.2/redhat/os openldap-clients 2.0.21-1 [114kB]Get:6 redhat-updates-7.2/redhat/os openldap-devel 2.0.21-1 [462kB]Get:7 redhat-updates-7.2/redhat/os rsync 2.4.6-8 [112kB]Fetched 2132kB in 3m8s (11.3kB/s)Executing RPM (-U)...Preparing... ########################################### [100%]1:libxml2 ########################################### [ 14%]2:rsync ########################################### [ 28%]3:openldap ########################################### [ 42%]4:openldap-clients ########################################### [ 57%]5:openldap-devel ########################################### [ 71%]6:at ########################################### [ 85%]7:libxml2-devel ########################################### [100%][root@linux root]#二、安裝apt with rpm及其圖形介面前端Synaptic下面簡單介紹一下如何下載和安裝apt with rpmapt with rpm可以直接到 [url][/url] 下載安裝,目前該站點提供了redhat 6.2, 7.x和8.0的軟體升級服務,下面是幾個常用redhat版本的apt下載地址:redhat 6.2redhat 7.2redhat 7.3redhat 8.0下載後使用rpm命令安裝:[root@linux root]# rpm -ihv apt-0.5.4cnc9-fr1.i386.rpmfreshrpms.net同時提供了一個圖形介面的apt-rpm介面Synaptic,使用圖形介面的apt更加方便,安裝了apt後,可以直接利用apt安裝Synaptic:[root@linux root]# apt-get update[root@linux root]# apt-get install synaptic在幾行提示之後Synaptic就安裝好了,進入Xwindow,Synaptic會出現在“系統設定”選單裡面。[Fixme: redhat 7.x版本Synaptic出現在哪裡?]三、使用apt在redhat上面使用apt和在debian下面使用幾乎完全一樣,配置檔案在/etc/apt/,按照前面介紹安裝好apt之後就可以使用並可以更新redhat提供的RPM更新以及freshrpms.net提供的更新了。主要執行命令如下:(1)更新軟體列表,獲取遠端rpm伺服器上的軟體列表和相互依賴關係列表,所有可用軟體的下載地址都在/etc/apt/sources.list裡面定義,下面的多數下載操作地址也是在這裡定義的。[root@linux root]# apt-get update(2)檢查本地軟體依賴關係合法性,由於rpm系統的問題,很多系統會存在一些依賴問題,用下面命令檢查依賴關係,同時apt-get會提供一些修復方案,只有本機沒有依賴關係問題了才能良好地使用apt-rpm。一個新安裝的乾淨系統不會有依賴關係問題。[root@linux root]# apt-get check(3)安裝或升級一個新軟體[root@linux root]# apt-get install package-namepackage-name是rpm包的名字的前面部分,不包含版本號,如果選擇不同的處理器型別,可以在後面新增@i686等標識。(4)升級所有系統軟體[root@linux root]# apt-get upgrade(5)全面升級,比upgrade更加智慧化的升級,同時解決升級時的一些依賴關係[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以上所有命令都可以透過圖形介面的前端軟體Synaptic完成,圖形化的軟體使用起來更加直觀,理解了前面幾個主要命令,就可以毫無困難地使用Synaptic了,所以本文不再贅述Synaptic的使用方法了。四 定製apt-rpm(1)新增軟體資源列表在apt-rpm系統裡面新增軟體資源非常容易,只需要按照提供apt服務的伺服器的說明在/etc/apt/sources.list裡面加入對網站的描述即可。這一行引數的格式為:rpm uri distribution [component1] [componenent2] [...]其中,uri為軟體資源的地址,可以是http,ftp,file等URL地址,distribution是redhat發行版本,如 7.2,7.3,8.0等等,後面的component可以忽略。有時候可能只對某軟體資源的一或幾部分部分感興趣,那麼可以在這裡明確指出。例如新增/ 提供的redhat KDE 3.1的測試軟體包,只需要在sources.list裡面新增一行:rpm ftp://apt.unl.edu/apt/ 8.0 kde3-test就將該網站的kde3部分加入了列表。下面是一些目前可以用於redhat 的apt-rpm軟體資源列表,把它們加入你的 /etc/apt/sources.list 檔案就可以透過apt-rpm使用他們提供的redhat軟體更新和維護了,參看網站說明。(前面是網站名,後面是適用redhat版本和簡介)/ [/url] - Red Hat Linux 6.2, 7.x and 8.0 repositories (with all freshrpms included of course!) [/url] - Red Hat Linux 7.x repositories (with all freshrpms included too!)/ - Red Hat Linux 6.2, 7.x and 8.0 repositories - Red Hat Linux 6.2, 7.x and Rawhide repositories - Red Hat Linux 6.2, 7.x, 8.0 and Rawhide repositories - Red Hat Linux 7.2, 7.3 and 8.0 repositoriesftp://mirror.pa.msu.edu/apt/ - Red Hat Linux 7.2, 7.3 and 8.0 repositories - Red Hat Linux 7.2, 7.3 and 8.0 and gnomehide repositories - Red Hat Linux 7.2, 7.3 and 8.0 repositories - A few Red Hat Linux 7.2 custom packages~matt/repository.html - Lots of custom Red Hat Linux 8.0 GNOME 2 and related packages[url] - Red Hat Linux 7.x, 8.x and rawhide[url]/ - Red Hat Linux 7.3 and 8.0[url] - KDE for Red Hat project(2)把redhat安裝盤新增到軟體源有的時候需要從redhat安裝光碟或者iso檔案安裝、解除安裝軟體,這時可以把redhat安裝光碟設定為軟體源。這種工作方式需要首先掃面安裝光碟上的軟體包,並在 /var/lib/apt/cdroms.list檔案中建立光碟軟體列表。如果使用redhat光碟,只需要把光碟插入光碟機,下面命令會自動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五 例項(1)安裝mplayer[root@linux root]# apt-get install mplayerReading Package Lists... DoneCollecting File Provides... DoneBuilding Dependency Tree... DoneThe following extra packages will be installed:aalib libdv libdvdcss libdvdcss-devel libdvdread libdvdread-devel lircxvidcoreThe following packages will be upgradedlibdvdcss libdvdcss-devel libdvdread libdvdread-develThe following NEW packages will be installed:aalib libdv lirc mplayer xvidcore4 packages upgraded, 5 newly installed, 0 removed and 14 not upgraded.Need to get 5417kB/5471kB of archives.After unpacking 15.3MB of additional disk space will be used.Do you want to continue? [Y/n]Get:1 redhat/8.0/en/i386/freshrpms aalib 1.4rc5-fr1 [104kB]Get:2 redhat/8.0/en/i386/freshrpms libdv 0.99-fr1 [240kB]Get:3 redhat/8.0/en/i386/freshrpms libdvdread-devel 0.9.4-fr2 [63.4kB]Get:4 redhat/8.0/en/i386/freshrpms libdvdread 0.9.4-fr2 [56.3kB]Get:5 redhat/8.0/en/i386/freshrpms lirc 0.6.5-fr3 [373kB]Get:6 redhat/8.0/en/i386/freshrpms xvidcore 0.9.0-fr3 [159kB]Get:7 redhat/8.0/en/i386/freshrpms mplayer 0.90-fr0.5rc4 [4422kB]Fetched 5417kB in 31s (174kB/s)Executing RPM (-Uvh)...warning: /var/cache/apt/archives/aalib_1.4rc5-fr1_i386.rpm: V3 DSA signature: NOKEY, key ID e42d547bPreparing... ########################################### [100%]1:aalib ########################################### [ 11%]2:libdv ########################################### [ 22%]3:libdvdcss-devel ########################################### [ 33%]4:libdvdcss ########################################### [ 44%]5:libdvdread-devel ########################################### [ 56%]6:libdvdread ########################################### [ 67%]7:lirc ########################################### [ 78%]8:xvidcore ########################################### [ 89%]9:mplayer ########################################### [100%]注:有兩個包曾經下載過,所以本次不再下載。(2)安裝kde 3.1 for redhat 的測試包定義資源:為了簡單,把下面一行加入/etc/apt/sources.list,並暫時把其它資源列表註釋掉rpm ftp://apt.unl.edu/apt/ 8.0 kde3-test執行完整升級:[root@linux root]# apt-get dist-upgradeOK, 體驗一下KDE 3.1的新特性吧!六 其它資源 - General information and scripts to create repositories (focused initially on SuSE)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-939149/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 建立本地APT軟體包倉庫APT
- apt-get——Debian Linux發行版中的APT軟體包管理工具apt-getLinux
- Ubuntu 20.04中建立本地APT軟體包倉庫UbuntuAPT
- 將 DEB 軟體包轉換成 Arch Linux 軟體包Linux
- Linux軟體包轉換-deb與rpm互轉Linux
- Ubuntu 軟體安裝命令:aptUbuntuAPT
- 從 apt 升級中排除/保留/阻止特定軟體包的三種方法APT
- Ubuntu 系統下 apt-get 徹底解除安裝軟體包的方法Ubuntuapt-get
- 將RAC軟體轉換為單例項軟體單例
- 為dokcer中最簡版ubuntu(70M)增加apt安裝能力UbuntuAPT
- apt 和 dkpg 包管理工具APT
- 安全編碼為應用軟體增加免疫力
- apt-sortpkgs ——Debian Linux下對軟體包索引檔案進行排序的工具APTLinux索引排序
- alien將rpm格式的軟體包轉換為deb格式(或者反過來)
- [轉帖]【Linux】使用 apt-get 查詢並安裝指定版本的軟體Linuxapt-get
- redhat6.9增加swap交換空間大小Redhat
- ubutnu:apt安裝時報下列軟體包有未滿足的依賴關係APT
- 【Linux】apt軟體管理和遠端登入LinuxAPT
- Windows 軟體包Windows
- Ubuntu 的軟體管理工具Ubuntu
- 專用圖片管理工具:PowerPhotos Mac照片庫管理軟體 啟用安裝包Mac
- apt-clone:備份已安裝的軟體包並在新的 Ubuntu 系統上恢復它們APTUbuntu
- 包管理工具apt-get和yum的區別apt-get
- 使用 APT-mirror 四步配置 Ubuntu 本地軟體倉庫APTUbuntu
- apt-key ——管理Debian Linux系統中的軟體包金鑰APTLinux
- JetBrains 系列軟體漢化包AI
- Linux 的 軟體包的管理Linux
- Kali Linux搜尋軟體包Linux
- 【Linux】使用 apt-get 查詢並安裝指定版本的軟體Linuxapt-get
- 常用的軟體專案管理工具有哪些?專案管理
- 營銷CRM軟體(銷售管理工具)讓客戶都成為回頭客
- heic格式轉換軟體
- golang常用軟體包(長期更新)Golang
- linux下使用yum upgrade軟體包Linux
- Ubuntu.24軟體包的清理Ubuntu
- 阿里雲pypi軟體包預警阿里
- Linux軟體管理之RPM包1Linux
- Coherence X for Mac,將網站轉換為應用程式軟體Mac網站
- 為什麼傳統軟體廠商都想轉型做Saas?