apt
is the command that is being recommended by the Linux distributions. It provides the necessary option to manage the packages. It is easier to use with its fewer but easy to remember options.
As quoted in itsfoss.com
There is no reason to stick with apt-get unless you are going to do specific operations that utilize more features of apt-get.
apt
is a subset of apt-get and apt-cache commands providing necessary commands for package management- while apt-get won’t be deprecated, as a regular user, you should start using apt more often
I get this error when I use apt
in shell scripts whereas it does not happen when I use apt-get
instead"
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
My questions are:
- Why doesn't
apt
have a stable CLI interface? - How can I use
apt
with caution or safely? - How can I disable this error message?
apt
does not know or care if its parent is a login shell. Most people run it from a shell in a GUI terminal which is not a login shell, anyway.apt
checks whether its standard output is a terminal. – Gilles 'SO- stop being evil' Jun 03 '20 at 19:28sh -c 'apt list foo; echo no warning'
vsapt list foo | cat
– Gilles 'SO- stop being evil' Jun 03 '20 at 20:10