Fedora Account System
Red Hat Associate
Red Hat Customer
On normal cloud fedora install now, vim isn't available so we see message like: # vim /etc/sudoers No vim found, using vi, press ENTER to continue... When I do 'dnf install -y vim', it is still shown. The cure is to log-out and log-in. Expected results: Installing 'vim' should be enough and no re-login should be needed.
Hi Pavel, thank you for reporting the issue! 'vim' is an alias since 8.2.1885-1 if only vim-minimal is installed to meet the requirements of community and mine - see thread https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2DLBCPWOQDDB7MW26NMDBCEMYHQQWA47/#FJIVXUWGEMU4PGC5DTPAAJHPT2X7DOOX (To sum it up - community wanted alias vim=vi, which I found misleading, so the current alias is used) So the cure is to restart shell as you found out, because it loads scripts from /etc/profile.d again. If you know a way how to change alias without restarting shell/or get the same behavior without aliases, please let me know. I'll close this as NOTABUG for now, I'll reopen it if there is a way how to do it differently.
Some possible solutions: - don't use alias, but some shell function instead - revert the change, the "Command not found" is clear enough, and I can fix that by simply installing vim-enhanced - make the alias work so it doesn't interactively interrupt me with the question "No vim found, using vi, press ENTER to continue..." Let's call this RFE if it is not a bug :-)
Compromise solution after 1:1 irc chat could be this: https://src.fedoraproject.org/rpms/vim/pull-request/16 But personal preference is to entirely avoid the warning which is super annoying during my day-to-day work.
FEDORA-2020-eb6fb0541e has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-eb6fb0541e
FEDORA-2020-c24b468d7f has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-c24b468d7f
FEDORA-2020-eb6fb0541e has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-eb6fb0541e` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-eb6fb0541e See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-c24b468d7f has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-c24b468d7f` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-c24b468d7f See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-08ff42d667 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-08ff42d667
FEDORA-2020-971fd35017 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-971fd35017
FEDORA-2020-08ff42d667 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-08ff42d667` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-08ff42d667 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-971fd35017 has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-971fd35017` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-971fd35017 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-08ff42d667 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2020-971fd35017 has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.
Please reconsider this fix! I read through this bug and the referenced thread and understand the previous complaints, but the fix that was recently committed & pushed is ugly: bash now reports the running job as "( test -f /usr/bin/vim && exec /usr/bin/vim "$@"; test -f /usr/bin/vi && exec /usr/bin/vi "$@" )". That appears anytime someone stops an editor session or runs the "jobs" shell builtin. Previously (for years and years), only "vim" would be reported as the running job, which is so much cleaner and easier to read. The original reported bug might have been an annoyance for a certain (arguably small) subset of the user base, while this recent fix now impacts every user of the vim-enhanced/vim-minimal packages. Actually, I wonder if it was intentional to use parentheses instead of curly-braces in those two new functions added to /etc/profile.d/vim.sh (__vi_internal_vim_alias). Did you really want to have to fork/exec a subshell? That doesn't seem necessary, and more importantly, when using the more common curly-braces to contain the function body, bash doesn't report the entire function body as the running job as it does when running within a subshell. If you would at least change the parens to braces, bash would only report the actual process running, which is much less ugly than the current approach.
Hi Glenn, you're absolutely right, the curly brackets does the trick too and it is less messy. Thank you for checking it! Actually, the current solution doesn't work when you use vi/vim with sudo, so I'm working on the version using alternatives. Currently, I'm stuck with writing %triggerin scriptlet to ensure the change is propagated even during upgrade.
I created a bug for tracking the intention to use alternatives in vim here https://bugzilla.redhat.com/show_bug.cgi?id=1918575