To exit vi or vim without saving changes, press Esc a few times to enter Command mode, then type :q! and hit Enter. To exit vi or vim and commit your changes, press the Escape key to ensure you're in ...
The Debian/Ubuntu package manager isn't just for installing and removing software. You'll find there are some other tricks up Apt's sleeve that you should know about.
You've been typing the wrong commands for years. Linux moved on, and nobody bothered to tell you.