Answers for "WARNING: apt does not have a stable CLI interface. Use with caution in scripts."

0

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

#First, consider the meaning of the warning you're trying to hide. 
#In theory, apt could change tomorrow to calling them "distributions" instead of "packages" (because it "does not have a stable CLI interface yet") and this would completely break your pipeline. A more likely change would be one which uses the word "packages" in multiple places, causing your pipeline to return extraneous information instead of only the package count you're looking for.


sudo apt update 2>/dev/null | grep packages | cut -d '.' -f 1
Posted by: Guest on June-18-2021

Code answers related to "WARNING: apt does not have a stable CLI interface. Use with caution in scripts."

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language