美文网首页
在Mac使用终端命令安装DMG

在Mac使用终端命令安装DMG

作者: 毅个天亮 | 来源:发表于2017-07-07 16:07 被阅读1327次

    在一些场景下,比如SSH登录配置服务器时,需要使用终端命令来安装一些软件。
    安装的整体流程是:

    1. 切换到下载内容存放目录
    2. 下载DMG文件
    3. 安装DMG,默认在/Volumes/
    4. 复制.app/Applications/
    5. 推出安装卷轴
    # 1. 
    cd ~/Downloads
    
    #2. 下载
    curl -O resourceUrl
    
    # 3. 安装DMG,会安装到/Volumes下
    hdiutil attach xxx.dmg
    
    # 4.1 复制.app文件夹到Application下
    cp -rf ./xxx.app /Applications
    
    # 4.2如果是pkg
    sudo installer -pkg xxx.pkg -target /Application
    # 4.3 如果是.config、.sh文件则运行对应文件
    
    # 5. 推出
    hdiutil detach /Volumes/DarwinPorts-1.2/
    

    相关文章

      网友评论

          本文标题:在Mac使用终端命令安装DMG

          本文链接:https://www.haomeiwen.com/subject/phfrhxtx.html