My Linux FAQ

  • Установка статического IP адреса для сетевого адаптера

По умолчанию при установке задан параметр использовать DHCP для получения IP адреса. Для того, чтобы задать статический IP делаем следующее:

ifconfig

вывод списка сетевых интерфейсов, в нашем случае используется eth0

1. Создайте резервную копию файла /etc/network/interfaces, введя в терминале следующую команду:
cp /etc/network/interfaces /etc/network/interfaces.backup

2. Редактируем содержимое /etc/network/interfaces

# nano /etc/network/interfaces
Заменим
iface eth0 inet dhcp' на 'iface eth0 inet static

3. Добавьте следующие строки, подставив ваши значения IP адресов и других конфигураций, получится следующее:

iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
dns-nameservers 216.10.119.241

Сохраним изменения в файле

Отключим интерфейс eth0:
ifdown eth0
Затем включим eth0:
ifup eth0
Теперь сетевой адрес настроен.

Источник: http://ru.wikihow.com

 

  • Прописываем репозитории

Репозиторий — это хранилище программ и прочих файлов.

Итак, после установки Debian без указания статического IP или PROXY репозитории не обнаруживаются и как следстви не прописываются. Пропишем их вручную:

1. Ссылки на файл репозиторий можно сгенерировать на странице https://debgen.simplylinux.ch/

2. Добавить в sources.list ссылки на репозитории:
# nano /etc/apt/sources.list

последнюю строку оставить пустой, знак # в начале строки — означает комментарий, такие строки не обрабатываются

#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://deb.debian.org/debian/ stable main non-free
deb http://deb.debian.org/debian/ stable-updates main non-free
deb http://deb.debian.org/debian-security stable/updates main

Для сохранения нажать CTRL+O   ,  затем нажать Enter
Для выхода из программы нажать CTRL+X

3. Обновить список доступных пакетов:
# apt-get update

или

# aptitude update

Можно приступать к установке программ…

Примечание: некоторые репозитории подключаются только после скачивания специального ключа
(обычно где написан реп написано и как скачать ключ (key) )
в этом случае добавляем реп, скачиваем ключ, обновляем список пакетов, и устанавливаем что хотим…

Способ номер два:
#echo "deb ВАШ РЕПОЗИТОРИЙ"
Затем
#apt-get update
И ставим то, что Вам необходимо из репозитория

В случае, если у вас репозиторий на CD/DVD, добавить его можно так:
# apt-cdrom add
Источник

В качестве репозитория можно указать папку с обновлениями:

2.2 How to use APT locally

Sometimes you have lots of packages .deb that you would like to use APT to install so that the dependencies would be automatically solved.

To do that create a directory and put the .debs you want to index in it . For example:
# mkdir /root/debs

You may modify the definitions set on the package’s control file directly for your repository using an override file. Inside this file you may want to define some options to override the ones that come with the package. It looks like follows:
package priority section

package is the name of the package, priority is low, medium or high and section is the section to which it belongs. The file name does not matter, you’ll have to pass it as an argument for dpkg-scanpackages later. If you do not want to write an override file, just use /dev/null. when calling dpkg-scanpackages.

Still in the /root directory do:
# dpkg-scanpackages debs file | gzip > debs/Packages.gz

In the above line, file is the override file, the command generates a file Packages.gz that contains various information about the packages, which are used by APT. To use the packages, finally, add:
deb file:/root debs/

After that just use the APT commands as usual. You may also generate a sources repository. To do that use the same procedure, but remember that you need to have the files .orig.tar.gz, .dsc and .diff.gz in the directory and you have to use Sources.gz instead of Packages.gz. The program used is also different. It is dpkg-scansources. The command line will look like this:
# dpkg-scansources debs | gzip > debs/Sources.gz

Notice that dpkg-scansources doesn’t need an override file. The sources.list’s line is:
deb-src file:/root debs/

 

 

 

2.3 Deciding which mirror is the best to include in the sources.list file: netselect, netselect-apt

A very frequent doubt, mainly among the newest users is: «which Debian mirror to include in sources.list?». There are many ways to decide which mirror. The experts probably have a script that measures the ping time through the several mirrors. But there’s a program that does this for us: netselect

To install netselect, as usual:
# apt-get install netselect

Executing it without parameters shows the help. Executing it with a space-separated list of hosts (mirrors), it will return a score and one of the hosts. This score takes in consideration the estimated ping time and the hops (hosts by which a network query will pass by to reach the destination) number and is inversely proportional to the estimated download speed (so, the lower, the better). The returned host is the one that had the lowest score (the full list of scores can be seen adding the -vv option). See this example:
# netselect ftp.debian.org http.us.debian.org ftp.at.debian.org download.unesp.br ftp.debian.org.br
365 ftp.debian.org.br< #/code>

This means that, from the mirrors included as parameters to netselect, ftp.debian.org.br was the best, with an score of 365. (Attention!! As it was done on my computer and the network topography is extremely different depending on the contact point, this value is not necessarily the right speed in other computers).

Now, just put the fastest mirror found by netselect in the /etc/apt/sources.list file (see The /etc/apt/sources.list file, Section 2.1) and follow the tips in Managing packages, Chapter 3.

Note: the list of mirrors may always be found in the file http://www.debian.org/mirror/mirrors_full.

Beginning with the 0.3.ds1 version, the netselect source package includes the netselect-apt binary package, which makes the process above automatic. Just enter the distribution tree as parameter (the default is stable) and the sources.list file will be generated with the best main and non-US mirrors and will be saved under the current directory. The following example generates a sources.list of the stable distribution:
# ls sources.list
ls: sources.list: File or directory not found
# netselect-apt stable
(...)
# ls -l sources.list
sources.list
#

Remember: the sources.list file is generated under the current directory, and must be moved to the /etc/apt directory.

Then, follow the tips in Managing packages, Chapter 3.

Источник: apt-howto

https://debianforum.ru/

 

  • Сервер точного времени (настройка RTP)

http://howtoconfig.net/linux/debian-synchronize-time-ntp/

http://mydebianblog.blogspot.ru/2006/09/ntp.html

http://linuxnotes.ru/article/debian_ntp_sinhronizacia_vtemeni

  • GUI

https://xfce.org/

 

 

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS