Pub command is not found after installing dart-sdk Pub command is not found after installing dart-sdk dart dart

Pub command is not found after installing dart-sdk


As someone mentioned in a comment to an (outdated) answer, the nowadays (due to Dart being supplied / integrated with / in Flutter now) suggested correct use of pub is to be called via the flutter command:

`flutter pub`

ie. to use gRPC / protobufs v3 w/ Dart / Flutter:

`flutter pub global activate protoc_plugin`


Sometimes when you install dart, you may also have a problem where the dart command works but the pub command does not work, this is because dart is only present in the /usr/bin, to solve this simply make a symlink and to add pub command to this /usr/bin directory.

sudo ln -s /usr/lib/dart/bin/pub /usr/bin/pub

Hope this helps


It's important to ensure that the dart SDK is in the PATH. You can easily test it by trying to use pub or dart.

One way to ensure it's in the PATH is by creating a .bashrc file in your user's folder.

Then add the following:

PATH=$PATH:/path/to/dart/installation/bin/folderexport PATH