Linux下解压Mac OS的PKG文件

今天又看到了自己以前解压pkg时写的shell脚本,觉得还是挺有用的,记下来免得自己忘了。呵呵
需要用到的相关软件包,包括xtar和gzip。可以用下面的命令从网络上下载:

apt-get install xtar
apt-get install gzip

首先用xtar解压pkg文件,解压后的文件使用gz压缩,这时需要gz解开,最后得到的数据档案包就是能被cpio所接受的档案包。解压命令如下:

xar -xf file.pkg
mv out out.gz
gunzip out.gz
cat out2 | cpio –i

先用xtar解压pkg文件,把生成的文件改成gz后缀的文件名,再用gunzip解压,解压后的输出文件输入给cpio提取所有文件。

Join the Conversation

1 Comment

Leave a Reply to leland

Your email address will not be published. Required fields are marked *