制作mac安装盘 遇到错误 sudo: /Applications/Install OS X Yosemite.app/Contents/Resources/createinstallmedia: c

本文记录了解决在苹果Sierra系统中遇到的command not found错误的过程。起初认为是U盘路径设置的问题,尝试修改后仍然报错。进一步研究发现,是因为Sierra版本与网络上多数解决方案针对的Yosemite版本不同所致。
部署运行你感兴趣的模型镜像

开始以为是(自己U盘的)路径的错误,但改了几次,还是出现这个command not found


后来看了苹果官网的例子才发现,我安装的是sierra,而网友提供的多是 yosemite,版本不一样,导致的错误

https://support.apple.com/en-us/HT201372

您可能感兴趣的与本文相关的镜像

Llama Factory

Llama Factory

模型微调
LLama-Factory

LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调

当你遇到 `sudo: /Applications/Install macOS Sequoia.app/Contents/Resources/createinstallmedia: command not found` 这个错误时,通常是因为以下原因之一: 1. **安装程序路径错误**:确保你已经下载了正确的 macOS Sequoia 安装程序,并且它位于 `/Applications/` 目录下。 2. **安装程序未解压或损坏**:可能你下载的安装程序没有正确解压,或者文件被意外删除。 3. **权限问题**:当前用户可能没有足够的权限访问该路径。 以下是解决问题的步骤和代码示例: --- ### 解决方案 #### 第一步:确认安装程序路径 首先,检查 `/Applications/Install macOS Sequoia.app` 是否存在。如果不存在,请从 App Store 下载并安装 macOS Sequoia 安装程序。 ```bash ls /Applications/Install\ macOS\ Sequoia.app ``` 如果该路径不存在,请重新下载安装程序: ```bash softwareupdate --fetch-full-installer --installrosetta ``` #### 第二步:验证 `createinstallmedia` 工具是否存在 进入安装程序目录,检查 `createinstallmedia` 工具是否存在于指定路径: ```bash ls /Applications/Install\ macOS\ Sequoia.app/Contents/Resources/createinstallmedia ``` 如果工具不存在,说明安装程序可能损坏或不完整,需要重新下载。 #### 第三步:使用绝对路径运行命令 确保使用绝对路径调用 `createinstallmedia` 工具。以下是完整的命令示例: ```bash sudo "/Applications/Install macOS Sequoia.app/Contents/Resources/createinstallmedia" --volume /Volumes/macOS\ Sequoia\ Installer --nointeraction ``` 注意:路径中的空格需要用反斜杠 `\` 转义,或者将整个路径用双引号 `"` 包裹。 #### 第四步:检查权限 如果你仍然遇到权限问题,可以尝试以下方法: 1. 确保以管理员身份运行终端。 2. 使用 `chmod` 命令为安装程序赋予可执行权限: ```bash sudo chmod +x /Applications/Install\ macOS\ Sequoia.app/Contents/Resources/createinstallmedia ``` --- ### 示例代码 以下是完整的脚本示例,确保每一步都正确执行: ```bash # Step 1: Verify the installer exists if [ ! -d "/Applications/Install macOS Sequoia.app" ]; then echo "macOS Sequoia installer not found. Please download it from the App Store." exit 1 fi # Step 2: Create a disk image hdiutil create -o /tmp/SequoiaInstaller -size 8000m -volname "macOS Sequoia Installer" -layout SPUD -fs HFS+J # Step 3: Mount the disk image disk=$(hdiutil attach /tmp/SequoiaInstaller.dmg | grep -E '/dev/[a-z]+' | awk '{print $1}') volume=$(hdiutil attach /tmp/SequoiaInstaller.dmg | tail -1 | awk '{print $NF}') # Step 4: Create a bootable installer sudo "/Applications/Install macOS Sequoia.app/Contents/Resources/createinstallmedia" --volume "$volume" --nointeraction # Step 5: Convert to ISO hdiutil convert /tmp/SequoiaInstaller.dmg -format UDTO -o ~/Desktop/Sequoia.iso # Step 6: Rename the file extension mv ~/Desktop/Sequoia.cdr ~/Desktop/Sequoia.iso # Step 7: Unmount the disk image hdiutil detach "$disk" ``` --- ### 解释 1. **验证安装程序路径**: - 使用 `ls` 命令检查安装程序是否存在。 - 如果不存在,请从 App Store 或苹果官网重新下载。 2. **创建虚拟磁盘镜像**: - 使用 `hdiutil create` 创建一个空白的 DMG 文件。 - `-size 8000m` 设置磁盘大小为 8GB。 3. **挂载虚拟磁盘**: - 使用 `hdiutil attach` 挂载 DMG 文件,并获取挂载点路径。 4. **写入安装程序**: - 使用 `createinstallmedia` 工具将 macOS 安装程序的内容复制到虚拟磁盘中。 5. **转换为 ISO**: - 使用 `hdiutil convert` 将 DMG 文件转换为 UDTO 格式的 ISO 文件。 6. **重命名文件扩展名**: - 将 `.cdr` 文件重命名为 `.iso`,以便更直观地表示这是一个 ISO 文件。 7. **卸载虚拟磁盘**: - 使用 `hdiutil detach` 卸载挂载的虚拟磁盘。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值