Posts Tagged centos

Install Mercurial on CentOS5

最近看大家都在換 scm,我心動就也想換 Mercurial,因為有好幾個平台要裝,一開始在 ubuntu 裝的時候,很簡單的

sudo apt-get install mercurial

就可以了,簡單到後空翻。但是我換 CentOS 想用 yum 快速解決的時候,儼然發現 mercurial 不在 CentOS 的 packages 裡面,search 也 search 不到。
後來才發現原來 Mercurial 的官網就寫的很清楚了…

CentOS release 5 (final) – yum install mercurial from rpmforge repository, latest stable (1.0)

反正就是要 include source from rpmforge,這樣才會有 mercurial 可以裝:

首先要確認 priorities 已經裝好了,如果還沒:

yum install yum-priorities

然後要確定 yum-priorities 已經啟用,可以看 /etc/yum/pluginconf.d/priorities.conf 這個檔案裡是不是明確寫著 enabled=1,如果沒有的話就加上去,或是改成 1。

然後開始改 /etc/yum.repos.d/ 底下的 .repo 類型的檔案( 我是有兩個 ),加上各自的 priorities,官網 wiki 的建議設置如下:

[base], [addons], [updates], [extras]priority=1
[centosplus],[contrib]priority=2
Third Party Repos such as rpmforge … priority=N  (where N is > 10 and based on your preference)

然後去抓 http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm ( rpmforge 的 rpm ) 回來,開始做以下的動作:

Install DAG’s GPG key

rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Verify the package you have downloaded

rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

Install the package

rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys. At this point, you can set the priority of the RPMForge repository, and also of the CentOS repositories if you have not done so yet.

Test with this command:

yum check-update

應該會 print 出…

Loading "priorities" plugin

76 packages excluded due to repository priority protections

然後應該就可以 yum install mercurial 了,打完收工。

ref: CentOS Wiki

, , , ,

1 Comment

Add Sudoer

這是個 FAQ 文,Linux 弱如本人,寫教學文好像不是什麼好主意,所以只是個 FAQ 文。

關於 Add sudoer 這件事…每個 OS 都不太一樣,我自己是比較會 CentOS/Ubuntu。 Read the rest of this entry »

, , ,

No Comments