Software⏱️ 3 min read📅 2026-06-19

How to Fix: apt-get error when installing git

apt-get error when installing git on Ubuntu 12.04.5 server

Quick Answer: Check the sources.list file for any held broken packages and update it to resolve the issue.

The error message indicates that the 'git' package has unmet dependencies, specifically liberror-perl. This issue affects users who are trying to install Git on Ubuntu-based systems, particularly those running older versions of the operating system.

This error can be frustrating for users who are new to Linux or have limited experience with package management. However, it is a relatively common problem that can often be resolved by updating the package list and fixing any broken dependencies.

💡 Why You Are Getting This Error

  • The primary cause of this error is that liberror-perl has been deprecated in newer versions of Ubuntu. This means that older packages may not be able to find or install the required dependency.
  • Another possible cause is that the package list has become corrupted or out of date, causing the 'apt-get' command to fail when trying to install Git.

🔧 Proven Troubleshooting Steps

Update Package List and Fix Broken Dependencies

  1. Step 1: Open a terminal on your Ubuntu server and run the following command to update the package list: `sudo apt-get update`. This will ensure that the package database is up-to-date and includes any necessary dependencies.
  2. Step 2: Next, run the following command to fix any broken dependencies: `sudo apt-get -f install`. This will attempt to repair any damaged packages and resolve the dependency issue.
  3. Step 3: If the problem persists after running these commands, you may need to manually remove or upgrade specific packages. Use the `apt-cache policy` command to identify any problematic packages and take corrective action.

Check Sources List File

  1. Step 1: Open the sources.list file in a text editor and review its contents. Ensure that the list is up-to-date and includes only trusted repositories.
  2. Step 2: Check for any lines that start with 'deb http://archive.ubuntu.com/ubuntu' or similar, as these may be causing issues due to deprecated packages or outdated dependencies.

💡 Conclusion

By following these steps, you should be able to resolve the error message and successfully install Git on your Ubuntu server. Remember to regularly update your package list and check for any broken dependencies to prevent similar issues in the future.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions