install nasm ubuntu

Install NASM on Ubuntu: A Step-by-Step Guide

By Matthew Taylor
AD

If you're interested in assembly language programming on Ubuntu, you'll need to install NASM (Netwide Assembler). This powerful tool is used to write x86 assembly code. Let's guide you through the process of installing NASM on Ubuntu.

Before we begin, ensure your Ubuntu system is up-to-date. Open a terminal and run the following commands:

Updating Your System

Updating your system ensures you have the latest packages and security patches.

AD
How To Install Neofetch System Information Tool In Ubuntu Linux
How To Install Neofetch System Information Tool In Ubuntu Linux
How to Install Ubuntu Touch on Android Device
How to Install Ubuntu Touch on Android Device
5 Ways to Install Software on Ubuntu - Make Tech Easier
5 Ways to Install Software on Ubuntu - Make Tech Easier

Run the following commands one by one:

Update the package list

sudo apt update

Upgrade the packages

sudo apt upgrade

Installing NASM

Now that your system is updated, let's proceed with installing NASM.

an image of a computer screen with windows on it
an image of a computer screen with windows on it
I stopped using Ubuntu for self-hosting and traded it for this lightweight alternative
I stopped using Ubuntu for self-hosting and traded it for this lightweight alternative
an image of a computer screen with the text 10 things to do after installing ubunt 20 04
an image of a computer screen with the text 10 things to do after installing ubunt 20 04

We'll use the APT (Advanced Package Tool) repository to install NASM. It's a native package manager for Ubuntu.

Add the i386 architecture

Though Ubuntu supports multi-arch, we need to manually add the i386 architecture to install 32-bit packages like NASM.

AD
sudo dpkg --add-architecture i386

Update the package list

After adding the new architecture, update the package list again.

10 Must-Have Ubuntu Apps Right After a Fresh Install
10 Must-Have Ubuntu Apps Right After a Fresh Install
an image of a purple wallpaper with icons on the screen and in the background
an image of a purple wallpaper with icons on the screen and in the background
7 Advantages Ubuntu Has Over Windows
7 Advantages Ubuntu Has Over Windows
an image of a computer screen showing the time and date for each event on it
an image of a computer screen showing the time and date for each event on it
How to Install Multimedia Codecs on Ubuntu Linux
How to Install Multimedia Codecs on Ubuntu Linux
sudo apt update

Install NASM

Now you can install NASM. Type the following command and press Enter:

sudo apt install nasm

Press 'Y' when prompted to confirm the installation, then press Enter. NASM will now be installed on your Ubuntu system.

AD

Verifying the Installation

To ensure NASM is installed correctly, you can check its version.

Type the following command and press Enter:

Check NASM version

nasm --version

The command should display the NASM version that is currently installed. If it does, you've successfully installed NASM on your Ubuntu system!

AD

Now that NASM is installed, you're ready to embark on your assembly language programming journey. Start by writing your first NASM program. Happy coding!

AD