install nasm linux

Install NASM on Linux: A Comprehensive Guide

By Richard Lewis
AD

Are you looking to get started with the Netwide Assembly (NASM) assembler on your Linux system? You're in the right place. This comprehensive guide will walk you through the process of installing NASM on Linux in a step-by-step, easy-to-follow manner.

First, let's understand why you might need NASM. NASM is a powerful tool that allows you to write assembly language programs using either Intel or AT&T syntax. It's extensively used in Linux kernel development and other system-level programming. Now, let's dive into the installation process.

Installing NASM via Package Manager

Before we proceed, ensure your system is up-to-date.

AD
Installing NASM and Writing Your First Assembly Program on Linux
Installing NASM and Writing Your First Assembly Program on Linux
How to install Linux Mint 20
How to install Linux Mint 20
Accessing Linux Made Simple 🔐 | Console vs Terminal vs SSH Explained
Accessing Linux Made Simple 🔐 | Console vs Terminal vs SSH Explained

For most Linux distributions, NASM is available via the default package manager. Here's how you can install it:

Using APT (Ubuntu and Debian based systems)

Open your terminal and run the following commands one by one:

5 terminal commands I run on every fresh Linux install
5 terminal commands I run on every fresh Linux install
a laptop computer sitting on top of a desk with the words how to run a linux desktop using the windows subsytem for linux
a laptop computer sitting on top of a desk with the words how to run a linux desktop using the windows subsytem for linux
Projet NAS Linux: configuration post installation (8/12)
Projet NAS Linux: configuration post installation (8/12)
$ sudo apt update
$ sudo apt install nasm

After the installation is complete, you can verify it by writing nasm -v. It should display the NASM version you've just installed.

Using YUM (CentOS and Fedora based systems)

Use the following commands to install NASM on CentOS or Fedora:

AD
$ sudo yum check-update
$ sudo yum install nasm

After installation, you can verify it with nasm -v.

a penguin with the text 13 must - have apps for linux users
a penguin with the text 13 must - have apps for linux users
How To Install Linux
How To Install Linux
Linux nm Command Tutorial for Beginners (10 Examples)
Linux nm Command Tutorial for Beginners (10 Examples)
How to Install and Configure an NFS Server on Linux System
How to Install and Configure an NFS Server on Linux System
Linux Basics for Beginners 2026 | Complete Starter Guide
Linux Basics for Beginners 2026 | Complete Starter Guide
How to Install the Lumina BSD Desktop on Linux - Make Tech Easier
How to Install the Lumina BSD Desktop on Linux - Make Tech Easier

Installing NASM from Source

If NASM is not available via your package manager, or you need a specific version, you can compile and install it from the source.

First, download the latest version of NASM using wget or curl. For instance, to download version 2.15.05, use:

AD

wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2

I install these 11 apps on every new Linux system, and you should, too - here's why
I install these 11 apps on every new Linux system, and you should, too - here's why

After downloading, extract the archive and navigate to the extracted directory:

tar -xvf nasm-2.15.05.tar.bz2
cd nasm-2.15.05

Now, configure and compile NASM with:

AD

./configure && make

Finally, install NASM using:

sudo make install

Now you're ready to use NASM on your Linux system. Whether you're looking to learn assembly, write a bootloader, or dive into Linux kernel development, NASM is an essential tool for your toolbox.

Happy coding! Why not kickstart your NASM journey by writing a simple "Hello, World!" program in assembly language? The possibilities are endless.

AD