Instruction for Debian. Part 2: initial setup

In the previous part I described how to install Debian GNU/Linux using a minimal ISO image and menu-based installer interface. Now it’s time for the second of the series about Debian GNU/Linux, and we’ll talk about fine-tuning a newly installed system.

Just specify that the text of this article will be very subjective. It displays my approach to setting up and optimization of the system, therefore we should not believe it as the truth. It’s like a collection of small tips separate linuksoida all interested in the subject.

It should also be noted that it is very desirable to start to read the first article of a trilogy about Debian GNU/Linux: I will refer to it somewhere.

I also prepared a General article about Debian. It is also a good idea to see.

If we understand each other, then let’s start!

1. Obligatory Preface

To start fine-tuning it is possible to use the already installed Debian GNU/Linux that we have installed in the first article of the series, for example. But there is another way — go back to the time when we chose the graphical environment in the installer and disable the selection, leaving the install a DE later.

I’m going to go in this article the long way (not the longest possible in Debian, by the way, but still very useful for you, especially if you just get used to GNU/Linux). All those who want to immediately go to system settings, you can scroll through the text several below to the section “3. Initial configuration of Debian GNU/Linux”.

And we will go back to the installer of the system.

2. Long way: go back to the installer

So, we have — already familiar to the screen to select operating system components. By default, it you select “Debian Desktop Environment” (GNOME) and several other (near them is Svetochka: *).

The selection screen of the system components

Let us, using the arrow keys and “space”, remove those same stars!

Leave it only near the position of the “Standard system utilities” as shown in the screenshot below.

Here is the minimum set of system

This will allow you to install is a “clean” Debian GNU/Linux and it is the most suitable for the initial setup and optimization. Will not install even a graphical environment, and other services, the installation of which you just cancel you have to anything.

Please note! My experience is that Debian GNU/Linux, which installed a “clean”, and then pulled at it, the graphical environment and all the other “Goodies”, works a little faster and eats less resources than a distribution that was installed with the package selection. Don’t know what it could be — perhaps even self-hypnosis however it is my personal opinion.

Well, now press the “Enter” and finish the installation according to the instructions from the previous article. After the system is installed, pull out the flash drive and reboot.

Installation complete

Now we are ready to configure the system!

3. Initial configuration of Debian GNU/Linux

After restarting Mashiny we meet the screen-greeting of the terminal (or graphical login Manager, if you are dealing with Debian GNU/Linux, installed the “classic” method) with the request to enter a user name and password.

I suggest at this stage to use the data of the user that has administrative privileges. If you read carefully the first article in my series, you probably already know what options there are only two: either on the initial stage of the installation you entered the root password (and then go into the system, accordingly, it is root), or the password you left blank.

In the second of the above-described cases, Debian GNU/Linux had to install sudo, also giving the only one created while in the user’s system — that is, you right to use it. But if you enter a root password in the installer, sudo, most likely, the system is missing.

Well, let’s assume the worst scenario: imagine that at the stage of installing the OS, you still entered the root password and, accordingly, the sudo utility is not established. So we now have it quick to put in and configure.

Those who sudo is, I suggest not to read the section “3.1. Installing and configuring sudo” and go to the next part of this article.

3.1. Install and configure sudo

Go to the system as root and using the appropriate password:

Entered as root

First and foremost, check the available updates in the repository and need to update the system:

apt update && apt full-upgrade -y

In my case Internet is working and no update needed

Thus we kill two birds with one stone: first, test the connection to the Internet and/or the efficiency selected during installation of the mirrors of the repositories, and secondly — actually, install the updates.

Now install sudo:

sudo apt install

Performed:

visudo

Before us in the nano text editor will open the configuration file sudo utility. Move around the text with the arrow keys and look for a line like this:

%sudo ALL=(ALL:ALL) ALL

We see that in the beginning is not worth #. This is very important! Why — is explained in the following paragraphs.

So, if # there — delete it; if you do not have a similar line — append it. You should get something like this:

So ideally the file should look like

When finished, vospolzuytes the key combination “Ctrl + X” to exit the text editor. Of course, nano will ask you to confirm or reject the changes — hit Y, and then, when still need to confirm the name of the changed file, press Enter.

Now let’s add our user to the sudo group:

adduser username sudo

Of course, there username is a variable, and in your case the user “name” in a completely different way. I, for example, like this:

Add your user to the sudo group

Now, let’s reboot. The time since then to work in the system as root makes no sense. And updates, if any, previously installed, you need to fully activate. Performed:

reboot

3.2. Connection non-free repositories

Wait for the screen of the introduction user data, and now boldly go under the name-password of our user, not as root:

Logged in with user having the right to sudo

Suggest to check if everything is working, perform any administrative action via the utilities sudo!

