Ignoring broken packages in Ubuntu or any other distribution of Linux using Aptitude package manager would usually be a bad thing and it’s not recommended. Maintaining a system of broken packages kind of defeats the object.
BUT, I recently came across a situation where I had to install a 32bit version of Chrome on my 64bit Ubuntu. I did this by completely removing previous versions of Chrome, then downloading the .deb file from the Chrome download page and installing it from command line using….
1 |
sudo dpkg —force–architecture –i google–chrome–stable_current_i386.deb |
This worked.
So why the need to ignore broken packages?
Well though it worked, it left some dependency issues. The dependencies are installed, but because they are working in a sort of compatibility mode (MultiArch) they show as broken dependencies. This forces Synaptic to display it as broken package every time you try to update, not only display it as broken but prevent you from updating until you fix it. Synaptics fix is to completely remove it.
Ok then, How do I force Synaptic to ignore the ‘broken’ package?
Firstly you have to find the dependencies that are causing the errors:
- Open Synaptic Package Manager (you may need to install this first “sudo apt-get install synaptic“)
- Find the ‘broken’ package, you will probably be notified there is broken package – click the link to Broken from the list on the left of the screen – make a note of the package name
- Right click on the package, select Properties
- Go to the Dependencies tab, make a note of the dependencies listed in italics
- Leave Synaptic open to test the fix later
Now we need to edit a file. Open a terminal and type/copy:
1 |
gksudo gedit /var/lib/dkpg/status |
This should open the file status (which can be pretty long), you now have to find the package name (Ctrl+f should help). There should be a little section for it that resembles this:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Package: google–chrome–stable Status: install ok unpacked Priority: optional Section: web Installed–Size: 119100 Maintainer: Chrome Linux Team <chromium–dev@chromium.org> Architecture: i386 Version: 22.0.1229.94–r161065 Config–Version: 20.0.1132.57–r145807 Replaces: google–chrome Provides: google–chrome, www–browser Depends: libasound2 (>> 1.0.22), {...and many others!...}, libcurl3, wget Description: The web browser from Google |
Now delete the dependencies (the italic ones you noted earlier) from the Depends line, save the file (Ctrl+S) and close.
How do I know if my ‘broken’ packages are being ignored?
Now click Reload in Synaptic. You shouldn’t receive the broken dependency message you did earlier.
Issues?
The only problem I ran into with ignoring broken packages were updates. I had to update chrome which involved doing this again (because I had to completely remove it in the first place!).
Like I said before, I don’t condone ignoring broken packages, or anything broken for that matter! Sometimes these things have to be done though.