DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 963,274 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Update Cheat Sheet for Developers
SmartScanner
SmartScanner

Posted on • Originally published at thesmartscanner.com

Update Cheat Sheet for Developers

This is a cheat sheet for updating critical web software.

Using an outdated application is a high-risk vulnerability that has an easy fix. This guide provides easy-to-follow instructions for different applications to fix security vulnerabilities.

⚠️ The goal of this guide is to eliminate vulnerabilities by updating applications. Sometimes updates can break things or lead to unexpected behaviors. It is up to you to perform enough checking and testing before using commands in this cheat sheet in the production environment.

RHEL/CentOS/Oracle Linux

Run below command in terminal (ssh)

sudo yum update
Enter fullscreen mode Exit fullscreen mode

Debian/Ubuntu Linux

Run below command in terminal (ssh)

sudo apt update && sudo apt upgrade
Enter fullscreen mode Exit fullscreen mode

OpenSUSE/SUSE Linux

Run below command in terminal (ssh)

sudo zypper up
Enter fullscreen mode Exit fullscreen mode

NodeJs (npm)

Run the below command in your NodeJs project directory.

npm audit fix
Enter fullscreen mode Exit fullscreen mode

Note that some vulnerabilities cannot be fixed automatically and will require manual intervention or review.
Some fixes can be forced using the below command but please make sure it doesn't break anything in your project.

npm audit fix --force
Enter fullscreen mode Exit fullscreen mode

Python (pip)

You have to update packages one by one. Run the below command to get a list of outdated packages.

pip list --outdated
Enter fullscreen mode Exit fullscreen mode

For each package run the below command to update it.

pip install [package_name] --upgrade
Enter fullscreen mode Exit fullscreen mode

NuGet

From the command line, you can update packages in the solution to the latest version available from nuget.org.

nuget update YourSolution.sln
Enter fullscreen mode Exit fullscreen mode

Note that this will not run any PowerShell scripts in any NuGet packages.

From within Visual Studio, you can use the Package Manager Console to also update the packages. This has the benefit that any PowerShell scripts will be run as part of the update whereas using NuGet.exe will not run them. The following command will update all packages in every project to the latest version available from nuget.org.

Update-Package
Enter fullscreen mode Exit fullscreen mode

PHP (Composer)

Navigate to the root of your application, where your composer.json file is, and run the below command.

php composer.phar update
Enter fullscreen mode Exit fullscreen mode

In Windows:

composer update
Enter fullscreen mode Exit fullscreen mode

Go (golang)

To update all packages in your GOPATH, run the below command.

go get -u all
Enter fullscreen mode Exit fullscreen mode

Ruby (gem)

To update all gems:

gem update
Enter fullscreen mode Exit fullscreen mode

RubyGems keeps old versions of gems. Run cleanup to remove old gems after an update.

gem cleanup
Enter fullscreen mode Exit fullscreen mode

Maven (mvn)

Run the below command to force an update of dependencies.

mvn clean install -U
Enter fullscreen mode Exit fullscreen mode

Rust (cargo)

For updating all dependencies of your Rust project, you need to install a third-party crate. Install cargo-update:

cargo install cargo-update
Enter fullscreen mode Exit fullscreen mode

Then run the below command to check for newer versions and update all installed packages.

cargo install-update -a
Enter fullscreen mode Exit fullscreen mode

WordPress

WordPress lets you update with the click of a button. You can launch the update by clicking the link in the new version banner (if it’s there) or by going to the Dashboard > Updates screen. Once you are on the β€œUpdate WordPress” page, click the button β€œUpdate Now” to start the process off. You shouldn’t need to do anything else and, once it’s finished, you will be up-to-date.

Windows

Run the below command on cmd to open the Windows update screen.

control update
Enter fullscreen mode Exit fullscreen mode

You can use SmartScanner for finding outdated components in your application.

References

Top comments (0)

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›