Please could you backport the latest version of hledger

Asked by rch

I posted a query
    «Where to find an up-to-date version of hledger for Ubuntu ? »
at https://groups.google.com/forum/#!topic/hledger/DJ5sshStlp8

My query brought the following advice from Simon Michael
    «It might be worth contacting the ubuntu maintainers
    «(see "Maintainer:" in the sidebar at http://packages.ubuntu.com/precise/hledger)
    «and asking them to back-port the latest hledger.
    «Then it would be installable from precise-backports.

If you could do that, I and I think others would be most grateful

Here is the text of my original posting (spelling mistakes corrected)

«Where to find an up-to-date version of hledger for Ubuntu ? »

Questions -
    1. How to uninstall hledger v 0.17;
    2. Where to find a repository with a reasonably up-to-
       date version for Ubuntu 12.04

Explanation -
    My New Years resolution is to sort out my finances
    hledger looks exactly what I need for this.

    So I followed the download instructions
    «I'm on Ubuntu
    « apt-get install hledger hledger-web
    http://hledger.org/download.html

    But this has given me a very old version (0.17)
    which dates from 2012/2/1
    http://hledger.org/release-notes.html#hledger-0.17

    And this version does not give the same results
    as in the (very nice) tutorial
    http://hledger.org/step-by-step.html

    So I want to clean-up and start over
    with an up-to-date version

    But
        sudo apt-get install hledger --only-upgrade
    says
        hledger is already the newest version.

    So it looks like I need to do something like
        apt-get purge hledger
        add-apt-repository ppa:user/ppa-name

    Thats the limit of my abilities
    And I have no idea where to find ppa-name for hledger

 https://groups.google.com/forum/#!topic/hledger/DJ5sshStlp8

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu haskell-hledger Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Rijckenberg
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug. If the security and bug fixes are significant then the package will be updated sooner.

Revision history for this message
rch (rch-skynet) said :
#2

Good advice!
Bug reported at https://bugs.launchpad.net/ubuntu/+source/haskell-hledger/+bug/1407151
Iff that works then I'll mark this as «Problem solved»

Revision history for this message
Best Mark Rijckenberg (markrijckenberg) said :
#3

Please try installing and running the newest version of hledger by copy-pasting these commands into the Terminal:

sudo apt-get update

sudo apt-get install cabal-install

cabal update

cabal install alex happy

echo 'export PATH=$PATH:$HOME/.cabal/bin' >> ~/.bashrc

# Open a new Terminal and run the following commands in the new Terminal window:

cabal install hledger-web

hledger web

Revision history for this message
rch (rch-skynet) said :
#4

Thank you for quick and helpful reply

All went well until
    cabal install hledger-web

This said
    Resolving dependencies...
    In order, the following would be installed:
    Decimal-0.4.2 (new package)
    HUnit-1.2.5.2 (new package)
    …
    snip
    …
    hledger-web-0.24 (new package)
    cabal: The following packages are likely to be broken by the reinstalls:
    tf-random-0.5
    QuickCheck-2.7.6
    Use --force-reinstalls if you want to install anyway.

So what do I do now?

Something like
    « cabal --force-reinstalls hledger-web »
?

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#5

Please read this:

https://www.haskell.org/haskellwiki/Cabal/Survival#Issue_.233_--_using_.27--force-reinstalls.27

So you should try uninstalling those 2 packages instead of forcing a reinstall....

After uninstalling tf-random and QuickCheck, rerun the following command:

cabal install hledger-web

Revision history for this message
rch (rch-skynet) said :
#6

Thank you again for quick reply
But sorry to say, that failed.

I typed
    ghc-pkg unregister tf-random --force
    ghc-pkg unregister QuickCheck --force
    cabal install hledger-web

The « cabal install » produced a great deal of activity
But finished up
    cabal: Error: some packages failed to install:
    authenticate-1.3.2.11 depends on directory-1.2.1.0 which failed to install.
    …
    snip 50 or so similar lines
    …
    yesod-persistent-1.4.0.2 depends on directory-1.2.1.0 which failed to install.
    yesod-static-1.4.0.4 depends on language-javascript-0.5.13 which failed to install.

So now when I type «$ hledger» I get
    The program 'hledger' is currently not installed.
    You can install it by typing:
    sudo apt-get install hledger

Similarly when I type «$ hledger-web» I get
    The program 'hledger-web' is currently not installed.
    You can install it by typing:
    sudo apt-get install hledger-web

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#7

Then I suggest performing a backup of all your data and performing a clean install of Ubuntu 14.04 LTS, which is supported until April 2019. Ubuntu 14.04 LTS contains version 0.22-1 of hledger-web in the Ubuntu repositories. Hopefully, this version should be recent enough...

Revision history for this message
rch (rch-skynet) said :
#8

    Well, thank you again, but
    No thank you.

    Everything else (asciidoc, gimp, gnuplot, Perl, …)
    works just fine, so « If it aint broke, don't fix it »

    I do have a spare computer, and may try
    an upgrade as you suggest.
    If that works, without breaking anything else,
    I will of course post the good news here,
    and mark it « Problem solved ».

    But first, I would be most grateful if anyone else
    has an alternative solution to suggest.

    In particular, a back port of the
    Ubuntu 14.04 LTS version 0.22-1 of hledger
    to Ubuntu 12.04 would seem to be the real answer.

Revision history for this message
Simon Michael (simon) said :
#10

rch: Mark's original suggestion won't work as-is; you also need GHC, and a newer Cabal (for haskeline).

Here is the easiest installation recipe for you, I believe:

1. install newer GHC and Cabal via http://www.stackage.org/install#ubuntu
2. cabal install hledger-web -j

Revision history for this message
rch (rch-skynet) said :
#11

    Thank you; this is looking a lot better
        > 1. install newer GHC and Cabal via http://www.stackage.org/install#ubuntu
             That went well; no problems

        > 2. cabal install hledger-web -j
            But that said
                Resolving dependencies...
                In order, the following would be installed:
                Decimal-0.4.2 (new package)
                HUnit-1.2.5.2 (new package)

                ... snip ...

                yesod-1.4.1.3 (new package)
                yesod-static-1.4.0.4 (new package)
                hledger-web-0.24 (new package)
                cabal: The following packages are likely to be broken by the reinstalls:
                HTTP-4000.2.19
                Use --force-reinstalls if you want to install anyway.

        So what do I do now ?

        Something like
            ghc-pkg unregister HTTP-4000.2.19 --force
        ?

Revision history for this message
Simon Michael (simon) said :
#12

Ah yes. Either install using a cabal sandbox as described at http://hledger.org/download.html , or just clear away the previous attempt and try again: rm -rf ~/.ghc ~/.cabal; cabal install alex happy; cabal install hledger-web

Revision history for this message
rch (rch-skynet) said :
#13

Thank you

But still having that same problem with HTTP-4000.2.19

I followed your
>just clear away the previous
>attempt and try again: rm -rf ~/.ghc ~/.cabal; cabal install alex happy;
>cabal install hledger-web
Steps 1 2 3 gave the following (at 2, a couple of extra steps were asked for)

    1 rm -rf ~/.ghc ~/.cabal
        with sudo that did something

    2 cabal install alex happy
            ...snip...
        Warning: The package list for 'hackage.haskell.org' does not exist.
        Run 'cabal update' to download it.
        cabal: There is no package named 'alex'.
        There is no package named 'happy'.
        You may need to run 'cabal update' to get the latest list of available packages.

    2A. cabal update
            ...snip...
            Note: there is a new version of cabal-install available.
            To upgrade, run: cabal install cabal-install

        2B. cabal install cabal-install
            ...snip...
            Installed cabal-install-1.22.0.0

    2bis cabal install alex happy
        ...
        Installed happy-1.19.4
        Installed QuickCheck-2.7.6
        Installed alex-3.1.3
        ...

    3 cabal install hledger-web
        Same as before
        ...
        snip 155 lines
        ...
        cabal: The following packages are likely to be broken by the reinstalls:
        HTTP-4000.2.19
        Use --force-reinstalls if you want to install anyway.

Revision history for this message
Simon Michael (simon) said :
#14

Hmm, I'm confused. When I follow these steps I have no HTTP package installed at all, verified by "ghc-pkg list". That command will show where the HTTP package is installed. Maybe you have it installed globally, so it was not cleaned out. Another possibility is that you created a sandbox at some point which could confuse things (check if "cabal-sandbox hc-pkg list" succeeds).

I would go ahead and try the --force--reinstalls flag then: "cabal install -j --force-reinstalls hledger-web". Also, it would be interesting to see the output of "cabal install --force-reinstalls hledger-web --dry-run".

 Thanks for your persistence.

Revision history for this message
Simon Michael (simon) said :
#15

Correction: that should have been 'check if "cabal sandbox hc-pkg list" succeeds'.

Revision history for this message
rch (rch-skynet) said :
#16

SUCCESS!
    I did
        cabal install -j --force-reinstalls hledger-web

    And now
        hledger --version

   says
        «hledger 0.24»

    Are you going to FOSDEM?
    I'll buy you a drink (or three)

Revision history for this message
rch (rch-skynet) said :
#17

Thanks Mark Rijckenberg, that solved my question.