sudo apt update

Since you as a user, recently endowed with administrative privileges, use sudo for the first time, POPs up the warning message, the essence of which — please be careful on your shoulders now a huge responsibility, blah-blah-blah, La-La-La. Enter your password not the root password and my user password! and press “Enter”.

The same warning

If all the previous was done right, the administrative action we can do through sudo will fail.

Now let’s make vital changes to the configuration file of the package Manager apt, which allow you to install Debian GNU/Linux non-free packages and packages with non-free dependencies (by default, this great operating system supports only free software). This is very necessary in the case of whether the computer has some proprietary devices like video or sound card, adapter wireless networks wi-fi and sometimes even some specific models of the touchpad (the touchpad) for laptops.

About problems with drivers, by the way, he tells us Debian — boot system. If the interval between the choice of Debian GNU/Linux on the GRUB boot and before the screen-greetings you see on the screen some strange messages like those in the screenshot below, there are some problems…

Oops…

Please note! During boot you will also watch a string of the form “/dev/sdaХ: clean, XXXXXXX/XXXXXXX files, XXXXXXX/XXXXXXXX blocks“, where “X” will be different numbers. Don’t be afraid of it: it is a sign of a normal boot-indicates a successful verification of the hard drive with a special program. But just after it, as a rule, climb posts about problems with proprietaries.

Usually non-free drivers are in your title (or somewhere near it) the word-the prefix firmware. Remember her — she still need us. And in the meantime try to take a photo on a mobile phone these error messages, if any. These messages will help us to solve problems, and agree that it is stupid every time you restart the computer to see how exactly is a malfunctioning device.

Please note! If no error messages there, and the system works properly and without glitches — I do not advise to connect the non-free repository at all. Why? It is possible to do free software! Although this is more to question about the philosophy of the free software world and directly related to the subject of our conversation does not have… In any case, I advise you to use only free software, open source, and your right — to heed the advice or not.

In the command line interface (or terminal emulator if you are running a system with a graphical environment) using the free text editor nano will open the file /etc/apt/sources.list:

sudo nano /etc/apt/sources.list

Before us is a directory of repositories used by the operating system.

General view of the sources.list

Let’s examine the General principles of this file, then to make it easier to make changes to it.

First, we see the symbol #. It is important to know that in the world of UNIX-like operating systems, it often (as, in particular, and in the file sources.list) is used for the so-called comment out the line.

What does “comment out the line”? Placing the symbol # at the beginning, we will make sure that this particular line will not be perceived as part of the program code. That is, it just won’t read. After the lattices can be written in General anything. Usually programmers so leave your comments before or after the individual pieces of code with different explanations of their (piece of code) work. Hence the term “comment”: literally — to turn the line into a comment.

For clarity — here’s another example:

Take a look at the top part of the window

Having dealt with this, can just skip a few lines in our sources.list — the ones that are commented out. They’ve still not read by the system!

Let’s look at only those lines of the file that do not begin with#. They are all about the same view:

deb http://ftp.ua.debian.org/debian stretch main 
deb-src http://ftp.ua.debian.org/debian stretch main

and so on. What does it all mean?

Here’s a transcript of the syntax of these lines:

[repository] [address mirror repository (http or ftp)] [the code distribution name] [type storage]

Here:
View repository. This value tells the system to desired content repository with which it will work. For example: “deb” — the repository for Debian GNU/Linux “deb-src” repository for Debian GNU/Linux contains the source codes of the software;
The address of the mirror repository. This value we set during the installation phase, when pointed to the mirror with the highest speed to install his software. For example: “http://deb.debian.org/debian”;
Codename of the distribution. Here, I think, there is no need to go into details: the name of the article about Debian GNU/Linux we remember that the names of the characters the movie “Toy Story” — the developers have specifically named your OS version. For example: “stretch” — for the current stable version (which very soon will become “old stable”), “buster” for the current test branch (and she, in turn, will soon become “stable”, “sid” is the unstable batch basis (“unstable”), and so on.
The type of storage. Here you need using the spacebar to enter the names of the repositories in the repository to which you want to access. For example, the “main” — only free software, and “contrib” — free software with non-free dependencies “non-free” is not free.

(The colors displayed may vary.)

Now, focusing in the method of building the file, it is easy to activate non-free repository: you write wherever it is needed, their code names — “contrib” and “non-free”. Moving around the screen with the arrow keys, stand on the right place and start typing:

Here’s how I did it

When done, exit nano and save changes (remember: “Ctrl + X”, Y, “Enter”).

Now is the time to update the list of repositories again: we need to give the system to understand that you need to reload the configuration file as we had amended it!

sudo apt update

The process apt will output the results to the screen. If you look closely, you can see the line where there is a mention about “contrib” and “non-free”.

3.3. Optimization of the system

At this stage I recommend to follow the instructions described by me earlier in the article about improving bystrodeistviya, especially in settings use the region of the backup memory (swap). Here’s how it will look like just one long (composed of many) with the command:

One team! But read the article…

Please note! I specifically didn’t put this team above in the text. I highly recommend reading the already mentioned article about the optimization of the system! It will allow you to understand all of this just a perfect process.

3.4. Optimization of the GRUB boot

You may have noticed that during boot the computer appears a GRUB boot allowing you to choose the operating system, if you have several, or use advanced options menu, boot your Debian GNU/Linux. It looks something like this (in the system without a graphical environment):

Without graphics

Or here (in graphical environment):

With a graphics subsystem

This screen shows the default user within five seconds, to have time to make an informed choice, and then automatically activates the menu item by default. In addition, if you press any key (except “Enter”) within these five seconds the timer will stop and you will have to manually select the arrows the menu item, and then press “Enter”.

Five seconds is quite a bit you can be patient, but I prefer to remove the delay before auto-Debian GNU/Linux at all. You can reduce it to one second: if you really have a second OS, you will have time to switch to it or at least click the arrow to stop the countdown, and there it is easy to select the GRUB menu.

For a five-second showing of the GRUB is controlled by the line GRUB_TIMEOUT=5 in the file grublocated at /etc/default. It’s the change, instead of putting five desired value. Open the file /etc/default/grub with a text editor nano:

sudo nano /etc/default/grub

Find in the text to any appropriate string and change the value “5” to something else. I, for example, put a “0”.

Here’s how it turned out

Exit nano by his regular ways with saving changes. Since we just configured the GRUB boot loader, and it is a very important system component, you need to pass another protection system against accidental configuration changes. Performed:

sudo update-grub

Then reboot and observe the system load, fast for a few seconds.

3.5. Installed the proprietary drivers for the equipment

The time has come “X” — the elimination of present hardware conflicts!

This process may seem complicated, but actually it is enough to understand what’s missing from the system. These things usually are easy enough to obtain from non-free repositories, and sometimes the first two or three teams after the activation of the “contrib” and “non-free”.

Now you need to figure out what’s missing from the system. Error messages that pop up during boot of the system between the output of the check disk and the screen appears enter the system (be it graphic or text), should tell us where to dig. Remember, I even asked to take a picture of them on the phone?

Here’s to you for clarity, such a generalized type of error message:

firmware: failed to load the name of the driver.ucode (X)

Here:
the name of the driver.ucode is a variable that actually tells you what driver is missing;
X is a numeric value, the code output error.

For example, a message like “firmware: failed to load iwlwifi-8000C-21.ucode (-2)” reports that it would be nice to install proprietary software components for Wi-fi adapter produced by Intel®. This package called “firmware-iwlwifi” and established (with the active “contrib” and “non-free”) command:

sudo apt install firmware-iwlwifi -y

Of course, many of the manufacturers, so the packages you may need some others. In General, driver problems in Debian GNU/Linux easily solved via the Internet: enter a few words from the error string in your favorite search engine — you get the result. Here you can find out which packages you need to install from repositories “contrib” and “non-free” to eliminate the problem.

Please note that packages with the prefix firmware-* has enough:

The list of available packages firmware-*

Each of them meets the needs of drivers in the dozens, or hundreds of devices. That is why the driver in Debian GNU/Linux can always be found (see, the distribution is still very popular).

If nothing else helps, as present in the regular non-free repositories system packages do not solve problems — often searched the driver and instructions are on the official website of the developer hardware. Look there, but not in the first place, and only if you install native packages will not help.

Special attention is given to two manufacturer’s components of computers — nVidia® and AMD® (especially graphics cards). With them forever enough fuss GNU/Linux, because the drivers they churn very closed and unique. The availability of alternatives or work very crooked, or not at all. And there’s no drivers from the manufacturers website is not enough.

The author of the Linux kernel Linus Torvalds says what he thinks about the activities of nVidia

If you want to see the list of hardware of your computer, run:

lspci

or

lsusb

Afterword

Basic system setup is completed. These steps I take first when faced with the need to mount somewhere Debian GNU/Linux. It remains for me to remind you that this is my author’s approach, not claiming to be true is correct. I do. If you do something else — write in comments.

And in the next article of a trilogy about Debian GNU/Linux we will choose the graphical environment, install it, start to use the system and simultaneously doustanovit all sorts of Goodies that not once will help you with various tasks!

PS Command to shutdown computer without a graphical interface:

sudo shutdown-h now

Author: root
Image: from public sources, screenshots of the author

Source: linuxthebest.net

(Visited 91 times, 1 visits today)