Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # see: How to disable "WARNING: apt does not have a stable CLI interface..." [closed]
- # https://serverfault.com/questions/958003/how-to-disable-warning-apt-does-not-have-a-stable-cli-interface
- echo `sudo apt update 2>/dev/null | grep "packages" | cut -d " " -f1`
- # !!! TIP:
- # '2>/dev/null/'
- #- "In the *nix world, output to the command line is generally of two flavors, stdout (standard # # output) and stderr # (standard error). Well-behaved programs send their normal output to stdout and any warnings or error # # messages to #stderr. So, if you want errors/warnings to disappear, you can usually accomplish this by throwing away any # messages on #stderr using the output redirection 2>/dev/null. (In English, that's "redirect (>) the second output channel
- # (2, which is stderr) to /dev/null (which just throws away everything sent there)"."
- #!/bin/bash
- #\n
- # created by OuNiS 07.2024\n
- #\n\n\n
- # from alias to bash file
- # alias what2up='`sudo apt update 2>/dev/null | grep "packages" | cut -d " " -f1 | tail -1`'
- #
- # *** WARNING ***
- # IN CASE OF:
- # "...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."
- #
- # quoted from:
- # https://serverfault.com/questions/958003/how-to-disable-warning-apt-does-not-have-a-stable-cli-interface
- if [ -z "$1" ]; then
- PACKAGES="package"
- else
- PACKAGES=$1
- fi
- # *** WARNING ***
- # echo $PACKAGES
- echo "Please wait..."
- PKGNUM=`sudo apt update 2>/dev/null | grep "$PACKAGES" | cut -d " " -f1 | tail -1`
- # echo $PKGNUM
- if [ -z "$PKGNUM" ] || [ "$PKGNUM" = "All" ] || [ "$PKGNUM" = "Wszystkie" ]; then
- echo "The system is fully updated!!!"
- else
- echo -e "Packages to be updated:$CL_YELLOW$CL_BOLD $PKGNUM $CL_DEF"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement