Your Ubuntu server has both nano and Vim installed. The /usr/bin/editor generic link currently launches nano, but the operations team wants Vim to become the system-wide default editor. You must make the change non-interactively while keeping the alternatives system intact so that future package upgrades can manage the link group. Which command will meet these requirements?
The alternatives framework stores generic commands such as /usr/bin/editor as symbolic links that ultimately resolve through /etc/alternatives. Using the --set option tells update-alternatives to switch the master link (and any slave links) for a given name to the specified path and to place the link group in manual mode. Running sudo update-alternatives --set editor /usr/bin/vim.basic therefore rewires the editor link group so that /usr/bin/editor → /etc/alternatives/editor → /usr/bin/vim.basic, making Vim the global default for every user and script.
The --auto option instead returns the group to automatic mode and would very likely reset the link to whichever implementation has the highest priority-so it does not guarantee Vim. Manually creating a symbolic link with ln -sf bypasses the alternatives system and may be overwritten by the packaging tools. Editing /etc/profile only changes a shell variable (and only for future logins), leaving the editor command itself unaffected.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the alternatives system in Linux?
Open an interactive chat with Bash
Why is it better to use 'update-alternatives' rather than creating a symbolic link manually?
Open an interactive chat with Bash
What is the difference between manual mode and auto mode in the update-alternatives system?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .