fbpx How to Install Programs on Ubuntu and Debian (apt/dpkg) | Certificação Linux

How to Install Programs on Ubuntu and Debian: apt, dpkg, and snap

📅 05/27/2022 ⏱ 6 min ✍️ Uira Ribeiro
Linuxhow-to
How to Install Programs on Ubuntu and Debian: apt, dpkg, and snap
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

You are just starting to use the Linux operating system and don't know how to install programs? We are going to teach you.

Over time, it has become much easier to install various programs on your Linux, Debian, and Ubuntu system.

There are several commands, such as apt and yum, that are responsible for making software installation easier.

In this article, we are going to teach you how to install programs on Linux in several different ways.

Follow along!

How to Install Programs on Debian and Ubuntu

There are several commands for downloading and installing packages on your Linux system. But, without a doubt, the most used is the apt-get.

apt-get is a very versatile command, as it can go to the repository and automatically install programs.

When entering the apt-get command, you can find a series of subcommands, each with a specific function.

The command updates packages, performs upgrades, installs, and removes according to the option you choose. 

The install subcommand, for example, is responsible for installing the program on your computer.

Using the command apt-get + install + nano, you can perform the complete download of the program you want.

The use of this command is interesting because it not only installs but also basically configures the application.

Another command used for installation on Debian and Ubuntu distributions is dpkg.

This command is a bit older, but still quite efficient. To use it, simply invoke the command and choose an option.

The -i option, for example, is responsible for installation. To install a program on Linux with the dpkg command, simply follow this formula:

dpkg -i nomedopacote.deb

Finally, another option for installing packages on Linux is through the aptitude command. 

This command is a graphical tool that displays installed packages, uninstalled packages, visual packages, and commands.

This way, you can browse uninstalled packages and choose one to install. 

If you are unsure how to navigate this graphical interface, simply click ctrl + h and you will have access to the commands.

Learn Different Ways to Install a Program on Linux

different ways to install a program on linux

We have already taught you how to install packages on Linux Debian and Ubuntu in the most common and simple ways. 

However, you should also learn how to do this in different ways. So, that is what we are going to teach you now:

Install Programs on Linux Through Repositories

Linux has some software repositories for simplified program installation. 

The repository is like the current online stores available in other well-known operating systems.

This is the main way to install applications on Linux, but it can still be limited because some programs are not available there.

To install through repositories, you use a package manager. The command for Ubuntu and Debian distributions is apt. 

If you want to install an application directly on the command line, simply use the command:

sudo apt-get install nomedoprograma.

Install Programs on Linux Through Universal Packages

Have you ever imagined being able to use programs regardless of the distribution or any package, whether .deb or .rpm?

This is possible with universal packages. These packages run on most distributions. 

An example of programs that offer universal package installation are Snap, AppImage, and Flatpak.

Install Programs on Linux Through Pre-configured Packages

Pre-configured packages are those already distributed in a ready-to-use file, that is, already configured. Additionally, they are usually made available in simple-to-install formats.

To install packages of this type, you can use a repository.

When downloading packages, you should double-click the file and then a graphical interface will open, indicating the necessary steps to complete the installation.

Another way to complete the installation of the downloaded package is through a terminal.

Install Programs on Linux via Installation Scripts

Some developers work with generic formats for their programs. It is possible to install these applications through a custom installer or a terminal.

To execute this installation on the terminal, however, you need to know the file's installation code.

With an installer, the process becomes quite simple, where you just need to follow the steps requested by the graphical interface.

Install Programs on Linux from the Program Source Code

This way of installing programs was widely used in the early years of Linux. It is still an available method and that is why we will teach you more about it.

Installation, in this case, occurs through the source code of a given program.

Some programs will be available in a compressed file. To install, the developer must compile and install the executables.

For this reason, it is a much more complex, time-consuming, and complicated method, especially for those who are just starting out.

Check out a complete tutorial that teaches you how to install programs on Linux directly from source code. 

Learn how to install a program on Linux via terminal

how to install a program on Linux via terminal

Do you want to install a program on Linux through the terminal? We've selected the best commands to do this, organized by distribution.

Check it out:

How to install programs on Linux Debian and Ubuntu

As introduced previously, the main command to install programs on Linux Debian and Ubuntu is apt. 

The syntax is:

sudo apt install nomedopacote

How to install programs on Linux CentOS/RHEL

In the case of CentOS and RHEL distributions, the package manager is yum. 

Thus, to install, use:

yum install nomedopacote

How to install programs on Linux Fedora

For the Fedora distribution, the package manager is dnf. 

In practice, the command is:

dnf install nomedopacote

How to install programs on Linux OpenSUSE

The OpenSUSE distribution uses the RPM package format, but has its own package manager, which is zypper. 

The syntax for installing programs on OpenSUSE via terminal is:

zypper install nomedopacote

How to install programs on other Linux distributions

Linux has several distributions. Besides the ones already mentioned, here's a list with installation commands for some popular distributions:

  • Arch Linux: pacman -S nomedopacote;
  • Gentoo: emerge --ask nomedopacote;
  • Void Linux: xbps-install -S nomedopacote;
  • Solus: eopkg install nomedopacote.

Learn how to install programs made for Windows on Linux 

For those who want to install on their Linux system programs available only on Windows, know that it's possible.

To do this, you need to download a layer called Wine, which is a kind of emulator.

Basically, this program translates Windows DLLs to Linux. 

To install Wine, open your command line and type:

sudo apt-get install wine

Once installed, all applications with the .exe extension will be opened through the program. 

Have you thought about learning everything about Linux and becoming a developer valued by the market? Linux Certification can help you with that!

Linux Certification: Linux courses with a fully didactic and applicable structure. Boost your career. Click and learn more!

Conclusion

This blog aimed to solve the main questions about installing programs on Linux, whether it's Ubuntu, Debian, or many other distributions.
If you enjoyed the content, we recommend reading this article: "Emulators for Linux: 8 excellent options to use".

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp