Hi this is Phil from Make Tech Easier and welcome to how to install Linux software
on a Mac with MacPorts. MacPorts is a command-line package manager for macOS.
If you're familiar with apt-get or yum in Linux then you know what a package
manager does. It handles downloading, installing, updating and managing certain
applications and their dependencies within Mac OS. With MacPorts you can
install Linux applications on macOS from the command line.
What can I install? Most of these applications are open source command
line utilities but there are a fair share of real open source GUI based
applications as well. Like any package manager MacPorts searches the library of
downloadable software. When you find what you need to make ports downloads and
installs the appropriate software and dependencies in the right place. This
saves you the trouble of downloading repositories from GitHub and building
software from source packages while still getting access to a wide range of
Linux's best command-line tools and GUI applications. If you read our post on
Homebrew (link in the description) you know that macOS is missing some standard Linux terminal commands
out-of-the-box. Mac users won't find common command-line tools like nmap or
wget and there's no native package manager on the Mac to provide
them. You can also use Mac ports to install open source software like GIMP.
Installing MacPorts. MacPorts requires the latest version of
XCode for your OS version. You can download XCode from the Mac App Store or
Apple's developer website. (Links in the description.) Well you can run most of the
MacPort commands without XCode you won't be able to run many of the
packages until you install it. Installing XCode developer tools. First
open terminal and use the command below to trigger the installation of macOS
developers tools. Secondly click install in the pop-up box. Wait for the files to
download and install. Installing the MacPorts package. If you already have the
XCode and the developer tools installed you can jump right to this step. Firstly
download the latest release of MacPorts from GitHub.
Make sure you scroll down to choose the version that matches your version of macOS.
Install the package from your downloads folder. Open a new terminal
window and run the command "port". If that command returns MacPorts 2.4.1
and provides a slightly different looking command prompt then
you're ready to rock. Install Linux apps with MacPorts. To install some Linux app
on macOS with MacPorts we will first need to search for the relevant programs.
To see a gigantic list of all available packages open terminal and type "port
list" and press Enter.
Obviously that's a lot to look through. We can use the "port search" command to
find something specific. Let's search for nmap using the command "port search nmap".
That returns a few matching packages. The first one just called nmap is the
one we're looking for. To get more information about that package we can
use the info command. That returns some specific information about nmap. That all
looks good so we can install with the command "sudo port install nmap". Note
to the "sudo-" prefix which will require your admin password to fire. Depending on
the package you're installing there might be a large list of dependencies. These
are software packages that your desired port relies on and you'll need to
install them along with your port of choice. Type Y and press ENTER to accept
the installation. When the installation is complete you can run the command as
you would on Linux via terminal. Conclusion. MacPorts is a powerful
package manager that will connect you to a huge array of open source binaries and
applications that you can download and install on demand. If you want to learn
more of the applications commands you can check out the MacPorts guide for
more information. (Link in the description.) OK as always thanks for watching and
please subscribe and add your comments below. See you next time!

Không có nhận xét nào:
Đăng nhận xét