RTFM.WIKI

Ordnung muß sein. Ordnung über alles (18+)

Инструменты пользователя

Инструменты сайта


Stylesheet conf/userstyle.css not found, please contact the developer of "dokuwiki_2024" template.
linux:ubuntu:ubuntu_tnt

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

linux:ubuntu:ubuntu_tnt [2021/06/03 17:05] – создано dxlinux:ubuntu:ubuntu_tnt [2024/11/04 16:01] (текущий) dx
Строка 1: Строка 1:
 +====== Ubuntu разное ======
  
 +===== HowTo - Как сделать xyz? =====
 +
 +==== Обновить ядро без обновления всей системы ====
 +
 +https://askubuntu.com/questions/119080/how-to-update-kernel-to-the-latest-mainline-version-without-any-distro-upgrade
 +
 +Скачать deb отсюда - http://kernel.ubuntu.com/~kernel-ppa/mainline/
 +
 +  * linux-headers-VERSION-NUMBER_all.deb
 +  * linux-headers-VERSION-NUMBER_amd64.deb
 +  * linux-image-VERSION-NUMBER_amd64.deb
 +  * linux-image-extra-VERSION-NUMBER_amd64.deb
 +
 +Установить
 +
 +<code># cd download-path && dpkg -i *.deb</code>
 +
 +==== Где rc.local ====
 +
 +On newer Ubuntu versions systemd is used and /etc/rc.local is not loaded always by default.
 +
 +Check if the Compatibility service is loaded with
 +
 +<code>systemctl status rc-local.service</code>
 +
 +via https://askubuntu.com/a/759821
 +
 +[[https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd|Как включить rc.local если у вас systemd]]
 +
 +==== Как посмотреть changelog пакета ====
 +
 +Оказывается до ужаса просто
 +
 +<code>$ apt-get changelog package_name</code>
 +
 +==== Шпаргалка ====
 +
 +{{:linux:ubuntu_command_sheet.png?direct&200|}}
 +
 +===== Ошибки =====
 +
 +==== UFW не блокирует подсеть ====
 +
 +Например нужно заблокировать соединения к 80 порту
 +
 +<code bash>ufw deny proto tcp from 203.0.113.0/24 to any port 80</code>
 +
 +Вероятнее всего уже есть allow правило.
 +
 +Смотрим текущие правила
 +
 +<code bash>ufw status numbered</code>
 +
 +Добавляем правило выше
 +
 +<code bash>ufw insert 1 deny proto tcp from 203.0.113.0/24 to any port 80</code>
 +
 +==== kernel BUG at linux-4.15.0/drivers/net/xen-netfront.c:909! ====
 +
 +VPS в Xen работает нестабильно, kernel panic итд.
 +
 +Проблем нет с ядром 4.15.0-46\\
 +Не работает с 4.15.0-47 по 4.15.0-55
 +
 +https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1837751
 +
 +==== Неверный размер файлов в RDP (Remmina) ====
 +
 +Система Linux Mint, 32bit. Подключаем в Remmina (RDP) локальный каталог, в итоге на удаленном сервере файлы даже 1 КБ имеют размер в несколько гигабайт.
 +
 +Как это выглядит - [[https://github.com/FreeRDP/Remmina/issues/1166|RDP remote files are listed with huge wrong size under 32bit client platforms]]
 +
 +Баг на github - [[https://github.com/FreeRDP/FreeRDP/issues/3939|Remote files are listed with huge wrong size under 32bit client platforms]], еще один [[https://github.com/FreeRDP/Remmina/issues/1174|https://github.com/FreeRDP/Remmina/issues/1174]]
 +
 +Проблема проявляется в версии 1.2.0-rcgit-18 (git rcgit-18) из репозитория https://launchpad.net/%7Eremmina-ppa-team/+archive/ubuntu/remmina-next, который [[https://github.com/FreeRDP/Remmina/wiki|указан в wiki]]
 +
 +С версией из стандартного репозитория Mint размер файлов верный
 +
 +<code>
 +$ dpkg -l remmina
 +||/ Имя Версия Архитектура Описание
 ++++-==============-============-============-=================================
 +ii remmina 1.1.2-3ubunt i386 remote desktop client for GNOME d
 +</code>
 +
 +[[https://github.com/FreeRDP/FreeRDP/issues/3913|Патч]] для отважных джедаев компилирующих версию из git.
 +
 +==== Aborting downgrade from (at least) 5.6 to 5.5 ====
 +
 +При переустановке пакета mysql-server появляется ошибка ''Aborting downgrade from (at least) 5.6 to 5.5'' или ''Aborting downgrade from (at least) 5.5 to 5.1''
 +
 +//This is not a bug, you must remove /var/lib/mysql/debian-5.6.flag file//
 +
 +Удаляем файл ''debian-5.*.flag'' и повторно запускаем ''apt-get install''
 +
 +==== sudo: unable to stat /etc/sudoers: Permission denied ====
 +
 +Ошибка
 +
 +<code>
 +sudo: unable to stat /etc/sudoers: Permission denied
 +sudo: no valid sudoers sources found, quitting
 +sudo: unable to initialize policy plugin
 +</code>
 +
 +Смотрим права 
 +
 +<code>
 +root@vm1753:/# ls -la
 +total 1049708
 +drw-------  23 root root       4096 Dec  7 16:58 .
 +drw-------  23 root root       4096 Dec  7 16:58 ..
 +drwxr-xr-x   2 root root       4096 Nov 27 06:27 bin
 +drwxr-xr-x   3 root root       4096 Nov 27 06:25 boot
 +drwxr-xr-x   3 root root       4096 Sep 13  2015 build
 +drwxr-xr-x  13 root root       3860 Dec  7 17:22 dev
 +drwxr-xr-x 116 root root      12288 Dec  7 17:22 etc
 +drwxr-xr-x   2 root root       4096 Apr 10  2014 home
 +lrwxrwxrwx   1 root root         34 Nov 27 06:25 initrd.img -> boot/initrd.img-3.13.0-101-generic
 +lrwxrwxrwx   1 root root         33 Sep 13  2015 initrd.img.old -> boot/initrd.img-3.13.0-24-generic
 +drwxr-xr-x  21 root root       4096 Nov 27 06:26 lib
 +drwxr-xr-x   2 root root       4096 May 26  2016 lib64
 +drwx------   2 root root      16384 Sep 13  2015 lost+found
 +drwxr-xr-x   2 root root       4096 Apr 18  2014 media
 +drwxr-xr-x   2 root root       4096 Apr 10  2014 mnt
 +drwxr-xr-x   3 root root       4096 Jan 21  2016 opt
 +dr-xr-xr-x 129 root root          0 Dec  7 17:22 proc
 +drwx------  13 root root       4096 Nov 27 06:57 root
 +drwxr-xr-x  22 root root        720 Dec  7 18:33 run
 +drwxr-xr-x   2 root root      12288 Dec  7 17:18 sbin
 +drwxr-xr-x   2 root root       4096 Apr 18  2014 srv
 +-rw-------   1 root root 1073741824 Dec  7 16:59 swapfile
 +dr-xr-xr-x  13 root root          0 Dec  7 17:22 sys
 +drwxrwxrwt   6 root root       4096 Dec  7 18:40 tmp
 +drwxr-xr-x  10 root root       4096 Apr 18  2014 usr
 +drwxr-xr-x  12 root root       4096 Sep 13  2015 var
 +lrwxrwxrwx   1 root root         31 Nov 27 06:25 vmlinuz -> boot/vmlinuz-3.13.0-101-generic
 +lrwxrwxrwx   1 root root         30 Sep 13  2015 vmlinuz.old -> boot/vmlinuz-3.13.0-24-generic
 +</code>
 +
 +Для / установлен chmod 600. Чиним права
 +
 +<code># chmod 755 /</code>
 +
 +sudo вновь доступен.
 +
 +==== quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option. ====
 +
 +Ubuntu 14.04, ISPmanager 5 Lite
 +
 +При включении дисковых квот ошибка
 +
 +{{:linux:ispmanager_ubuntu_quota.png?nolink&600|}}
 +
 +Лог ispmgr
 +
 +<code>
 +Preparing to unpack .../ispmanager-pkg-quota_5.78.2-2-ubuntu14_all.deb ...
 +quotaoff: Mountpoint (or device) / not found or has no quota enabled.
 +quotacheck: Mountpoint (or device) / not found or has no quota enabled.
 +quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.
 +Can not check quota
 +dpkg: error processing archive /var/cache/apt/archives/ispmanager-pkg-quota_5.78.2-2-ubuntu14_all.deb (--unpack):
 + subprocess new pre-installation script returned error exit status 1
 +Errors were encountered while processing:
 + /var/cache/apt/archives/ispmanager-pkg-quota_5.78.2-2-ubuntu14_all.deb
 +E: Sub-process /usr/bin/dpkg returned an error code (1)
 +</code>
 +
 +Пакет quota установлен.
 +
 +''/etc/init.d/quota start'' не срабатывает.
 +
 +И ещё один сюрприз - нет файла ''/etc/fstab'', точнее он пуст
 +
 +# UNCONFIGURED FSTAB FOR BASE SYSTEM
 +
 +Поэтому идём в ''/lib/init/fstab''
 +
 +<code>
 +# apt-get install linux-image-extra-virtual
 +</code>
 +
 +<code>
 +find /lib/modules | grep quota
 +/lib/modules/4.5.1-std-1/kernel/fs/quota
 +/lib/modules/4.5.1-std-1/kernel/fs/quota/quota_v1.ko
 +/lib/modules/4.5.1-std-1/kernel/fs/quota/quota_v2.ko
 +/lib/modules/4.5.1-std-1/kernel/fs/quota/quota_tree.ko
 +/lib/modules/4.5.1-std-1/kernel/net/netfilter/xt_quota.ko
 +</code>
 +
 +<code>
 +depmod -a
 +modprobe quota_v1
 +modprobe quota_v2
 +/etc/init.d/quota start
 +</code>
 +
 +  * https://bugs.launchpad.net/ubuntu/+source/linux/+bug/761809
 +  * http://askubuntu.com/questions/109585/quota-format-not-supported-in-kernel
 +  * quotacheck: Your kernel probably supports journaled quota but you are not using it.
 +  * http://ittraveler.org/nastrojka-diskovyx-kvot-v-ubuntu/
 +  * http://askubuntu.com/questions/109585/quota-format-not-supported-in-kernel
 +  * https://www.virtualmin.com/node/23522
 +
 +==== В Ubuntu нет файла /var/log/messages ====
 +
 +via http://askubuntu.com/questions/51265/where-is-var-log-messages
 +
 +''/var/log/messages'' has been deleted from Natty.\\
 +You can find the same info in ''/var/log/syslog''. Note that everything logged to messages was also logged to ''syslog''.
 +
 +==== Broken apt-get in Ubuntu ====
 +
 +  * [[http://forums.linuxmint.com/viewtopic.php?f=47&t=183727&p=952334|http://forums.linuxmint.com/viewtopic.php?f=47&t=183727&p=952334]]
 +  * [[http://techjim.blogspot.ru/2014/04/recover-ubuntu-from-perl-catastrophe.html|http://techjim.blogspot.ru/2014/04/recover-ubuntu-from-perl-catastrophe.html]]
 +
 +==== Не перезапускается MySQL ====
 +
 +https://ubuntuforums.org/showthread.php?t=2227097 читать и размышлять
 +
 +MySQL автоматически стартует после остановки.
 +
 +Убираем инит - update-rc.d -f mysql remove\\
 +Или убираем upstart - /etc/init/mysql.conf
 +
 +==== random: nonblocking pool is initialized ====
 +
 +via http://blog.jamesrhall.com/2014/04/ubuntu-server-1404-fun.html
 +
 +Добавить параметр ''nomodeset'' к ядру. не работает.
 +
 +<code>
 +    nomodeset
 +
 +    The newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts.. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesnt work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.
 +
 +</code>
 +
 +==== init: plymouth-upstart-bridge main process ended, respawning [НЕрешено] ====
 +
 +via http://www.unrelatedshit.com/2014/07/30/kvm-too-fast-for-plymouth-upstart-bridge/
 +
 +Ошибка
 +
 +<code>
 +init: plymouth-upstart-bridge main process (222) terminated with status 1
 +init: plymouth-upstart-bridge main process ended, respawning
 +</code>
 +
 +Добавить ''sleep 2'' в ''/etc/init/plymouth-upstart-bridge.conf''
 +
 +<code>
 +[...]
 +stop on (stopping plymouth
 +         or stopping plymouth-shutdown)     
 + 
 +console output
 + 
 +exec plymouth-upstart-bridge
 +sleep 2
 +</code>
 +
 +:!: сомнительное решение. не помогло. система не загружается.
linux/ubuntu/ubuntu_tnt.txt · Последнее изменение: 2024/11/04 16:01 — dx