Install Notepad++ on Linux- Here are 2 Simple Methods

Install Notepad++ on Linux- Here are 2 Simple Methods

Notepad++ is a popular open-source code editor for Windows. With syntax highlighting support for over 80 languages and a ton of plugins, it has become the go-to text editor for many developers and programmers on Windows.

However, since Notepad++ is built only for Windows, Linux users don’t have access to it by default. But don’t worry, you can still install and run Notepad++ on Linux using Wine or Snap packages.

In this guide, we will discuss two easy methods to get Notepad++ running on Linux:

Method 1: Install Notepad++ on Linux Using Wine

Wine (Wine Is Not an Emulator) is a compatibility layer that allows installing and running Windows software on POSIX-compatible systems like Linux and macOS.

The advantage of using Wine is that it doesn't require you to have a Windows license or virtual machine. Wine translates Windows API calls into POSIX calls on the fly, so you can just install and run the Windows program directly on Linux.

Here are the steps to install Notepad++ on Linux using Wine:

Step 1: Install Wine

First, we need to add the WineHQ repository and install Wine on the system.

Open your Linux terminal and run the following commands:

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'  
sudo apt update
sudo apt install --install-recommends winehq-stable

This will add the official WineHQ repository, update your package lists and install the latest stable version of Wine.

Step 2: Set Wine Architecture

For best compatibility, we need to set Wine to use 32-bit architecture:

export WINEARCH=win32

You can also set the Wine prefix if you want to isolate the Notepad++ installation from other Wine programs:

export WINEPREFIX=~/.wine-notepad

Step 3: Download Notepad++ Installer

Go to the Notepad++ download page and grab the latest installer executable. For example:

wget -O Notepad++.exe https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.4.1/npp.8.4.1.Installer.x64.exe

Step 4: Install Notepad++ with Wine

Now we can install Notepad++ by running the installer executable with Wine:

wine Notepad++.exe

This will launch the Notepad++ setup wizard. Accept the license agreement and proceed with the default settings to complete the installation.

Once installed, you can launch Notepad++ on Linux by running:

wine ~/.wine-notepad/drive_c/Program\ Files/Notepad++/notepad++.exe

And that's it! You now have the latest Notepad++ installed on Linux using Wine.

Method 2: Install Notepad++ on Linux Using Snap

Snap packages provide an easier method to install Notepad++ on Linux. Unlike traditional packages, they bundle dependencies and auto-update independently.

Snaps work across many Linux distributions like Ubuntu, Fedora, Arch, etc. Here are the steps to install Notepad++ using Snap:

Step 1: Install Snapd

Make sure you have Snapd installed on your Linux distribution. To check, run:

snap --version

If it returns an error, you'll need to install Snapd first:

On Ubuntu/Debian:

sudo apt update
sudo apt install snapd

On Fedora:

sudo dnf install snapd

On Arch Linux:

sudo pacman -S snapd

Step 2: Install Notepad++ Snap

With Snapd installed, run the following command to install Notepad++:

sudo snap install notepad-plus-plus

This will download and install the official Notepad++ snap, which includes Wine bundled as part of the package.

Once installed, you can launch Notepad++ on Linux using:

notepad-plus-plus

The Snap package will auto-update Notepad++ in the background when new versions are released. To remove it, simply run:

sudo snap remove notepad-plus-plus

And that's all there is to it! The Snap method is cleaner and doesn't require installing Wine separately.

Getting Started with Notepad++ on Linux

Now that you have Notepad++ installed and running on Linux, here are some tips to get started:

  • Launch Notepad++ from the terminal, application menu or desktop shortcut.

  • The default theme may look a bit off. Go to Settings > Style Configurator to choose a better theme.

  • Install the Plugin Manager to easily find and add plugins.

  • Check out plugins like File Explorer, Compare, Markdown Viewer, etc. to extend the editor.

  • If plugins or macros don't work, make sure Wine is set to Windows 7 compatibility mode.

  • For better font rendering, try enabling DirectWrite in Notepad++ settings (requires Wine 4+).

  • Check AppDB for tips on resolving any potential issues.

And that's it! Whether you used Wine or Snap, you should now have the power of Notepad++ on Linux. No more missing your favorite Windows-only text editor!

Let me know in the comments if you found this guide helpful or if you have any trouble setting up Notepad++ on your Linux distribution. I'd be happy to help out!