April 27, 2017 | 5:11 am
You are here:  / First Time / HOWTO / [HOWTO] Make apt ignore a “broken” package

[HOWTO] Make apt ignore a “broken” package

Recently had an issue where I had a package that I needed to install under debian but which wouldn’t install because of a dependancy problem.  So, dpkg –force-all package.deb worked and got it installed.  Program works and everything is fine.

Then, I needed to install openvpn and apt started complaining about the “broken” package.  It would not let me install or update anything else unless I removed the broken package.  Only problem is.. the package is not broken.

How to get around this?  Essentially you need to “lie” to apt and remove the dependancy.

#  vi /var/lib/dpkg/status

Opening the dpkg status file, you will see all kinds of stuff in there about the current status of every package which is installed.

For example, let’s say the name of your “broken” package is test_package.

Do a search in vi (/test_package <enter>) and it will take you to an entry which looks like this:

Package: test_package
Status: install ok installed
Priority: optional
Section: applications
Installed-Size: 24084
Maintainer: init
Architecture: i386
Source: init.sh
Version: 1.0.0-1
Depends: package1, package2, package3
Description: Performs cool tests

Now the package named “package3” is the dependancy which is causing the problems.

The solution?  Simply go down to the Depends line and erase package3.  The entry now looks like this:

Package: test_package
Status: install ok installed
Priority: optional
Section: applications
Installed-Size: 24084
Maintainer: init
Architecture: i386
Source: init.sh
Version: 1.0.0-1
Depends: package1, package2
Description: Performs cool tests

Problem solved.  Now back to the prompt and a quick “apt-get install openvpn” works fine now.

initrd