Ошибка Debian command-not-found - локальная переменная 'cnf' упоминается перед назначением

Вы можете попробовать это

vi тест ctrl + x (, затем введите*)

Вам не нужно оставлять пробел, когда после test при вводе control + x, если нет, это не работает

vi *test*ctrl + x *
0
07.05.2020, 12:47
2 ответа

Не интуитивно понятно, но ошибка исчезает сразу послеapt update:

# apt update
Hit:1 http://deb.debian.org/debian buster InRelease
Get:2 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
Hit:3 http://security.debian.org/debian-security buster/updates InRelease
Get:4 http://deb.debian.org/debian buster/main amd64 Contents (deb) [36.1 MB]
Get:5 http://deb.debian.org/debian buster-updates/main amd64 Contents (deb) [42.3 kB]
Fetched 36.2 MB in 7s (5,009 kB/s)                                                                                                                                    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

# curl

Command 'curl' not found, but can be installed with:

apt install curl

ПС. Для тех, кто любопытен, причиной этого является отсутствие db при новой установке:

ls -l /var/lib/command-not-found
total 0

и после apt updateимеем:

ls -l /var/lib/command-not-found
total 2504
-rw-r--r-- 1 root root 2560000 Jul 29 12:34 commands.db
-rw-r--r-- 1 root root     983 Jul 29 12:34 commands.db.metadata
8
28.04.2021, 23:16

Изменить разрешение на

sudo chmod o+r /var/lib/command-not-found/commands.db*

но перед этим

Проверить информацию о состоянии переменной разрешения

ls -l /var/lib/command-not-found

total 2588

-rw-r----- 1 root root 2834432 Dec 18 05:25 commands.db
-rw-r----- 1 root root    4712 Dec 18 05:25 commands.db.metadata

Так и должно быть:

ls -l /var/lib/command-not-found

total 2588

-rw-r--r-- 1 root root 2641920 Jan 16 00:27 commands.db
-rw-r--r-- 1 root root    1175 Jan 16 00:27 commands.db.metadata
3
28.04.2021, 23:16

Теги

Похожие вопросы