Skip to content

Instantly share code, notes, and snippets.

@Davidelanz
Last active April 24, 2023 10:29
Show Gist options
  • Save Davidelanz/29dc165716d4618fa5c2cebac336cd50 to your computer and use it in GitHub Desktop.
Save Davidelanz/29dc165716d4618fa5c2cebac336cd50 to your computer and use it in GitHub Desktop.
Linux utilities

Linux utilities

This is a series of gists collecting Linux utilities

# List manually installed packages
# https://askubuntu.com/a/492343
comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u)
# How to Update All Python Packages
# https://www.activestate.com/resources/quick-reads/how-to-update-all-python-packages/
# To generate a list of all outdated packages:
python3 -m pip list --outdated
# To upgrade all packages using pip with grep on Ubuntu Linux:
python3 -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
# To upgrade all packages using pip with awk on Ubuntu Linux:
python3 -m pip list -o | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment