Installing Software On Debian

  1. Installing Software On Debian 10
  2. Debian Software Center

Nov 26, 2018  Backports are packages taken from the next Debian release (called “testing”), adjusted and recompiled for usage on Debian stable. This repository is not enabled by default, but the steps to do so are fairly straightforward. How to Enable Backports Repository on Debian. Open a terminal emulator, and find the codename of your Debian installation. Secure boot is now enabled by default, which means that you don’t have to disable it when trying to install Debian 10 on your machine; A lot of software updates: Apache 2.4.38, systemd 241, Vim 8.1, Python 3 3.7.2 and many more. Now that you know what’s available in the brand new Debian 10 buster distribution, it is time for you to install it. Here are the steps to install and configure Debian 10 buster.

Debian is an excellent Linux distribution, especially for servers. It is also a great distribution to run on a regular desktop computer or laptop. You very rarely encounter a bug on this operating system, and packages integrate exceptionally well with one another.

For example, you can easily switch to a different display/login manager, add another desktop environment or change other key components of your software stack. In contrast, you might get weird conflicts on other distributions when trying to switch default packages.

Why Debian Has Old Software

Here’s the short version, without too many technical details. Once most of the known bugs are removed, packages are frozen to a particular version. Most of them will never receive feature upgrades, only security fixes. This way, no new bugs get introduced, and the distribution can remain “stable.” To be stable means that what worked in a certain way one year ago will work exactly the same way next year on the same version of Debian. The advantage is that you get an operating system that (almost) never “breaks.” You can pull in the latest security fixes, and rest assured that your laptop or computer will work just fine the next day.

You don’t lose a lot by not having the latest version of everything. Most software doesn’t dramatically change in the course of two years. But some software does indeed change often and brings important improvements.

Sometimes, you may even require the latest version of something. This may be the case with a new video card you bought that doesn’t work without the latest driver. For such situations, Debian has a special repository where you can upgrade certain pieces of software that you absolutely need to have.

What Are Debian Backports?

Here’s how Debian’s official backports webpage describes what back-porting means:

Backports are packages taken from the next Debian release (called “testing”), adjusted and recompiled for usage on Debian stable.

This repository is not enabled by default, but the steps to do so are fairly straightforward.

How to Enable Backports Repository on Debian

Open a terminal emulator, and find the codename of your Debian installation:

Note: in this example the codename is “stretch.” If at the time you read this the codename is different, for example “buster,” replace every occurence where you see “stretch” with “buster.”

Debian’s APT package manager stores the list of repositories where it can download software in a file. View and edit this file with the following command:

At the end of the file, add the following line:

On Debian Buster the line would be: “deb http://deb.debian.org/debian buster-backports main contrib non-free.

Your APT sources list might not include the words “contrib” and “non-free.” In this case it means you don’t have some packages available. Among other things, such as the RAR archiver or Steam game platform, you will find drivers for your video card, Wi-Fi adapter and other hardware in “non-free.” If you need these, for example to play 3D video games or if your Wi-Fi isn’t working, enable “contrib” and “non-free.” Simply add the words at the end of each line, after “main.” The following is some text you can copy and paste:

Your sources.list file might also contain different URLs instead of “deb.debian.org.” Use “deb.debian.org,” as it has some advantages. It dynamically redirects you to a server close to you. Since it won’t always redirect you to the same server, there’s another advantage. If you use a static address, such as ” ftp.uk.debian.org/debian/,” if the server goes down, you won’t be able to download packages for that time.

With “deb.debian.org” that should no longer be an issue. It helps a lot, especially if you enable automatic upgrades. With a static server you might notice that your computer hasn’t been automatically updating for days or weeks, while the server was offline.

Empty Screen After Running “sudo apt edit-sources”

On some installations the default file “/etc/apt/sources.list” might be missing. In this case sudo apt edit-sources will show an empty screen. Repositories might be stored in a file at “/etc/apt/sources.list.d/base.list” instead. With the following commands, you can see files in that directory and their contents:

When you edit the default sources file with sudo apt edit-sources, don’t repeat the lines you see here. Only add what is missing. Copy the lines from those files, add them to “/etc/apt/sources.list” and then delete the files in “/etc/apt/sources.list.d/.”

How to Install Software from Debian Backports

Make the package manager pick up on your recent changes and update its database:

On Debian 9, codenamed Stretch, to install a newer Nvidia driver from backports, you would use this command:

On Debian 10, codenamed Buster, the command would be:

It’s not required to use the -V parameter, but it is useful in this case. This makes APT show version strings of the packages that it will install. It makes it easier to spot which packages will be pulled from backports and which will be pulled from regular repositories. Packages that contain the string “bpo” are from backports.

Find Versions Available for a Package

Debian

Not all packages have backports available. Only the ones which have important or necessary features in new versions are usually backported. You can quickly check if you can install a newer version for a package with the following command:

In this case you can see that Nvidia’s proprietary driver version 384 is available in Debian’s regular repository. A superior version, 390, is available in backports.

Debian

Debian’s list of backported packages can also help you check if a package has a backport available. Remember to adjust the URL in the future with the codename of your current Debian release. “https://packages.debian.org/stretch-backports/allpackages” will be “https://packages.debian.org/buster-backports/allpackages.

Conclusion

Consider upgrading an emergency method from backports. This means don’t overdo it. Install only the packages you really need, otherwise you might make your system unstable or generate conflicts between packages.

Ebooks

A “LAMP” stack is a collection of open-source software that is generally installed together to allow a system to deploy dynamic applications. This term is an acronym which describes the Linux operating system, Apache web server, a MariaDB database, and PHP programming.

Read Also: How to Install LEMP on Debian 10 Server

Although this “LAMP” stack usually involves MySQL as the database management system, some Linux distributions such as Debian — use MariaDB as a drop-in replacement for MySQL.

Requirements

In this article, we will show you how to install a LAMP stack on a Debian 10 server, using MariaDB as the database management system.

Installing Apache Web Server on Debian 10

The Apache web server is an open-source, powerful, reliable, secure, highly-extensible and widely used HTTP server software for hosting a website.

To install Apache, use Debian’s apt package manager as shown.

When the Apache installation is complete, the installer will trigger systemd system and service manager to start the Apache2 service for now and enable it to automatically start at system boot.

To check if the Apache service is up and running fine, run the following systemctl command.

Check Apache Status in Debian 10

You can also start, stop, restart and get the status of Apache web server using the following systemctl commands.

If you’ve ufw firewall running, you need to open port 80 (www) and 443 (https) to allow incoming traffic on Apache.

Now you need to test if Apache is properly installed and can serve web pages. Open a web browser and use the following URL to access the Apache Debian Default Page.

Check Apache Web Page

Installing MariaDB on Debian 10

Once Apache web server up and running, you need to install the database system to be able to keep and manage data for your website.

To install MariaDB, use Debian’s apt package manager as shown.

Once MariaDB installed, it is recommended to run the following security script that will remove some insecure default settings and disable access to your database system.

The above security script will take you through a series of following questions where you can make some changes to your MariaDB setup as shown.

Secure MariaDB in Debian 10

Installing Software On Debian

If you want to create a database named 'tecmint_wpdb' and a user named 'tecmint_wpuser' with full privileges over the database, run the following commands.

You can confirm if the new user has the full permissions on the database by logging in to the MariaDB with user credentials as shown.

Installing Software On Debian 10

Installing PHP 7.3 on Debian 10

PHP (Hypertext Preprocessor) is a popular scripting language used to build the logic for displaying web content and for users to interact with the database.

To install the PHP package, run the following command.

Install PHP in Debian 10

If you want to install additional PHP modules, you can search and install using the combination of apt-cache command and grep command as shown.

Debian Software Center

Now reload Apache’s configuration and check the status with the following commands.

Reload Apache Configuration

Testing PHP Processing on Apache

We will be creating a simple PHP script to verify that the Apache can process requests for PHP files.

Add the following PHP code, inside the file.

When you are done, save and close the file.

Now open a browser and type the following address to see whether your web server can show content created by this PHP script.

If you see the above page in your web browser, then your PHP installation is working as expected. Also, this page shows some basic details about your PHP installation and it is useful for debugging purposes, but at the same time it will also show some sensitive information about your PHP.

So, it is highly recommended to delete this file from the server.

Conclusion

In this article, we’ve explained how to install Linux, Apache, MariaDB, and PHP(LAMP) stack on a Debian 10 server. If you have questions about this article, feel free to ask in the comment section.