Apple安装程序命令帮助bash脚本

时间:2014-08-20 16:11:28

标签: bash terminal installer

我正在尝试使用Apple Installer命令来安装软件包,输出结果是成功的,但最终结果是没有任何实际发生意味着软件包永远不会被安装或启动。有人可以查看命令并告诉我有什么问题,或者自己尝试看看会出现什么问题?

#Machines must have cURL installed as a prerequisite to download software from internet or FTP server 

#grab files from www.teamviewer.com or custom FTP server
curl -O http://download.teamviewer.com/download/TeamViewerHost.dmg

#Mount and Install TeamViewer
hdiutil mount /Users/TeamViewer/Downloads/TeamViewerHost.dmg
sudo cp -R "/Volumes/TeamViewerHost" /Applications

#Run installer
sudo installer -package /Applications/TeamViewerHost/Install\ TeamViewerHost.pkg -target "/Volumes/TeamViewerHost"

#Unmount package
cd ~
hdiutil unmount "/Volumes/TeamViewerHost/"

或者我尝试过的是同样的结果:

#Machines must have cURL installed as a prerequisite to download software from internet or FTP server 

#grab files from www.teamviewer.com or custom FTP server
curl -O http://download.teamviewer.com/download/TeamViewerHost.dmg

#Mount and Install TeamViewer
hdiutil mount /Users/TeamViewer/Downloads/TeamViewerHost.dmg

#Run installer
sudo installer -package /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target "/Volumes/TeamViewerHost"

#Unmount package
cd ~
hdiutil unmount "/Volumes/TeamViewerHost/"

需要通过终端在SSH上安装TeamViewer,但安装程序不是很好。任何帮助将不胜感激。提前致谢

1 个答案:

答案 0 :(得分:5)

执行命令

sudo installer -pkg /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target /

-target /意味着 - " root"用于安装包。

当你说-target "/Volumes/TeamViewerHost"它尝试安装到已安装的.dmg时,什么是只读而不是你想要的。

Ps:最好在apple.stackexchange上询问。

编辑:

刚试过下一个:

ssh me@myanothercomp.local
cd Downloads
curl -O http://downloadeu1.teamviewer.com/download/TeamViewerHost.dmg
hdutil mount TeamViewerHost.dmg
sudo installer -pkg /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target /

sudo / installer打印:

Password:
installer: Package name is TeamViewerHost
installer: Installing at base path /
installer: The install was successful.

并将TeamViewerHost.app安装到远程Mac上的/Applications