Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: aspcud, an alternative solver for apt-get  (Read 4127 times)

Offline musca

  • User
  • Posts: 725
  • sid, fly high!
aspcud, an alternative solver for apt-get
« on: 2014/06/24, 02:12:29 »
Hello dear siductians,
every user of debian sid has seen situations where some packages are broken while others are perfectly installable.
Sometimes our standard tools don't find the best solution or any solution at all for a given state of the repo.
In the following example i use an outdated virtual machine, which has quite some conflicts: 

E.G. today the whole razor-qt desktop could be removed during a dist-upgrade:
Code: [Select]
# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  libgoa-1.0-0 librazorqt0 razorqt razorqt-appswitcher razorqt-autosuspend razorqt-config razorqt-confupdate razorqt-desktop razorqt-globalkeyshortcuts razorqt-notificationd razorqt-openssh-askpass razorqt-panel razorqt-policykit-agent razorqt-power razorqt-runner  razorqt-session siduction-settings-rqt-december wbar-theme-rqt
The following NEW packages will be installed:
  [-- list of 116 packages omitted --]
The following packages have been kept back:
  qterminal siduction-settings-lightdm-december
The following packages will be upgraded:
  [-- list of 757 packages omitted --]
757 upgraded, 116 newly installed, 18 to remove and 2 not upgraded.
Need to get 512 MB of archives.
After this operation, 508 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.



Here you can install the alternative solver "aspcud" to get other solutions from apt-get.
It needs only few dependencies like clasp and gringo (but latest version needs no python anymore!).
Code: [Select]
# apt-get install aspcud apt-cudf
Now you can call apt-get with the new solver:
Code: [Select]
# apt-get --solver aspcud dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Execute external solver... Done
Done
Execute external solver... Done
The following NEW packages will be installed:
 -- list of 115 packages --
The following packages have been kept back:
  gvfs gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-libs libgoa-1.0-common libqtxdg0 qterminal siduction-settings-lightdm-december
The following packages will be upgraded:
  -- list of 750 packages --
750 upgraded, 115 newly installed, 0 to remove and 10 not upgraded.
Need to get 492 MB of archives.
After this operation, 483 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.



So aspcud has calculated a usable solution with most of the new packages but no removals.

Have fun with apt-get!
musca
„Es irrt der Mensch, solang er strebt.“  (Goethe, Faust)

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.696
Re: aspcud, an alternative solver for apt-get
« Reply #1 on: 2014/06/24, 10:27:38 »
In that context, let me introduce you to new functionality shipped with apt (not apt-get!). You can use
Code: [Select]
apt update to renew your lists. That will prompt you to
Code: [Select]
apt list --upgradable which shows you a list of packages that can be installed. You may then use
Code: [Select]
apt upgrade (instead of apt-get dist-upgrade, please mind the difference between apt upgrade and apt-get upgrade).

apt upgrade equals apt-get dist-upgrade, it installs new packages that are pulled in as dependencies, but does not remove anything (supposedly). You can test this if you like. I have been doing so for a few days with good results. Need to find the time to read what flags it sets to do that.


greetz
devil

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
Re: aspcud, an alternative solver for apt-get
« Reply #2 on: 2014/06/24, 12:38:35 »
Yes, good post devil, been testing this also, so far so good here.

musca, I have not tried that one yet, looks good, will test it also
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Offline musca

  • User
  • Posts: 725
  • sid, fly high!
Re: aspcud, an alternative solver for apt-get
« Reply #3 on: 2014/06/24, 13:17:25 »
Hello devil,
 i tried it. The numbers are not directly comparable, as i had to install 25 packages
(apt + virtualbox-guest*, xserver-xorg).

Code: [Select]
# apt upgradeReading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  -- list of 112 packages omitted --
The following packages have been kept back:
  gvfs gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-libs libgoa-1.0-common libqtermwidget0 libqtxdg0 qterminal qtermwidget-data
  siduction-settings-lightdm-december
The following packages will be upgraded:
  -- list of 726 packages omitted --
726 upgraded, 112 newly installed, 0 to remove and 12 not upgraded.Need to get 490 MB of archives.
After this operation, 483 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.


So the result is similar to the solution of aspcud.  But even the old apt-get can do this:
Code: [Select]
apt-get upgrade --with-new-pkgs726 upgraded, 112 newly installed, 0 to remove and 12 not upgraded.


None of the tools prints reasons for its decisions as clearly as aptitudes interactive resolver.
Sadly its first suggestion isn't the best solution, so you need to press n to iterate through the solutions:

Code: [Select]
aptitude dist-upgrade-- lists of 852 packages omitted --
738 packages upgraded, 116 newly installed, 0 to remove and 0 not upgraded.
Need to get 493 MB/493 MB of archives. After unpacking 484 MB will be used.
The following packages have unmet dependencies:
 libgoa-1.0-0b : Conflicts: libgoa-1.0-0 but 3.8.3-2 is installed.
 razorqt-panel : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-confupdate : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 librazorqt0 : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-notificationd : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-globalkeyshortcuts : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-appswitcher : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 libqtermwidget4-0 : Conflicts: libqtermwidget0 (< 0.5.0) but 0.4.0.3.siduction.2 is to be installed.
                     Conflicts: qtermwidget-data (< 0.5.0) but 0.4.0.3.siduction.2 is to be installed.
 libgoa-1.0-0 : Depends: libgoa-1.0-common (= 3.8.3-2) but 3.12.2-1 is to be installed.
 razorqt-power : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-autosuspend : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-session : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-openssh-askpass : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-runner : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-config : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 razorqt-policykit-agent : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
 siduction-settings-lightdm-gtk-december : Breaks: siduction-settings-lightdm-december but 2014.02.10 is to be installed.
 razorqt-desktop : Depends: libqtxdg0 (= 0.5.2.8.3) but 0.6.99.siduction.16 is to be installed.
The following actions will resolve these dependencies:

      Remove the following packages:                       
1)      libgoa-1.0-0                                       
2)      librazorqt0                                       
3)      qterminal                                         
4)      razorqt                                           
5)      razorqt-appswitcher                               
6)      razorqt-autosuspend                               
7)      razorqt-config                                     
8)      razorqt-confupdate                                 
9)      razorqt-desktop                                   
10)     razorqt-globalkeyshortcuts                         
11)     razorqt-notificationd                             
12)     razorqt-openssh-askpass                           
13)     razorqt-panel                                     
14)     razorqt-policykit-agent                           
15)     razorqt-power                                     
16)     razorqt-runner                                     
17)     razorqt-session                                   
18)     siduction-settings-lightdm-december               
19)     siduction-settings-rqt-december                   
20)     wbar-theme-rqt                                     

      Keep the following packages at their current version:
21)     libqtermwidget4-0 [Not Installed]                 

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

      Remove the following packages:                       
1)      libgoa-1.0-0                                       
2)      libqtermwidget0                                   
3)      librazorqt0                                       
4)      qterminal                                         
5)      razorqt                                           
6)      razorqt-appswitcher                               
7)      razorqt-autosuspend                               
8)      razorqt-config                                     
9)      razorqt-confupdate                                 
10)     razorqt-desktop                                   
11)     razorqt-globalkeyshortcuts                         
12)     razorqt-notificationd                             
13)     razorqt-openssh-askpass                           
14)     razorqt-panel                                     
15)     razorqt-policykit-agent                           
16)     razorqt-power                                     
17)     razorqt-runner                                     
18)     razorqt-session                                   
19)     siduction-settings-lightdm-december               
20)     siduction-settings-rqt-december                   
21)     wbar-theme-rqt                                     

      Keep the following packages at their current version:
22)     libqtermwidget4-0 [Not Installed]                 

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

      Remove the following packages:       
1)      libgoa-1.0-0                       
2)      libqtermwidget0                   
3)      librazorqt0                       
4)      qtermwidget-data                   
5)      razorqt                           
6)      razorqt-appswitcher               
7)      razorqt-autosuspend               
8)      razorqt-config                     
9)      razorqt-confupdate                 
10)     razorqt-desktop                   
11)     razorqt-globalkeyshortcuts         
12)     razorqt-notificationd             
13)     razorqt-openssh-askpass           
14)     razorqt-panel                     
15)     razorqt-policykit-agent           
16)     razorqt-power                     
17)     razorqt-runner                     
18)     razorqt-session                   
19)     siduction-settings-lightdm-december
20)     siduction-settings-rqt-december   
21)     wbar-theme-rqt                     

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Remove the following packages:                       
1)     libgoa-1.0-0                                       
2)     qterminal                                         
3)     siduction-settings-lightdm-december               

     Keep the following packages at their current version:
4)     libqtermwidget4-0 [Not Installed]                 
5)     libqtxdg0 [0.5.2.8.3 (<NULL>, now)]               

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Remove the following packages:                       
1)     libgoa-1.0-0                                       
2)     libqtermwidget0                                   
3)     qtermwidget-data                                   
4)     siduction-settings-lightdm-december               

     Keep the following packages at their current version:
5)     libqtxdg0 [0.5.2.8.3 (<NULL>, now)]               

Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.

Obviously there is no warranty that you find a nice solution as quickly as in this example.
Iterating through tens or hundreds of possible solutions usually is not successful.
Better reduce the number possiblities by setting libqtxdg0 on hold and then try again.

The idea is: Let some tools try to find a valid solution but dont break my own brain with tons of output to read.
Different situations need different algorithms, so it's good to have several tools to choose from.
This complexity is the reason for the introduction of aspcud, packup and other alternative solvers.
Oops, now i mentioned packup. Are you ready to try it? Who is the first to give feedback?

Wow, what a lengthy thread, you get bonus points for reading to the end!
Thanks for your interest.

greetings
musca


„Es irrt der Mensch, solang er strebt.“  (Goethe, Faust)

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

UP2L8

  • Guest
Re: aspcud, an alternative solver for apt-get
« Reply #5 on: 2014/07/10, 19:41:05 »
Wow, what a lengthy thread, you get bonus points for reading to the end!

greetings
musca

Cool, I read it to the end.  What will the bonus points get me?   :D