当前位置: 首页 > article >正文

Mac OSX 卸载PKG包

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

mac osx上大多数应用程序都是通过.DMG或者.pkg来安装的(当然brew方式安装的除外),如果是通过DMG方式安装的软件,要删除它就挺简单,直接从osx的应用程序文件夹上删除即可。

那么pkg方式安装的软件又该怎么删除呢?

mac并没有提供什么快捷删除方式,我们只能找到pkg安装后产生的文件,然后删除它。

方式一

mac会维护一份pkg安装历史,只要找到那个文件夹,我们就可以对症下药了。

我的机子是osx 10.8.4,pkg历史安装列表在/private/var/db/receipts目录下,列出该目录,可以看到类似如下内容:

-rw-r–r– 1 root wheel 47315 6 15 15:48 com.codeius.izip.bom
-rw-r–r– 1 root wheel 253 6 15 15:48 com.codeius.izip.plist
找到.bom文件后,我们就可以使用以下命令找到安装的文件列表:

lsbom -pf com.codeius.izip.bom
执行上述命令后,输出了类似以下内容:

/iZip.app
./iZip.app/Contents
./iZip.app/Contents/CodeResources
./iZip.app/Contents/Frameworks
./iZip.app/Contents/Frameworks/libarchive.2.dylib
./iZip.app/Contents/Frameworks/libcurl.framework
./iZip.app/Contents/Frameworks/libcurl.framework/Headers
./iZip.app/Contents/Frameworks/libcurl.framework/Resources
./iZip.app/Contents/Frameworks/libcurl.framework/Versions
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/CodeResources
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curl.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlbuild.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlrules.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlver.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/easy.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/mprintf.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/multi.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/stdcheaders.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/typecheck-gcc.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/types.h
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Resources
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Resources/Info.plist
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/_CodeSignature
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/_CodeSignature/CodeResources
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/libcurl
./iZip.app/Contents/Frameworks/libcurl.framework/Versions/Current
./iZip.app/Contents/Frameworks/libcurl.framework/libcurl
./iZip.app/Contents/Info.plist
./iZip.app/Contents/MacOS
./iZip.app/Contents/MacOS/iZip
./iZip.app/Contents/PkgInfo
./iZip.app/Contents/Resources

以上找到的这些文件,就是安装pkg的时候产生的文件,这些文件删除了应该就ok了!(自行承担风险!)

方式二

方式一虽然可行,但是很多人都抱怨没找到pkg安装历史列表目录(确实不同版本的系统,目录是不一样的),那就试试方式二如下:

pkgutil命令这个时候就派上用场了。老规矩,先查看一下帮助,直接在命令行上执行pkgutil,看看有啥功能我们能用的(节选):

Receipt Database Commands:
–pkgs, –packages List all currently installed package IDs on –volume
–pkgs-plist List all package IDs on –volume in plist format

–files PKGID List files installed by the specified package

我们先找一下我们要删除的pkg包名(以上述iZip为例):

pkgutil –pkgs | grep -i izip
看一下输出了啥:

com.codeius.izip
ok,现在就可以找出izip pkg到底装了哪些文件:

pkgutil –file com.codeius.izip
终端输出的结果:

iZip.app
iZip.app/Contents
iZip.app/Contents/CodeResources
iZip.app/Contents/Frameworks
iZip.app/Contents/Frameworks/libarchive.2.dylib
iZip.app/Contents/Frameworks/libcurl.framework
iZip.app/Contents/Frameworks/libcurl.framework/Headers
iZip.app/Contents/Frameworks/libcurl.framework/Resources
iZip.app/Contents/Frameworks/libcurl.framework/Versions
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/CodeResources
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curl.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlbuild.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlrules.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/curlver.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/easy.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/mprintf.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/multi.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/stdcheaders.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/typecheck-gcc.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Headers/curl/types.h
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Resources
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/Resources/Info.plist
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/_CodeSignature
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/_CodeSignature/CodeResources
iZip.app/Contents/Frameworks/libcurl.framework/Versions/A/libcurl
iZip.app/Contents/Frameworks/libcurl.framework/Versions/Current
iZip.app/Contents/Frameworks/libcurl.framework/libcurl
iZip.app/Contents/Info.plist
iZip.app/Contents/MacOS
iZip.app/Contents/MacOS/iZip
iZip.app/Contents/PkgInfo
iZip.app/Contents/Resources

把这些文件删了应该就算卸载完毕。(risk on your own!)

方式三

哈哈,有的人要讲究效率,不喜欢折腾半天,就会问能不能一键搞定啊?真别说,还真有 http://www.corecode.at/uninstallpkg/,偶然发现这个东西,貌似不错,试用了一下,好像真成功卸载了。(就是不知道有没有卸载干净…)


转载于:https://my.oschina.net/moboxstudio/blog/514100

http://www.lryc.cn/news/2419372.html

相关文章:

  • uushare第二版功能详细介绍
  • ARM架构处理器MT6572的LK printf 与UART串口打印分析
  • 系统维护 电脑蓝屏代码大全
  • 鸿蒙HarmonyOS学习笔记之基于CommonDialog实现自定义PromptDialog
  • 蓝桥杯专题之日期篇
  • 基金01、03文件,92、94文件、52、53、59等文件是指什么?
  • 【正点原子MP157连载】第二十八章 A7和M4联合调试-摘自【正点原子】STM32MP1 M4裸机CubeIDE开发指南
  • [病毒分析]熊猫烧香(上)初始分析
  • 【python】sqlalchemy
  • VC++6.0 MSDN下载地址
  • DotNetTextBox V3.0 所见即所得编辑器控件Ver3.3.3 Free(免费版)
  • 高质量C++/C编程指南(林锐)
  • 四、六级考试的标准分计算方法-“710分转换表”
  • 移花接木!轻松搞定暴风影音2关联暴风影音1图标
  • 简单了解一下博弈论
  • Label换行
  • 内网信息收集与上传下载
  • 几个免费的国外php空间
  • 苹果最新系统ios7_手机资讯:你绝对不知道的iOS7隐藏功能
  • Scratch软件编程等级考试一级——20220320
  • Kali-登录暴力破解器工具-medusa使用
  • 基于flex的三层架构特效之效果介绍
  • 免费发布一个网站(保姆级图文教程)
  • Sqlserver 之 SequenceNumber(序列)
  • 转PDP-11时代 美国的大跃进运动
  • 老毛桃winpe优盘启动系统个性修改全攻略.(全)
  • WEP/WPA/WPA2/WPA3初识
  • 中华黑豹计算机病毒,关于中华黑豹病毒...-爱毒霸交流论坛
  • mplayer在CLI下收听网络广播和网络电视
  • Terminal Service License Server