Install from command line mac os

How to create a bootable installer for macOS

You can use an external drive or secondary volume as a startup disk from which to install the Mac operating system.

These advanced steps are primarily for system administrators and others who are familiar with the command line. You don’t need a bootable installer to upgrade macOS or reinstall macOS, but it can be useful when you want to install on multiple computers without downloading the installer each time.

What you need to create a bootable installer

  • A USB flash drive or other secondary volume formatted as Mac OS Extended, with at least 14GB of available storage
  • A downloaded installer for macOS Big Sur, Catalina, Mojave, High Sierra, or El Capitan

Download macOS

  • Download: macOS Big Sur, macOS Catalina, macOS Mojave, or macOS High Sierra
    These download to your Applications folder as an app named Install macOS [ version name ]. If the installer opens after downloading, quit it without continuing installation. To get the correct installer, download from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6. Enterprise administrators, please download from Apple, not a locally hosted software-update server.
  • Download: OS X El Capitan
    This downloads as a disk image named InstallMacOSX.dmg. On a Mac that is compatible with El Capitan, open the disk image and run the installer within, named InstallMacOSX.pkg. It installs an app named Install OS X El Capitan into your Applications folder. You will create the bootable installer from this app, not from the disk image or .pkg installer.

Use the ‘createinstallmedia’ command in Terminal

  1. Connect the USB flash drive or other volume that you’re using for the bootable installer.
  2. Open Terminal, which is in the Utilities folder of your Applications folder.
  3. Type or paste one of the following commands in Terminal. These assume that the installer is in your Applications folder, and MyVolume is the name of the USB flash drive or other volume you’re using. If it has a different name, replace MyVolume in these commands with the name of your volume.

Big Sur:*

Catalina:*

Mojave:*

High Sierra:*

El Capitan:

* If your Mac is using macOS Sierra or earlier, include the —applicationpath argument and installer path, similar to the way this is done in the command for El Capitan.

After typing the command:

  1. Press Return to enter the command.
  2. When prompted, type your administrator password and press Return again. Terminal doesn’t show any characters as you type your password.
  3. When prompted, type Y to confirm that you want to erase the volume, then press Return. Terminal shows the progress as the volume is erased.
  4. After the volume is erased, you may see an alert that Terminal would like to access files on a removable volume. Click OK to allow the copy to proceed.
  5. When Terminal says that it’s done, the volume will have the same name as the installer you downloaded, such as Install macOS Big Sur. You can now quit Terminal and eject the volume.

Источник

How to Update macOS Using a Simple Terminal Command

If you’re sick of waiting for the progress bar to complete every time you reboot after a macOS software update, then you’ll be pleased to learn there’s another way to update your Mac that could potentially reduce your downtime.

The process involves a simple Terminal command, and allows you to continue using your Mac as the update downloads and the initial software installation takes place in the background. In our tests, we found that this method was capable of shaving off several minutes of idle time during installation restarts, but that the time-saving depends on the machine and the update in question.

Читайте также:  Удалить дисковое пространство windows 10

Users with older Macs in particular will likely appreciate this tip, as it saves having to fire up the Mac App Store altogether, which can be slow-going and sometimes even downright unresponsive. Read on to find out how it’s done.

How to Update macOS From the Command Line

Before following these steps, ensure you have a full backup of your system, which should be par for the course when performing any update. Note that the following procedure only lists stock Apple system updates (iTunes, Photos, printer drivers the like), but not updates for other Apple apps that aren’t installed with macOS (Xcode, for instance), and not third-party updates from the Mac App Store.

    To update macOS from the command line, first launch Terminal, which can be found in the Applications/Utilities folder. This will open a Terminal window and a command prompt for you to begin typing.

Input the following command and press Enter: softwareupdate -l

  • Wait as your Mac searches Apple’s servers for any macOS software updates currently available for your system. If no updates are available, you’ll be returned to the command prompt.
  • Now let’s take a look at the command’s output. Available updates always appear as items in a list. In our example, only one update is available at this time, but every item follows the same format, as shown:


    The asterisked line denotes the individual software update package that’s available for your Mac to download. This line is also known as the identifier.


    The second line offers a more detailed description of the update, including the version number (usually in brackets) and the download file size in kilobytes. [Recommended] means the update is recommended for all users, and [restart] indicates that your Mac needs to reboot for installation to complete.

    To download and install a specific update in the list, use the following format, but replacing NAME with the update’s identifier:

    softwareupdate -i NAME

    softwareupdate —install NAME

    Note that if the package name you’re trying to install has spaces in it, you’ll need to enclose the whole thing in single quotes. So for example:

    softwareupdate —install ‘macOS High Sierra 10.13.3 Supplemental Update-‘

    Also, be alert for spaces at the end of the package names. If present, they also need to be included within the quotes.

    Moving on, to download a specific update for your system without also installing it then and there, you can use:

    softwareupdate -d NAME

    Updates downloaded in this way can be subsequently installed with the same -i or —install command above, or even through the Mac App Store. These updates are downloaded to a folder located in /Library/Updates, but they aren’t designed to be installed by double-clicking the packages in that directory. You’ll need to use the —install command or visit the Mac App Store to actually initiate the install.

    Lastly, to download and install all available updates for your system, type the command:

    softwareupdate -i -a

    Using these commands, you’ll be able to leave the update to download and continue to install in the background while you get on with other things. All being well, Terminal will eventually prompt you to restart your machine manually so that the full installation procedure can complete. (Note that the softwareupdate utility requires admin authentication for all commands except the -l or -list command. If you run softwareupdate as a normal admin user, you will be prompted for a password where required.)


    As some users will no doubt be aware, there are several additional options that can be used in conjunction with the softwareupdate utility. For example, -schedule on/off enables/disables your Mac’s scheduled background check for updates. More adventurous readers can use man softwareupdate and softwareupdate -h for a summary list of commands.

    Источник

    Install from command line mac os

    is that some packages (notably Fink) don’t work using this installer application. Kind of frustrating when you need a command-line app on a remote computer and you can’t install Fink in order to install the app! 🙂

    Читайте также:  Шрифт mac os sierra


    www.AcornWebDesigns.com
    Quality websites for inexpensive prices (Is that an oxymoron?)

    I also discovered this installer command the day that I read the recent article here about installing a no-ip linux client as a startup item. The .pkg that was pointed to by that article did not work via the command line. I had to do it from home. Even then it still didn’t seem to be workgin right, though, so I removed it and installed the fink version which seems to be working, once I understood how to set that version up. A fully working command-line installer is much needed, but if it works on some things now that’s still pretty good.


    — I hate Microsoft and I vote

    You have to run these packages (OS updates usually fall under this category) from root.

    cd /
    sudo /usr/sbin/installer -pkg /path/to/pkg.pkg -target /


    4am Media, Inc. Mac OS X Training and Consulting

    sudo reboot is a harsh command, I believe you’d use all unsaved documents, I wouldn’t recommend doing it this way.

    sudo osascript -e ‘tell application «Finder» to restart’

    Would be much better. It would get canceled if there is unsaved data.

    arr, but if your using the cli to install packages most likely the box is on a remote site, so u cant press «save» or «don’t save» and the restart would time out

    there has to be away of avoiding this because it would be nice to be able to restart and / or log out a user via the cli


    «The time has come,» the walrus said. «To talk of many things. «

    there is . use VNC to control the GUI remotely. for the few times I really need GUI access to my server remotely, it’s perfect. For security’s sake, don’t add a firewall rule to open the port. Tunnel the connection through ssh from the machine you’re sitting on . ssh -L 5900:localhost:5900 remote_ip_or_dns

    Then use localhost & port 5900 in your vnc client. You can have the remote machine always running the vnc server, or run it from the ssh shell.

    Of course, if you go this route, isntalling via the CLI is pointless since you can just do it via the GUI.

    The applescript is all very nice, but if no one is logged into the remote machine is does not work, the response is «29:36: execution error: Application isn’t running (-600)» (tested with OS X 10.3.5)

    This is great. Now if only I could create packages from the command line rather than using PackageMaker interactively.

    You can create packages from the command line. i’ve done it in 10.4, but haven’t tried in 10.5.

    in tiger, PackageMaker will load in /Developer/Applications/Utilities/PackageMaker.app
    but really all .app’s are just folders, so you can call the CLI by /Developer/Applications/Uitilities/PackageMaker.app/Contents/MacOS/PackageMaker

    you’ll have to feed it a number of flags like -build and -p. i think there’s a man page for it somewhere.

    If you look in /usr/sbin/ a couple of utils already stand out because of their name:

    AppleFileServer
    AppleSystemProfiler
    DirectoryService
    PasswordService
    installer
    softwareupdate
    am-eject
    nvram
    system_profiler
    appletalk
    asr
    bootparamd
    disktool
    screencapture
    diskutil

    You can find out what they do by looking at their man pages or running them (not as root obviously)

    Some of these don’t have man pages. Notably (for me):

    opendiff — run the cocoa diff utility on two files
    scselect — select network location
    disktool — I’m sure this does something handy

    You may also find installpkg to be helpful. Installpkg will allow you to easily install multiple packages with just a single command. If you have a collection of dmg’s each of which has an installer in the root directory, installpkg makes installing all the packages a snap.

    Источник

    Check and Install Mac OS X Software Updates from Terminal

    Want to update Mac OS software from the Terminal? You can check for available updates, ignore packages, and install any or all Mac OS X Software Updates directly from the command line.

    To see what updates are available for a Mac, or to install a software update from the Terminal of Mac OS X, amongst many other options including how to ignore particular updates, you’ll use the ‘softwareupdate’ command line tool as we’ll instruct below.

    Read on to learn about using the command line software update utility on the Mac.

    Читайте также:  Как восстановить запуск linux

    How to Check For & Install Mac OS Software Updates from the Command Line

    We’ll break this down into a few sections. First we’ll show you how to check for available software updates and get a list of all available Mac software updates from the command line. Then we’ll show you how to install software updates from the command line, including installing all updates, recommended updates, or a specific update.

    As this is using the command line, you will be using the Terminal application, found in /Applications/Utilities/ on all Macs. If you’re unfamiliar with the command line, it’s probably better to simply install software updates from the Software Update system preference or the Mac App Store.

    List All Available Mac Software Updates from Command Line

    To get a list of available software updates, type the following command in the Terminal:

    You will see a list of available updates.

    Installing All Available Mac OS Software Updates from Terminal

    You can then install all available software updates with the following command:

    sudo softwareupdate -iva

    The use of sudo is required to get superuser privileges to actually install the updates.

    You can also install only the recommended updates with:

    sudo softwareupdate -irv

    Installing Specific Software Updates to Mac from Terminal of Mac OS X

    You can also just install specific software updates by specifying the shorthand package name from the previous list retrieved from the softwareupdate tool, just point the command at a particular package and make sure the syntax matches up like so:

    sudo softwareupdate -i iPhoneConfigurationUtility-3.2

    We’ve discussed different but similar approaches to installing specific software updates this way before in the past, so this may be familiar to you already.

    How to Ignore Specific Software Updates from Terminal in Mac OS X

    If there are any available software updates you want to ignore, you can do so with the –ignore flag, pointed at the package you want to ignore, for example:

    sudo softwareupdate —ignore iWeb3.0.2-3.0.2

    What other software update commands are available in Terminal?

    If you want to see all the available command line options for Software Update, just type:

    Hit Return and you’ll see many other options for command line based software updates to MacOS, including how to set and clear the softwareupdate catalog, download but not install, cancel downloads, install, ignore, reset the ignore list, verbose mode, suspend options, pull logs from the softwareupdate daemon, and more, with the following output showing all options:

    ** Catalog Management:
    –set-catalog Set the new catalog URL (requires privileges)
    –clear-catalog Clear the catalog URL back to defaults (requires privileges)

    ** Manage Updates:
    -l | –list List all appropriate update labels (options: –no-scan)
    -d | –download Download Only
    -e | –cancel-download Cancel a download
    -i | –install Install
    (label) … specific updates
    -a | –all All appropriate updates
    -r | –recommended Only recommended updates
    –background Trigger a background scan and update operation
    –ignore (label) … Ignore specific updates
    –reset-ignored Clear all ignored updates

    ** Other Tools:
    –suspend-background (on | off) Suspend background operations from occurring temporarily (uses –duration)
    –duration (duration)) Optional duration in seconds to suspend background operations (defaults to 5*60 seconds)
    –dump-state Log the internal state of the SU daemon to /var/log/install.log
    ** Options:
    –no-scan Do not scan when listing or installing updates (use available updates previously scanned)

    -v | –verbose Enable verbose output
    -h | –help Print this help

    Optionally, you can use the softwareupdate man page:

    The command line approach to software updates is really useful for remotely updating Macs with ssh, setting up automated updates via a bash script, or if you just want to geek out.

    This tool is available in all versions of Mac OS X and macOS and therefore it can be used to update just about any Mac with necessary software updates.

    This is one way to avoid using the Mac App Store to update a Mac if that is necessary for whatever reason. Another would be to use Combo Updates for updating Mac system software, or getting other packages from Apple via the Support Downloads page.

    If you have any other tips or tricks for command line softwareupdate in Mac OS, share them in the comments below!

    Источник

    Оцените статью