Я недавно обновился до Ubuntu 20.04 с 18.04.
После обновления заметил разницу. Раньше, если я набирал команду, недоступную в системе, она автоматически рекомендовала имя пакета (при условии, что команда действительно существует в некоторых репозиториях). Например:
$ htop
Command 'htop' not found, but can be installed with:
sudo apt install htop
Но теперь я просто получаю:
$ htop
htop: command not found
т.е. предложение с подходящей установкой сейчас отсутствует.
Есть идеи, что могло вызвать это изменение в поведении?
Я обнаружил, что это связано с отсутствующим пакетом (должно быть, я случайно удалил его во время обновления до Focal или он был непреднамеренно "удален автоматически"). Способ получить это автоматический совет состоял в том, чтобы установить пакет команда-не-найдена
:
$ sudo apt search command-not-found
Sorting... Done
Full Text Search... Done
command-not-found/focal-updates,now 20.04.4 all [residual-config]
Suggest installation of packages in interactive bash sessions
packagekit-command-not-found/focal 1.1.13-2ubuntu1 amd64
Offer to install missing programs automatically
python3-commandnotfound/focal-updates,now 20.04.4 all [installed,auto-removable]
Python 3 bindings for command-not-found.
Пример до и после:
$ smartctl
smartctl: command not found
$ sudo apt install command-not-found -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
command-not-found
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 5240 B of archives.
After this operation, 35.8 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 command-not-found all 20.04.4 [5240 B]
Fetched 5240 B in 0s (18.5 kB/s)
Selecting previously unselected package command-not-found.
(Reading database ... 43980 files and directories currently installed.)
Preparing to unpack .../command-not-found_20.04.4_all.deb ...
Unpacking command-not-found (20.04.4) ...
Setting up command-not-found (20.04.4) ...
$ smartctl
Command 'smartctl' not found, but can be installed with:
sudo apt install smartmontools
$