I love nala and I want to use it but my muscle memory always goes for apt and every guide on the internet uses apt when I copy paste commands. Is there a way where even if I type apt nala is still used?
Asked
Active
Viewed 105 times
1 Answers
1
You can create new aliases for both the apt and nala commands like this:
alias apt='\nala'
alias dapt='\apt'
The backslash character preceding the commands disable alias expansion, so you can rename commands, but still run the originals (see here).
In addition, for aliases to work with sudo, you need to add this alias also (see here):
alias sudo='sudo '
Just be aware that if you copy and paste apt commands from the internet, that you now run with nala, it's possible that some options are not supported. So be sure to check it's a valid command for nala before you run it.
Artur Meinild
- 21,605
- 21
- 56
- 89
-
This doesnt seem to work on root. When I run the apt with sudo it still uses apt. – sudo apt-get bitches Aug 18 '23 at 18:14
-
I addressed this ^^ – Artur Meinild Aug 18 '23 at 19:39