更新Fedora 25上的cabal版本

时间:2017-08-01 03:20:26

标签: cabal cabal-install

我的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更新到最新版本版本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 

提前感谢你的善意建议。

2 个答案:

答案 0 :(得分:1)

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

  

安装Cabal

     

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

cabal update
cabal install cabal-install

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

答案 1 :(得分:1)

以下步骤更新~/.cabal/bin中的cabal,但不会更新/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