3.下载pkg包,解压后修改内容再次打包pkg

macos Monterey 无法安装hp打印机驱动,提示不支持 macos Monterey系统,修改验证内容,绕过验证

#!/bin/bash

# 下载hp驱动的dmg文件
curl -o  ./HPDriver5.1.dmg   https://updates.cdn-apple.com/2020/macos/001-41745-20201210-DBC9B46B-88B2-4032-87D9-449AF1D20804/HewlettPackardPrinterDrivers.dmg


hdiutil attach "./HPDriver5.1.dmg"   # 装载目录下的pkg包到系统中,默认装到  /volumes 下
pkgutil --expand /Volumes/HP_PrinterSupportManual/HewlettPackardPrinterDrivers.pkg "./expaneded"   #把pkg解压到指定的文件夹中  ,这里是 expaneded
hdiutil eject /Volumes/HP_PrinterSupportManual   # 卸载装载的pkg包对于上面的 hdiutil 命令

# Udpate 12.0 to 13.0
sed -i '' 's/12.0/13.0/' "./expaneded/Distribution"   # 修改Distributin的 内关于版本的需要,让mac12 可以安装hp打印机的驱动,也可以直接用vim修改

# Repack
pkgutil --flatten "./expaneded" "./HPDrivers5.1_Monterey.pkg"   # 把 expanded 目录打包为一个新的pkg包


# install the driver   # 使用命令直接安装pkg
sudo installer -pkg "./HPDrivers5.1_Monterey.pkg" -target /
posted @   mk-备忘  阅读(1035)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
点击右上角即可分享
微信分享提示