Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is my situation: I've installed a program called ipe "forcably" through a deb package; the reason for this is that ipe depends on texlive-latex-base, however, I already maintain a separate install of latex via tlmgr. There is no problem with that kind of install of ipe, however, as long as I remember to run it from a terminal, which suits me fine.

The problem is that that broken dependency now doesn't allow me to install packages which are completely unrelated - in this case, dropbox:

$ sudo apt-get install dropbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 ipe : Depends: texlive-latex-base but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Now, if I try -f install, that will try to fix the ipe install, which is what I do not want.

It turns out, aptitude looks like it could offer a way to ignore/skip over this dependency:

$ sudo aptitude install dropbox
The following NEW packages will be installed:
  dropbox 
The following partially installed packages will be configured:
  ipe{b} 
0 packages upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 93,0 kB of archives. After unpacking 410 kB will be used.
The following packages have unmet dependencies:
  ipe: Depends: texlive-latex-base but it is not going to be installed.
The following actions will resolve these dependencies:

     Remove the following packages:
1)     ipe                         



Accept this solution? [Y/n/q/?] 1
Action "1": Removing ipe

Package: ipe
State: unpacked
Automatically installed: no
Version: 7.0.10-2
Priority: optional
...

This action was selected because ipe depends upon texlive-latex-base.

Enter "r 1" to prevent this action from appearing in new solutions.
Enter "a 1" to require that new solutions include this action if possible.

Accept this solution? [Y/n/q/?] r 1
Rejecting the removal of ipe
The following actions will resolve these dependencies:

     Remove the following packages:
1) R   ipe                         



Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
  dropbox 
The following packages will be REMOVED:
  ipe{a} 
0 packages upgraded, 1 newly installed, 1 to remove and 1 not upgraded.
Need to get 93,0 kB of archives. After unpacking 5.034 kB will be freed.
Do you want to continue? [Y/n/?] n
Abort.

The weird thing is: even if I specify r 1 - and the program actually confirms that with "Rejecting the removal of ipe" - I still get "The following packages will be REMOVED" in the end, which is I what I specifically do not want to do? (Btw, I've also tried a 1, and the end results are completely the same, "... will be REMOVED", although that is the action I'd expect for that choice).

Where am I going wrong? Am I misunderstanding what they mean by "new solutions"? And is there a way to have the apt/aptitude system know, that I'd rather it ignores the unmet dependencies of (in this case) ipe?

share|improve this question
add comment

1 Answer 1

EDIT: Ok, as noted below, the "rejecting the removal..." thing in aptitude does not work - this is what did manage to work for me, though...

While looking for, say, Package: ipe, one may hit files such as:

$ grep -r 'Package: ipe' /var/lib/apt/lists/
...
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_universe_binary-i386_Packages:Package: ipe
...
/var/lib/apt/lists/old-releases.ubuntu.com_ubuntu_dists_natty_universe_binary-i386_Packages:Package: ipe
...

... however, these are not right - apparently, the runtime information for apt-get etc. is stored in /var/lib/dpkg/status ( via How do I fix a "Problem with MergeList" or "status file could not be parsed" error when trying to do an update? ).

So, I opened that file via sudo nano /var/lib/dpkg/status, and looked up "Package: ipe", and then tried to comment the texlive-latex-base portion of "Depends:" - first by putting it in a separate line, at commenting it with a number sign/hash #. Note that this does not work - first you'll get errors like:

dpkg: error: parsing file '/var/lib/dpkg/status' near line 8140 package 'ipe':
 field name `#,' must be followed by colon
E: Sub-process /usr/bin/dpkg returned an error code (2)

... then if you try to add that colon, as in #:, you'll get:

dpkg: error: parsing file '/var/lib/dpkg/status' near line 8141 package 'ipe':
 user-defined field name `#' too short
E: Sub-process /usr/bin/dpkg returned an error code (2)

Apparently, these files do not use comments; and they seem to be documented in Debian Policy Manual - Control files and their fields. Then I found:

#353040 - [DPKG-DEB] don't be so noisy about user defined fields in DEBIAN/control - Debian Bug report logs

The right way to include a field in the .deb is to use fields named "XB-*".

... so, basically, instead of using a comment character to "comment out" - I just used an user-defined field, instead, which I arbitrarily called XB-Ignore:; so that portion of /var/lib/dpkg/status ended up looking like this:

Package: ipe
...
Depends: libc6 (>= 2.4), libcairo2 (>= 1.2.4), libgcc1 (>= 1:4.1.1), libipe7.0.10, liblua5.1-0, libqtcore4 (>= 4:4.6.$
XB-Ignore: , texlive-latex-base, gsfonts
...

With this change saved, I could perform the install using apt-get directly, without a problem:

$ sudo apt-get install dropbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  python-gpgme
The following NEW packages will be installed:
  dropbox
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/93,0 kB of archives.
After this operation, 410 kB of additional disk space will be used.
Selecting previously deselected package dropbox.
...
Setting up dropbox (1.6.1) ...
Processing triggers for menu ...

I'll just note that /var/lib/dpkg/status is not a persistant file - in fact, right after the apt-get install, if you check the file again, Depends: and XB-Ignore: will no longer be on neighboring lines (as they were originally, as shown on the snippet above)!


While the question on ignoring the unmet dependency is still open noted above - it turns out I did misinterpret what these "new solutions" are: it is the choices you're offered by aptitude if you answer "no" to the "Accept this solution?" question:

...
The following packages have unmet dependencies:
  ipe: Depends: texlive-latex-base but it is not going to be installed.
The following actions will resolve these dependencies:

     Remove the following packages:
1)     ipe                         


Accept this solution? [Y/n/q/?] r 1
Rejecting the removal of ipe
The following actions will resolve these dependencies:

     Remove the following packages:
1) R   ipe                         


Accept this solution? [Y/n/q/?] n                      # <==== here not accepting above solution
The following actions will resolve these dependencies: # <==== new solution offered here:

      Install the following packages:           
1)      lmodern [2.004.1-3 (natty)]             
2)      luatex [0.65.0-1ubuntu3 (natty)]        
3)      tex-common [2.09 (natty)]               
4)      texlive-base [2009-11 (natty)]          
5)      texlive-binaries [2009-8ubuntu2 (natty)]
6)      texlive-common [2009-11 (natty)]        
7)      texlive-doc-base [2009-2 (natty)]       
8)      texlive-latex-base [2009-11 (natty)]    
9)      texlive-latex-base-doc [2009-11 (natty)]
10)     texlive-luatex [2009-11 (natty)]        

Accept this solution? [Y/n/q/?] r 1
Rejecting the installation of lmodern version 2.004.1-3 (natty)
The following actions will resolve these dependencies:

      Install the following packages:           
1)  R   lmodern [2.004.1-3 (natty)]             
2)      luatex [0.65.0-1ubuntu3 (natty)]        
...

Accept this solution? [Y/n/q/?] r 10
Rejecting the installation of texlive-luatex version 2009-11 (natty)
The following actions will resolve these dependencies:

      Install the following packages:           
1)  R   lmodern [2.004.1-3 (natty)]             
2)  R   luatex [0.65.0-1ubuntu3 (natty)]        
3)  R   tex-common [2.09 (natty)]               
4)  R   texlive-base [2009-11 (natty)]          
5)  R   texlive-binaries [2009-8ubuntu2 (natty)]
6)  R   texlive-common [2009-11 (natty)]        
7)  R   texlive-doc-base [2009-2 (natty)]       
8)  R   texlive-latex-base [2009-11 (natty)]    
9)  R   texlive-latex-base-doc [2009-11 (natty)]
10) R   texlive-luatex [2009-11 (natty)]        


Accept this solution? [Y/n/q/?] n
*** No more solutions available ***

The following actions will resolve these dependencies:

      Install the following packages:           
1)  R   lmodern [2.004.1-3 (natty)]             
2)  R   luatex [0.65.0-1ubuntu3 (natty)]        
3)  R   tex-common [2.09 (natty)]               
4)  R   texlive-base [2009-11 (natty)]          
5)  R   texlive-binaries [2009-8ubuntu2 (natty)]
6)  R   texlive-common [2009-11 (natty)]        
7)  R   texlive-doc-base [2009-2 (natty)]       
8)  R   texlive-latex-base [2009-11 (natty)]    
9)  R   texlive-latex-base-doc [2009-11 (natty)]
10) R   texlive-luatex [2009-11 (natty)]        


Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
  dropbox lmodern{a} luatex{a} tex-common{a} texlive-base{a} texlive-binaries{a} texlive-common{a} 
  texlive-doc-base{a} texlive-latex-base{a} texlive-latex-base-doc{a} texlive-luatex{a} 
The following partially installed packages will be configured:
  ipe 
0 packages upgraded, 11 newly installed, 0 to remove and 1 not upgraded.
Need to get 87,4 MB of archives. After unpacking 181 MB will be used.
Do you want to continue? [Y/n/?] n
Abort.

So yeah - if I keep on rejecting all solutions, at the end I'll get "*** No more solutions available ***", and aptitude can either go with those solutions, or abort - but unfortunately cannot ignore them with this technique...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.