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
- 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.
- Open a terminal.
- Run the following command to import the Liquibase GPG key and add the Liquibase repository to the
apt
sources list: - Update the package lists:
- Install Liquibase:
- Ensure that Liquibase is updated to the desired version:
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.
sudo apt-get update
sudo apt-get install liquibase
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:
- Open a terminal.
- Update the package lists:
- Upgrade Liquibase:
sudo apt-get update
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:
- Open a terminal.
- Remove the Liquibase package:
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.
- 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.
- Ensure that the Liquibase repository is correctly added to the apt sources list. You can verify this by examining the contents of the
- 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.
- Try Installing LiquibaseAgain
After updating the package lists, attempt to install Liquibase again with the install steps listed above.
Next steps
- Introduction to Liquibase – Dive into Liquibase concepts
- Get Started with Liquibase – Learn how to use Liquibase with an example database
- Design Your Liquibase Project – Create a new Liquibase project folder and organize your changelogs
- Liquibase Database Tutorials – Configure Liquibase to work with your own database
- How to Apply Your Liquibase Pro License Key – If you use Liquibase Pro, activate your license