Code: Select all
dnf install foo
How do I fix that?
Code: Select all
dnf install foo
Code: Select all
$ dnf makecache # Initial cache
$ dnf -C search zstd
======= Name & Summary Matched: zstd =======
zstd.x86_64 : Zstd compression library
libzstd.x86_64 : Zstd shared library
libzstd.i686 : Zstd shared library
libzstd-devel.i686 : Header files for Zstd library
libzstd-devel.x86_64 : Header files for Zstd library
$ dnf -C list python*devel
Available Packages
python2-cairo-devel.x86_64 1.16.3-6.module_el8.0.0+36+bb6a76a2 appstream
python2-devel.x86_64 2.7.18-8.module_el8.6.0+940+9e7326fe appstream
python36-devel.x86_64 3.6.8-38.module_el8.5.0+895+a459eca8 appstream
python38-devel.x86_64 3.8.12-1.module_el8.6.0+929+89303463 appstream
python39-devel.x86_64 3.9.7-1.module_el8.6.0+930+10acc06f appstream
Did that but pressing tab button still just freezes a terminal tab.Mike_Rochefort wrote: ↑2021/10/23 22:33:011) Making sure bash-completion was installed, and
2) Running dnf makecache to generate up-to-date repo cache information.
Tabbing may not be ideal but my brain is small and can only remember this trick and it helps in 99.9% of cases.Mike_Rochefort wrote: ↑2021/10/23 22:33:01However, this methodology is a bit finicky. You're better off using subcommands like search and list paired with the -C flag (capital C, which will use the local cache rather than updating it) to look for packages to pass to a dnf install run than relying on tab completion. The local cache flag is not allowed with install, and metadata will always be checked and updated if need be.
I guess that dnf does update its meta data first which is IMHO a design flaw. If they offer bash tab completion, they should do it without updating the cache. (dnf offers the option --cacheonly to do so, therefore I assume the bash tab completion could use that option.)
Is there a way to fix it?owl102 wrote: ↑2021/10/24 19:05:42I guess that dnf does update its meta data first which is IMHO a design flaw. If they offer bash tab completion, they should do it without updating the cache. (dnf offers the option --cacheonly to do so, therefore I assume the bash tab completion could use that option.)
Actually, it does use this option. This is how the function _dnf_commands_helper looks like in /usr/share/bash-completion/completions/dnf:owl102 wrote: ↑2021/10/24 19:05:42I guess that dnf does update its meta data first which is IMHO a design flaw. If they offer bash tab completion, they should do it without updating the cache. (dnf offers the option --cacheonly to do so, therefore I assume the bash tab completion could use that option.)
Code: Select all
_dnf_commands_helper()
{
local helper_cmd="import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])"
local helper_opts="-d 0 -q -C --assumeno --nogpgcheck"
echo "$( ${__dnf_python_exec} -c "$helper_cmd" "$@" $helper_opts 2>/dev/null </dev/null )"
}