Tech

How to install Linux applications from the command line


Linux is not nearly as difficult as you think. In fact, Linux has become one of the easiest to use desktop and server operating systems on the planet. How is that possible? For one thing, modern Linux distributions make it so that you never need to touch the command line interface. That’s right, you can do everything you need in a GUI with just a few clicks – just like you do with macOS and Windows. It is really easy.

And while you can certainly do everything from within well-designed GUI tools, there may come a time when you need (or just want) to use the terminal. Such a case can happen if you have deployed Linux as a server without a desktop environment. You may want to have a Linux server on your home LAN to deploy everything, including web servers, file servers, media streaming platforms, and more. Once there, you’ll need to know how to install applications from the command line.

For example, you want to install the Nextcloud cloud-based content management and collaboration platform. Or maybe you want to build an entire website from scratch and serve it through the Apache web server. You may even want to have a full LAMP (Linux Apache MySQL PHP) stack on your server.

Regardless of why, you’ll need to know how to install those apps from the CLI (command line interface). I will show you how. Take a look at our LAMP stack example to demonstrate how to do this on Ubuntu, AlmaLinux, Arch Linux, and openSUSE (will include most distributions).

Ready? Let’s go.

Install LAMP stack on Ubuntu-based distributions

Our first demonstration will be on a user-friendly Ubuntu distribution. Ubuntu uses the APT (Advanced Packaging Tool) package manager and makes installing a full LAMP stack extremely easy. The basic APT settings look like this:

sudo apt install PACKAGENAME -y

Where PACKAGENAME is the name of the software you want to install. Before running the install, you may want to update APT first with:

With APT updated, you are ready to install the LAMP stack. One of the useful tricks with Ubuntu and the LAMP stack is that you can install it all with one simple command, which is:

sudo apt install lamp-server ^ -y

If you don’t want to go that route, you can install the packages individually. First install the Apache web server with:

sudo apt install apache2 -y

Next, install the MySQL database server with:

sudo apt install mysql-server -y

You will then install the latest PHP version with:

sudo apt install php8.1-fpm php8.1 libapache2-mod-php8.1 php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8. 1-imageick php8.1-cli php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-intl php8.1-bcmath unzip -y

Of course, you can choose to do it all with the one-line command shown above.

Install LAMP stack on AlmaLinux

AlmaLinx is a distribution based on Red Hat Enterprise Linux, and the installation process requires you to install each package individually.

First, install the web server with:

sudo dnf install httpd -y

Next, install the MySQL database server with:

sudo dnf install mysql-server mysql -y

Finally, you install PHP with:

Install LAMP Stack on Arch Linux

Arch Linux is almost as user-friendly as Ubuntu or AlmaLinux. Arch Linux uses the pacman package manager and must first be updated with:

Once updated, install Apache with:

Next, install the MySQL database server with:

Finally, install PHP with:

sudo pacman -S php php-apache

The options used above are:

Install LAMP server on openSUSE

Finally, we will install the LAMP server on openSUSE, using the zypper package manager. Update zypper with:

Install Apache on openSUSE with:

sudo zypper install apache2

Install the MariaDB database with:

sudo zypper install mariadb mariadb-client mariadb-tools

Install PHP7 with:

sudo zypper install php7 php7-mysql apache2-mod_php7

General

With the exception of Arch Linux, software installation is usually handled as follows:

sudo PACKAGEMANAGER install SOFTWARE

Where PACKAGEMANAGER is the package manager used by the distribution and SOFTWARE is the name of the software to be installed.

The same is true for removing software, as in:

sudo PACKAGEMANAGER remove the SOFTWARE

Again, where PACKAGEMANAGER is the package manager used by the distribution and SOFTWARE is the name of the software to be installed.

To illustrate this better, you can install the Firefox web browser on each platform as follows:

  • Ubuntu – sudo apt install firefox -y

  • AlmaLinux – sudo dnf install firefox -y

  • openSUSE – sudo zypper firefox -y

Of course, with Arch Linux, that command would be:

sudo pacman -S firefox -y

And that’s really the basics of installing software from the Linux command line. It’s actually so easy that anyone who can type can install software from the Linux command line.



Source link

news7g

News7g: Update the world's latest breaking news online of the day, breaking news, politics, society today, international mainstream news .Updated news 24/7: Entertainment, Sports...at the World everyday world. Hot news, images, video clips that are updated quickly and reliably

Related Articles

Back to top button