Global Nav Open Menu Global Nav Close Menu; Apple; Shopping Bag +. From the Apple menu in the corner of your screen, choose About This Mac. You should see the macOS name, such as macOS Big Sur, followed by its version number. If you need to know the build number as well, click the version number to see it. Which macOS version is the latest?
How to install brew packages based on XCode, Ruby, Homebrew
This tutorial provides a deep dive of Homebrew,a package manager for Mac OSX (MacOS)that’s like other package mangers for Linux:
Distribution | Package Manager | Format | GUI tools |
---|---|---|---|
Darwin (macOS) | Homebrew | - | brew |
Debian, Ubuntu | dpkg | .deb | APT (Advanced Packaging Tool) |
RedHat, Fedora, openSUSE | RPM | .rpm | Yum, apt4rpm, up2date, urpmi, ZYpp, poldek |
Slackware | tgz | - | - |
Arch Linux, Frugalware, DeLi Linux | Pacman | - | - |
Puppy Linux | PETget | - | - |
Windows | Chocolatey | - | choco |
Step-by-step instructions are provided here to install Homebrew itselfand then install Homebrew packages based on the name of formulae specified for installationin a command such as:
brew install wget
DEFINITION: A formula provides instructions on how to install packages andtheir dependencies, such as where to find tar.gzip files for download.
Brew installs packages in its own Cellar directory (folder)and adds symlinks to the /usr/local folder.
Homebrew is the newest and most popular package utility on OSX.
Homebrew’s web page is at http://brew.sh
Make a full backup of your system right before following these instructions.
Open the App Store to install XCode, Apple’s IDE for developing Swift and Objective-C to run on iPhones and iPads.
PROTIP: Apple’s App Store only installs .app files. So programs invoked from the command line Terminal (such as gcc) need to be installed a different way.
To verify XCode CLI install:
This message means that it’s not installed:
Open a Terminal to install XCode CLI:
If XCode is not already installed, you are prompted to install it:
Installation is to folder: /Library/Developer/CommandLineTools/.
Homebrew requires OS X 10.5+ and the Xcode command line tools.
To download the Command Line Utilities, go to https://developer.apple.com/download/more/and look for your version of “Command Line Tools (macOS 10.14) for XCode 10”, one that doesn’t say “beta”.
Since the El Capitan version of Mac OSX, file permissions in /usr/local have changed,causing error messages such as:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
So in a Terminal shell window at any folder:
sudo chown -R :staff /usr/local
Verify installation by getting the version of the GNU Compiler Collection:
gcc --version
You should see something like this (for Mojave):
Homebrew makes use of Ruby, which comes with macOS.
Install Homebrew if you haven’t already.
CAUTION: Don’t press Enter on the Terminal until the Download Software dialog reaches 100%.
Press the Enter key to the message:
Press RETURN to continue or any other key to abort. then
To proceed, enter the root password, or type Ctrl+C to abort.
NOTE: The download is from
https://github.com/Homebrew/homebrew/
HISTORICAL NOTE: Previously, the Homebrew installer was at
https://raw.github.com/Homebrew/homebrew/go/install/
Identify where the Homebrew program itself is located:
The response is the brew executable program at:
The “brew” above is a shell script file.
PROTIP: The “/usr/local” is the default specified by the $HOMEBREW_PREFIX enviornment variable.
Identify where the Homebrew program stores packages:
The response:
Get Homebrew version:
The response (at time of writing):
NOTE: Homebrew is open-sourced at
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Common-Issues.md
To update Homebrew itself and its formulas:
brew update
brew update
Yes, run it twice to make sure all dependencies took.
Each run can take several minutes.
wget
iterm2
htop
geoip
nmap
Use an internet browser (such as Google Chrome)to view formula defined in
http://braumeister.org provides recent activity.
Install the wget command-line utility by formula name (for example, wget):
brew install wget
This installs to folder /usr/local/bin/wget.
See Tips & Tricks on how to use proxy, remove the beer mug emoji, highlighting within editors, etc.
Get a count of kegs, how many files, and the disk space they take:
A sample response:
List where .tar.gz “bottle” files are downloaded into from the internet:
DEFINITION: A “Bottle” is a pre-built binary Keg used for installation instead of building from source.It can be unpacked.
The response includes your user name, which enablesHomebrew to work without using sudo (elevation to root).
The equivalent of the above is:
List bottles downloaded:
Examples of responses:
List brew formulas installed:
ls /usr/local/Cellar
brew list
brew ls
The alternative commands above all do the same thing of the same folder,for example:
There is no response if no brew package has been installed.
See one level below one of the above folders for a specific formula,such as openssl:
It is usually a version number, such as:
DEFINITION: A “Keg” is the installation prefix of a formula, such as:
List brew package .rb (Ruby language) files installed:
The response is a long list.
List brew package folders:
brew search
The response is a long list.
Different ways to install weget.
The above is one of several ways to install the wget command-line utility.
One way is to install Apple’s Xcode.
Test wget operating:
cd ~/Downloads
wget http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
Verify brew installation:
brew doctor
If you see this message at the top of messages returned:
The above may occur if curl and nodejs were installed without using homebrew.
Remove them before installing node and curl using Homebrew:
Create symlinks to installations performed manually in Cellar. This allows you to have the flexibility to install things on your own but still have those participate as dependencies in homebrew formulas.
First, see what exactly will be overwritten, without actually doing it:
The response is:
“Keg-only” refers to a formula installed only into the Cellar and not linked into /usr/local, which means most tools will not find it. This is to avoid conflicting with the system version of the same package.
Alternately, if aswcli is specified for dry-run, the response is:
brew link
NOTE: Homebrew installs to the Cellar it then symlinks some of the installation into /usr/local so that other programs can see what’s going on.
A symlink to the active version of a Keg is called an “opt prefix”.
List where a link goes:
ls -l $(which wget)
If you see this message:
A sample response:
List formula (package definitions):
brew edit $FORMULA
The above command brings you to your default text editor (vim or whatever is specified in the $EDITOR variable).
Type :q to quit out.
List brew packages that are obsolete:
brew outdated
To stop a specific package from being updated/upgraded,pin it:
brew pin $FORMULA
$FORMULA is ???
To allow that formulae to update again, unpin it.
Download and update ALL software packages installed:
brew upgrade
To see which files would be removed as no longer needed:
brew cleanup -n
No response if there is nothing to clean. Otherwise, example:
To really remove all files no longer needed:
brew cleanup
A sample response:
PROTIP: Before deleting, identify its dependencies. For example:
Two delete commands does the same: Additional flags: `–force` or `-f` forcibly removes all versions of that package. `–ignore-dependencies` ignore dependencies for the formula when uninstalling the designated package, which may cause other brews to no longer work correctly.## Tap #Brew tap adds repos not in the Homebrew master repofrom inside a larger package.https://github.com/Homebrew/brew/blob/master/docs/brew-tap.mdsays tap adds to the list of formulae that brew tracks, updates, and installs from.0. List brew tap packages already installed: 0. Install the ip tool included with iproute2 on Linux: The command specififies the account and repo in GitHub, as inWhen you use your Mac notebook, its battery goes through charge cycles. A charge cycle happens when you use all of the battery’s power—but that doesn’t necessarily mean a single charge.
For example, you could use half of your notebook's charge in one day, and then recharge it fully. If you did the same thing the next day, it would count as one charge cycle, not two. In this way, it might take several days to complete a cycle.
Batteries have a limited amount of charge cycles before their performance is expected to diminish. Once the cycle count is reached, a replacement battery is recommended to maintain performance. You can use your battery after it reaches its maximum cycle count, but you might notice a reduction in your battery life.
Knowing how many charge cycles your battery has and how many are left can help you determine when a battery replacement is required. Your battery is designed to retain up to 80% of its original charge capacity at its maximum cycle count. For best performance, replace your battery when you reach its maximum cycle count.
Follow these steps to access information about your Mac notebook battery, including its cycle count:
Cycle count limits vary between Mac models. For help identifying your Mac notebook, use the Tech Specs page or these articles:
Use the table below to see the cycle count limit for your computer's battery. The battery is considered consumed once it reaches the limit.
Computer | Maximum Cycle Count |
MacBook | |
MacBook (Retina, 12-inch, 2017) MacBook (Retina, 12-inch, Early 2016) MacBook (Retina, 12-inch, Early 2015) MacBook (13-inch, Mid 2010) MacBook (13-inch, Late 2009) | 1000 |
MacBook (13-inch Aluminum, Late 2008) | 500 |
MacBook (Mid 2009) MacBook (Early 2009) MacBook (Late 2008) MacBook (Early 2008) MacBook (Late 2007) MacBook (Mid 2007) MacBook (Late 2006) MacBook (13-inch) | 300 |
MacBook Pro | |
MacBook Pro (13-inch, M1, 2020) MacBook Pro (13-inch, 2020, Two Thunderbolt 3 ports) MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports) MacBook Pro (16-inch, 2019) MacBook Pro (15-inch, 2019) MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports) MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports) MacBook Pro (15-inch, 2018) MacBook Pro (13-inch, 2018, Four Thunderbolt 3 ports) MacBook Pro (15-inch, 2017) MacBook Pro (13-inch, 2017, Four Thunderbolt 3 ports) MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) MacBook Pro (15-inch, 2016) MacBook Pro (13-inch, 2016, Four Thunderbolt 3 ports) MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports) MacBook Pro (Retina, 13-inch, Early 2015) MacBook Pro (Retina, 13-inch, Mid 2014) MacBook Pro (Retina, 13-inch, Late 2013) MacBook Pro (Retina, 13-inch, Early 2013) MacBook Pro (Retina, 13-inch, Late 2012) MacBook Pro (13-inch, Mid 2012) MacBook Pro (13-inch, Late 2011) MacBook Pro (13-inch, Early 2011) MacBook Pro (13-inch, Mid 2010) MacBook Pro (13-inch, Mid 2009) MacBook Pro (Retina, 15-inch, Mid 2015) MacBook Pro (Retina, 15-inch, Mid 2014) MacBook Pro (Retina, 15-inch, Late 2013) MacBook Pro (Retina, 15-inch, Early 2013) MacBook Pro (Retina, Mid 2012) MacBook Pro (15-inch, Mid 2012) MacBook Pro (15-inch, Late 2011) MacBook Pro (15-inch, Early 2011) MacBook Pro (15-inch, Mid 2010) MacBook Pro (15-inch, 2.53 GHz, Mid 2009) MacBook Pro (15-inch Mid 2009) MacBook Pro (17-inch, Late 2011) MacBook Pro (17-inch, Early 2011) MacBook Pro (17-inch, Mid 2010) MacBook Pro (17-inch, Mid 2009) MacBook Pro (17-inch, Early 2009) | 1000 |
MacBook Pro (15-inch Late 2008) | 500 |
MacBook Pro (15-inch, Early 2008) MacBook Pro (15-inch, 2.4/2.2GHz) MacBook Pro (15-inch, Core 2 Duo) MacBook Pro (15-inch Glossy) MacBook Pro (15-inch) MacBook Pro (17-inch, Late 2008) MacBook Pro (17-inch, Early 2008) MacBook Pro (17-inch, 2.4GHz) MacBook Pro (17-inch Core 2 Duo) MacBook Pro (17-inch) | 300 |
MacBook Air | |
MacBook Air (M1, 2020) MacBook Air (Retina, 13-inch, 2020) MacBook Air (Retina, 13-inch, 2019) MacBook Air (Retina, 13-inch, 2018) MacBook Air (13-inch, 2017) MacBook Air (11-inch, Early 2015) MacBook Air (11-inch, Early 2014) MacBook Air (11-inch, Mid 2013) MacBook Air (11-inch, Mid 2012) MacBook Air (11-inch, Mid 2011) MacBook Air (11-inch, Late 2010) MacBook Air (13-inch, Early 2015) MacBook Air (13-inch, Early 2014) MacBook Air (13-inch, Mid 2013) MacBook Air (13-inch, Mid 2012) MacBook Air (13-inch, Mid 2011) MacBook Air (13-inch, Late 2010) | 1000 |
MacBook Air (Mid 2009) | 500 |
MacBook Air (Late 2008) MacBook Air | 300 |
See these resources for more information about the batteries in your Apple notebook.