Игнорирование определенных неудовлетворенных зависимостей с помощью aptitude?

Это моя ситуация: я установил программу с именем ipe «принудительно» через пакет deb; причина в том, что ipe зависит от texlive-latex-base, однако я уже поддерживаю отдельную установку latex через tlmgr. Однако с такой установкой ipe проблем не возникает, если я не забываю запускать ее из терминала, что мне подходит.

Проблема в том, что эта нарушенная зависимость теперь не позволяет мне устанавливать пакеты, которые совершенно не связаны - в этом случае 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).

Теперь, если я попробую -f install , который попытается исправить установку ipe, чего я и не хочу .

Оказывается, aptitude похоже, что может предложить способ игнорировать / пропустить эту зависимость:

$ 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.

Странная вещь: даже если я укажу r 1 - и программа фактически подтверждает, что с «Rejecting the removal of ipe» - я все еще получаю «The following packages will be REMOVED» в конце концов, что я конкретно не хочу делать ? (Кстати, я также пытался a 1, и конечные результаты полностью совпадают: «... УДАЛЕНО», хотя это действие, которое я ожидал бы для этого выбора).

1124 Куда я иду не так? Я неправильно понимаю, что они подразумевают под «новыми решениями»? И есть ли способ, чтобы система apt / aptitude знала, что я бы предпочел, чтобы она игнорировала неудовлетворенные зависимости (в данном случае) ipe?

1
задан 21 January 2014 в 16:29

1 ответ

РЕДАКТИРОВАТЬ: Хорошо, как отмечено ниже, вещь «отклонение удаления ...» в aptitude не работает - это то, что мне удалось, хотя ...

При поиске, скажем, Package: ipe, можно получить доступ к файлам, таким как:

$ 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
...

... однако, они не правы - очевидно, информация о времени выполнения для apt-get и т. Д. хранится в /var/lib/dpkg/status (через . Как исправить ошибку «Проблема с MergeList» или «Файл состояния не может быть проанализирована» при попытке выполнить обновление? ).

Итак, я открыл этот файл через sudo nano /var/lib/dpkg/status, посмотрел «Package: ipe», а затем попытался прокомментировать часть texlive-latex-base «Depends:» - сначала поместив его в отдельную строку , комментируя его с помощью знака числа / хэша #. Обратите внимание, что это не работает - сначала вы получите такие ошибки, как:

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)

... затем, если вы попытаетесь добавить это двоеточие, как в #:, вы ' ll получит:

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)

Очевидно, эти файлы не используют комментарии; и, кажется, они описаны в Руководство по политике Debian - Управляющие файлы и их поля . Затем я обнаружил:

# 353040 - [DPKG-DEB] не слишком шумят о пользовательских полях в DEBIAN / control - журналы отчетов об ошибках Debian

Правильный способ включить поле в .deb - это использовать поля с именем "XB - *".

... так, по сути, вместо использования символа комментария для «закомментирования» - я просто использовал вместо этого пользовательское поле, которое я произвольно назвал XB-Ignore:; так что часть /var/lib/dpkg/status в итоге выглядела так:

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
...

С сохранением этого изменения я мог выполнить установку, используя apt-get напрямую, без проблем:

$ 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 ...

Я просто отмечу, что /var/lib/dpkg/status не является постоянным файлом - фактически, сразу после apt-get install, если вы проверите файл еще раз, Depends: и XB-Ignore: больше не будут находиться на соседних строках (так как они изначально были, как показано в фрагменте выше)!


Хотя вопрос об игнорировании неудовлетворенной зависимости все еще открыт отмечен выше - оказывается, я сделал неверно истолковывают, что это за «новые решения»: это тот выбор, который вам предложит aptitude, если вы ответите «нет» на «Принять это решение?» Вопрос:

...
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.

Так что да - если я продолжу отвергать все решения, в конце я получу «*** Нет доступных решений ***», и aptitude может пойти с эти решения, или отменить - но, к сожалению, не могут игнорировать их с помощью этой техники ...

0
ответ дан 21 January 2014 в 16:29

Другие вопросы по тегам:

Похожие вопросы: