2004年12月28日 星期二

好用的 ar

[lang_zh]
原來 ar(1) 這麼好用!
剛才抓了 ATI radeon for linux 的 driver,
先用 alien 轉成 deb 之後,
要裝時才發現 dependency 出了一點問題。
有某一個檔案在 xlibmesa-gl 裡面已經有了 @_@
於是想到之前 kane 說過的 ar。


ar x XXX.deb 可以解開這個 archive,
並得到幾個檔案 (以我這邊的例子是 control.tar.gz data.tar.gz debian-binary)。
然後把 control.tar.gz 裡面的 control 加一下 Replaces、
包回去 control.tar.gz。
再來,
ar r XXX.deb control.tar.gz !!
可以把 XXX.deb 裡面的 control.tar.gz replace 掉!
再來就可以很高興地 dpkg -i XXX.deb 了 :D

當然還可以做其他像是..
delete, append 之類的、
還有 move, print 等等的,
不錯用 :p
[/lang_zh]

[lang_en]
Hey, ar(1) is such a useful stuff! I downloaded ATI radeon's driver for Linux, and use alien to convert it to deb. But something wrong about dependency happened when I try to install it. Some file had already been there in xlibmesa-gl @_@ Then I think of ar, what kane has mentioned before.

ar x XXX.deb will help you extract this archive, and you'll get several files (control.tar.gz, data.tar.gz, debian-binary in my case). What I did next is to add a /Replaces/ to the /control/ inside control.tar.gz and put it back.

The last step is ar r XXX.deb control.tar.gz !! It'll replace control.tar.gz inside XXX.deb with the given one! Finally, I can dpkg -i XXX.deb happily :)

Of course there are something useful such as delete, append, move, and print. They're helpful :)
[/lang_en]

沒有留言: