【问题标题】:Updating cabal version on Fedora 25在 Fedora 25 上更新 cabal 版本
【发布时间】:2017-08-01 03:20:26
【问题描述】:

我的 Fedora 操作系统上已经安装了 cabal。 cabal 的当前版本是

  user@localhost ~]$ cabal --version
  cabal-install version 1.22.9.0
  using version 1.22.5.0 of the Cabal library 

我想将 cabal 更新到最新版本 Release 1.24.2.0。但是更新不成功。

  user@localhost ~]$ sudo cabal update
  [sudo] password for rajkumar: 
  Downloading the latest package list from hackage.haskell.org
  Skipping download: Local and remote files match.

我的ghc版本是

  user@localhost ~]$ ghc --version
  The Glorious Glasgow Haskell Compilation System, version 7.10.3

以下是上述 2 个步骤的日志。 我在日志中看到它说 Installed cabal-install-1.24.0.2 完成后,cabal --version 仍然不会生成最新版本。任何想法

  [user@localhost ~]$ sudo cabal update
  [sudo] password for user: 
  Downloading the latest package list from hackage.haskell.org
  [user@localhost ~]$ sudo cabal install cabal-install
  Resolving dependencies...
  Downloading Cabal-1.24.2.0...
  Downloading base16-bytestring-0.1.1.6...
  Configuring base16-bytestring-0.1.1.6...
  Downloading cryptohash-sha256-0.11.100.1...
  Downloading ed25519-0.0.5.0...
  Configuring cryptohash-sha256-0.11.100.1...
  Downloading tar-0.5.0.3...
  Building base16-bytestring-0.1.1.6...
  Building cryptohash-sha256-0.11.100.1...
  Installed base16-bytestring-0.1.1.6
  Configuring Cabal-1.24.2.0...
  Configuring ed25519-0.0.5.0...
  Installed cryptohash-sha256-0.11.100.1
  Building Cabal-1.24.2.0...
  Building ed25519-0.0.5.0...
  Configuring tar-0.5.0.3...
  Installed ed25519-0.0.5.0
  Building tar-0.5.0.3...
  Installed tar-0.5.0.3
  Installed Cabal-1.24.2.0
  Downloading hackage-security-0.5.2.2...
  Configuring hackage-security-0.5.2.2...
  Building hackage-security-0.5.2.2...
  Installed hackage-security-0.5.2.2
  Downloading cabal-install-1.24.0.2...
  Configuring cabal-install-1.24.0.2...
  Building cabal-install-1.24.0.2...
  Installed cabal-install-1.24.0.2
  [user@localhost ~]$ cabal --version
  cabal-install version 1.22.9.0
  using version 1.22.5.0 of the Cabal library 
  [user@localhost ~]$ sudo cabal --version
  [sudo] password for user: 
  cabal-install version 1.22.9.0
  using version 1.22.5.0 of the Cabal library 

提前感谢您的友好建议。

【问题讨论】:

    标签: cabal cabal-install


    【解决方案1】:

    根据: https://github.com/haskell/cabal

    安装阴谋集团

    假设您有一个预先存在的旧版本的 cabal-install,请运行: cabal install cabal-install
    获取最新版本的 cabal-install。 (您可能需要先进行 cabal 更新。)

    cabal update
    cabal install cabal-install
    

    cabal update 本身只会从 Hackage 获取当前的包列表。

    【讨论】:

    • 尼克,我听从了你的建议。我确实看到它正在下载 cabal 1.24.0.2。但不知何故,安装完成后,它仍然保留在旧版本中。任何的想法?我是否需要执行任何其他步骤或在此处遗漏任何内容?
    【解决方案2】:

    以下步骤更新~/.cabal/bin 中的阴谋集团,但不会更新/usr/bin 中的符号链接

     sudo cabal update
     sudo cabal install cabal-install
    

    因此,之后我也按照以下步骤操作,这对我有所帮助。

    [user@localhost ~]$ which cabal
    /usr/bin/cabal
    [user@localhost ~]$ sudo rm -rf /usr/bin/cabal
    [sudo] password for user: 
    [user@localhost ~]$ which cabal
    ~/.cabal/bin/cabal
    [user@localhost ~]$ cabal --version
    cabal-install version 1.24.0.2
    compiled using version 1.24.2.0 of the Cabal library 
    [user@localhost ~]$ sudo ln -s ~/.cabal/bin/cabal /usr/bin
    [sudo] password for user: 
    [user@localhost ~]$ which cabal
    /usr/bin/cabal
    [user@localhost ~]$ cabal --version
    cabal-install version 1.24.0.2
    compiled using version 1.24.2.0 of the Cabal library 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多