Skip to content

Instantly share code, notes, and snippets.

@umstek
Last active November 25, 2017 08:04
Show Gist options
  • Save umstek/de1722ecf35764f7288a4744065cfaeb to your computer and use it in GitHub Desktop.
Save umstek/de1722ecf35764f7288a4744065cfaeb to your computer and use it in GitHub Desktop.
Developer Hacks

Linux/Ubuntu

Clean the APT Cache

Show size: du -sh /var/cache/apt/archives
Clean: sudo apt-get clean

Remove packages those are no longer needed

sudo apt-get autoremove --purge

YUM

yum clean all
more...

Package Managers (programming)

NPM (node)

npm cache clean --force just don't!.
more...

Composer (php)

composer clearcache
more...

Gem (ruby)

gem cleanup more...

View/update global node packages

View outdated packages

npm outdated -g --depth=0

Update

npm install -g <package-name>

or

npm update -g <package-name>

Batch update

for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2)
do
    npm -g install "$package"
done

Use npm outdated <package> -g --depth=0 --parseable | cut -d: -f2 to install wanted, -f3 for current, -f4 for latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment