Package Managers: Installing Software on Mac and Windows
If you’ve used Linux, there’s a good chance you’ve had to build software from source. There’s also a good chance you’ve had to wait a while for this to finish or spent some time tracking down a missing library. Each Linux distribution does things a little differently, which is sometimes just different enough to break a configure script. For users who just need to get their system up and running, this becomes a big hurdle. This was one of the motivations behind the development of modern package management systems.
If you’re on a Mac or Windows computer, you’ve probably had to install software, which involved:
- searching for software
- downloading an installer
- running the installer
- deleting the installer
If you set up new computers regularly, this can be a big waste of time. Download links are always moving and several popular programs now bundle additional software you don’t want which you have to opt out of installing. If you’ve been using Windows for a while, you may have had to click “OK” on a dialog asking you if you really want programs in Program Files hundreds of times. It’s easy to accidentally agree to something you don’t really want because you’re just trying to hurry through to accept the defaults in the wizard.
Package managers generally serve several functions:
- Searching for software
- Installing software
- Upgrading software
- Uninstalling software
Some are also able to specify dependancies and automatically ensure they are installed as well.
Systems such as the App Store or Windows Update fill some of these roles and are still needed for updating core system components. Sometimes they are targeted toward specific use cases and less broadly useful.
All the package managers below are primarily used via the command line.
Though there are other options for Mac, such as Fink and MacPorts, the most popular (for good reason) is Homebrew (often just called brew).
Homebrew is written in Ruby, a popular interpreted language that ships with all Macs and Git. The installation can be done in a single line in the terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After this, you can install packages from Homebrew by running:
brew install <package>
<package> is the name of the package. In general, if there is a command line tool you need, that will be the name of the package. For example, you can simply type
brew install wget or
brew install nmap to get those tools.
You can also install desktop applications via Homebrew Cask, such as:
brew cask install google-chrome
While far less well known, there is a Windows package manager that has been gaining in popularity - Chocolatey.
The name comes from a play on “chocolatey nougat,” as it is built on the NuGet package manager used to install packages for Microsoft .NET developers.
Unfortunately, installation requires a little bit more work, but is still fast and straightforward. You’ll need Windows 7 (Server 2003) or newer with PowerShell and .NET Framework installed (which is probably the case). Also, you’ll need to have permissions configured to run PowerShell scripts. Find the installation instructions here.
After install, you can run Chocolatey with the
choco install docker
If you’re running Linux, your package manager will depend on your distribution, but there are several major ones.