Installing the Nano Text Editor on Linux and Mac Systems

Back to Home Page


Before You Begin

This guide will only work for computers running Mac or Linux operating systems (OS). There's a good chance that you'll be aware of what OS your computer is on, if it is anything other than Windows. There's also a decent chance that if you're on one of these operating systems, that Nano is already installed. You can check for this by opening your terminal, and running:

nano demo.txt

If a little window pops up (and not an error message), then you already have it! Feel free to look at this Nano guide, where I explain how to use it. Otherwise, you can continue on!


What is Nano?

Nano is a simple text editor that works right in your command line. It's much easier to use than other command line editors, because the controls are simple. This is why I am recommending it, since I expect that you are all beginners! Nano should be all you need for this course--it will serve you well.


Installing Nano on Linux Systems

If you are on a Linux machine, there's a good chance that you'll have a program already installed on your machine, called apt. This is a package manager, which is kind of like your postal service worker, but for software. It is in charge of finding and bringing the right programs to your machine, whenever you ask it to.

Open Your System's Terminal

It will usually have an icon that looks something like this: >_. You will run a command that tells your package manager to find and install Nano.

  1. Navigate to the search bar and type in "Terminal", then click on the top result.
  2. Once you're in the terminal, you'll usually see a window with a little bit of text. This will allow you to type in commands, and run them.
  3. Type in:
    sudo apt update
    This tells the package manager to update itself. This will make sure that the software you install next is the latest and greatest version. Hit Enter once you're all finished.
  4. Then, type in:
    sudo apt install nano
    This command tells the package manager to find and install the Nano text editor onto your system. Hit Enter once you've typed it in.

    If this doesn't work, it's likely that you're using a specific kind of Linux that doesn't have apt. If you're using Fedora Linux, try this instead:

    sudo dnf install nano
  5. Type Yes or Y if it asks you to do so while the package is installing. The package manager is very careful to follow your instructions, so it will usually ask you to confirm everything unless you tell it not to by adding -y to the install command.
  6. Then, you're all done! Great job, you've installed Nano!

Installing Nano on Mac Systems

Mac systems use a different package manager called Homebrew (often just called "brew"). Let's first check if you already have Homebrew installed, and install it if you don't.

Open Your Terminal

  1. Open Finder
  2. Go to Applications → Utilities → Terminal
  3. Once you're in the terminal, check if you have Homebrew by typing:
    brew --version
    If you see a version number, you already have Homebrew! Skip to step 5.
  4. If you don't have Homebrew, install it by copying and pasting this command:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    Press Enter and follow any instructions it gives you.
  5. Now install Nano with:
    brew install nano
  6. That's it! You've installed Nano on your Mac!

What's Next?


Back to Home Page