Ways to Install or Uninstall luarocks Ubuntu 22.04

Updated: October 11, 2022

This package contains LuaRocks, a tool for managing rocks. A Lua rock is a bundle containing a module and some metadata like compilation instructions and copyright. The command line utility luarocks can download, build, install and remove rocks, properly handling dependencies among them and allowing multiple versions of the same rock to coexist. In this guide, I will show you ways to install luarocks Ubuntu 22.04.

Prerequisites to install

  • Operating system: luarocks needs Ubuntu 22.04 to work
  • Privileges: Make sure you are able to execute sudo commands.

Prerequisites to install luarocks on Ubuntu 22.04

Install luarocks Ubuntu 22.04

luarocks is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install luarocks using APT

This is a popular method for installing Ubuntu packages since it’s simple to understand, even if you’re new to Linux. Following these instructions to get luarocks on your Ubuntu 22.04.

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt-get -y update

Step 2: Start installing the packages on Ubuntu 22.04. After updating the system, you can install luarocks Ubuntu by executing this command in the terminal.

sudo apt install luarocks

Install luarocks using Aptitude

Users can manage their installation, upgrade, and removal of packages with Aptitude and view a list of the packages that are currently available. If you haven’t already installed it on Ubuntu, run this command to do so.

sudo apt-get install aptitude

After installing, you can now install luarocks, just following these steps:

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Launch the terminal and enter the following Linux command:

sudo apt-get -y update

Step 2: Install the package on Ubuntu 22.04. After updating the system, you can now install luarocks Ubuntu by pasting this command into the terminal and pressing Enter.

sudo aptitude install luarocks

Uninstall luarocks on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu is difficult? You are mistaken; Anyone can easily uninstall any program, not just luarocks.

You can uninstall luarocks Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove luarocks

To uninstall luarocks and remove its data and dependencies, you can also use the following command:

sudo apt autoremove --purge luarocks

Summary

In this guide, I showed you ways to install luarocks on Ubuntu 22.04 and ways to uninstall luarocks too. Please contact me if you require any assistance. I’d be delighted to respond.