Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

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
Comment

PREVIOUS NEXT
Code Example
Shell :: delete auto purge 
Shell :: prevent pushing to master github 
Shell :: update arch repo using reflector 
Shell :: how to install redis on windows 10 
Shell :: install docker ec2 
Shell :: Unable to boot device due to insufficient system resources. 
Shell :: video to gif 
Shell :: undo merge 
Shell :: htpasswd add user 
Shell :: pull branch git 
Shell :: git add gitignore 
Shell :: bash length of array 
Shell :: taskkill linux 
Shell :: plesk clear mail queue 
Shell :: command not found: shopify 
Shell :: create permanent git credentials windows 
Shell :: how to delete all branches in git local 
Shell :: jq starts with 
Shell :: create directory linux 
Shell :: which equivalent powershell 
Shell :: yum clean all 
Shell :: bash scripts arguments 
Shell :: how to create folder in github 
Shell :: git merge with message 
Shell :: git revert to last commit 
Shell :: install perl 5 on ubuntu 2020 
Shell :: configure static ip address ubuntu server 20.04 
Shell :: how to create alias in linux 
Shell :: sbt install mac 
Shell :: boostrap install angular 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =