Installing Drupal patches in Ubuntu terminal
As far as I know there is nothing in specific about applying patches for drupal in ubuntu. 

If you are already using git for managing your project code then you can apply a patch to a project's repository by using following code:

git apply -v path/file.patch


If you are not using git, or if the repo isn't a local checkout of the project you wish to patch:

patch -p1 &lt; path/file.patch


For more information, check https://www.drupal.org/patch/apply

Live example for patching in Drupal 8:


Download the .patch file (in this case: Add_rtl_support.patch)
Copy it into the particular module's directory (since the patch is relative to the module directory).
Change the destination directory in the Ubuntu terminal to the module's folder - In this case it should be cd modules/admin_toolbar.
Apply the patch using 2nd method patch -p1 &lt; Add_rtl_support.patch