Install Liquibase on Linux with Debian/Ubuntu

You can install, upgrade, and uninstall Liquibase on your Linux machine with the Debian/Ubuntu package installer by following the steps on this page.

Prerequisites

  1. Install Java.

Install

To install Liquibase using the Debian/Ubuntu installer package, follow the steps below:

Note: Please ensure that you run step 2 and 3 before step 4. You cannot run only step 4 and successfully install Liquibase.

  1. Open a terminal.
  2. Run the following command to import the Liquibase GPG key and add the Liquibase repository to the apt sources list:
  3. wget -O- https://repo.liquibase.com/liquibase.asc | gpg --dearmor > liquibase-keyring.gpg && \
    cat liquibase-keyring.gpg | sudo tee /usr/share/keyrings/liquibase-keyring.gpg > /dev/null && \
    echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/liquibase-keyring.gpg] https://repo.liquibase.com stable main' | sudo tee /etc/apt/sources.list.d/liquibase.list

    Note: It is important to note that you must have root permissions for this to work.

  4. Update the package lists:
  5. sudo apt-get update
  6. Install Liquibase:
  7. sudo apt-get install liquibase
  8. Ensure that Liquibase is updated to the desired version:
  9. liquibase --version

Liquibase is now installed on your system.

Optional: install a specific version

To install a specific version of Liquibase using the Debian/Ubuntu installer package, you can use the package manager's version pinning mechanism. Run the following command and replace x.y.z with the desired version number:

sudo apt-get install liquibase= x.y.z

The specified version of Liquibase is now installed on your system.

Upgrade

To upgrade Liquibase to the latest version, follow these steps:

  1. Open a terminal.
  2. Update the package lists:
  3. sudo apt-get update
  4. Upgrade Liquibase:
  5. sudo apt-get upgrade liquibase

Liquibase has now been upgraded to the latest version available in the repository.

Uninstall

To uninstall Liquibase from your system, follow these steps:

  1. Open a terminal.
  2. Remove the Liquibase package:
  3. sudo apt-get remove liquibase

Liquibase is now uninstalled from your system.

Troubleshoot

Sometimes users will see an error that states "Unable to locate Package" after the sudo apt-get install liquibase step in the install process. If this happens to you, follow the below steps to troubleshoot the issue.

  1. Check the repository configuration
    • Ensure that the Liquibase repository is correctly added to the apt sources list. You can verify this by examining the contents of the cat /etc/apt/sources.list.d/liquibase.list file.
    • This should display a line similar to:
      deb [arch=amd64 signed-by=/usr/share/keyrings/liquibase-keyring.gpg] https://repo.liquibase.com stable main
    • If the line is missing or incorrect, you may need to re-add the repository following the Install section above.
  2. Update Package Lists
    Before attempting to install Liquibase again, make sure to update the package lists using:
    sudo apt-get update
    • This ensures that apt has the latest information about available packages.
  3. Try Installing LiquibaseAgain
    After updating the package lists, attempt to install Liquibase again with the install steps listed above.

Next steps

  1. Introduction to Liquibase – Dive into Liquibase concepts
  2. Get Started with Liquibase – Learn how to use Liquibase with an example database
  3. Design Your Liquibase Project – Create a new Liquibase project folder and organize your changelogs
  4. Liquibase Database Tutorials – Configure Liquibase to work with your own database
  5. How to Apply Your Liquibase Pro License Key – If you use Liquibase Pro, activate your license