You cannot be a professional developer without an encounter with Unix/Linux systems. Linux is the preferred operating system of choice for cloud machines.
SSH is a magical technology to control the cloud machine without making a trip to the data center. All said but how to install and manage software on the Linux operating systems? The answer is Package Managers.
I am comparing
apt because both implement the same interface called
Package Managers. Might have sounded more Javaish but the point is that both npm and apt are package managers.
npm makes it easy to learn
apt. Another easy way would be to compare the app store with
apt however we do not execute commands on the app store. But the concept is the same, you can look up software, install it, upgrade it or even remove it.
The package manager is part of a package called
Package management system. The package management system has a bunch of tools to perform operations on the software like maintaining a registry of available software, performing a lookup when searched for, notifying or maintaining versions of the software. For the node platform, we have
npm, for python, it’s
pip, etc. Depending on the Linux OS the package managers vary.
I enjoy using GUI based package managers like synaptic package manager on my laptop but never on cloud computing because they do not have GUI. It’s just
CRUD stands for Create Read Update Delete operations in general. Package managers help you similar, in place of creating we have
To create a package
apt - no equivalent command exists
To install a package(s)
Multiple packages are separated with a space like `apt i pack1 pack2.
To install a package with a specific version. In npm, we use the same install command to reinstall the package. In apt, we pass
npm install packageName@1.1.0
apt i packageName=1.1.0
To remove a package
npm remove packageName
apt remove packageName
To update a package
npm update packageName
apt update packageName
To upgrade a package (a breaking release can be considered an upgrade. Bugfixes are considered an update).
npm upgrade packageName
apt upgrade packageName
To upgrade all packages,
npm upgrade or
To remove unwanted packages along with configuration files
npm purge packageName
apt purge packageName
To list the existing packages
npm list -g --depth=0
The cache is the area where the packages are downloaded. We have one location where the packages are cached per user in an OS.
npm cache clear
As a publisher of not so popular npm package send JS errors to service, I was looking for equivalents of
npm login however I did not find an equivalent in