linux - 无法在 ubuntu 上从源代码安装 git

标签 linux git ubuntu debian

<分区>

当我在 checkinstall 之后安装 deb 包时,我在 ubuntu16.04 上遇到了问题。

我在 debian9 和 ubuntu18.04 上也有同样的问题

在 UBUNTU 14.04 和 Centos7 上,我从源代码安装了 git,没有问题。


$ wget https://git.kernel.org/pub/scm/git/git.git/snapshot/git-2.16.2.tar.gz

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x

$ make configure

$ ./configure --prefix=/usr/local

$ make all

$ sudo checkinstall --install=no

$ sudo dpkg -i git_2.16.2-1_amd64.deb

Selecting previously unselected package git. (Reading database ... 209500 files and directories currently installed.) Preparing to unpack git_2.16.2-1_amd64.deb ... Unpacking git (2.16.2-1) ... dpkg: dependency problems prevent configuration of git: libcgi-pm-perl (4.38-1) breaks git (<< 1:2.1.3) and is installed. Version of git to be configured is 2.16.2-1.

dpkg: error processing package git (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.8.2-1) ... Errors were encountered while processing: git

之后我无法升级

$ sudo apt-get upgrade Reading package lists... Done Building dependency tree
Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: libcgi-pm-perl : Breaks: git (< 1:2.1.3) E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我做了 'apt-get --fix-broken install' 但它没有帮助

谁知道问题出在哪里? 感谢您的帮助。

最佳答案

你应该试试

  1. sudo apt-get update
  2. sudo apt-get install git

如有错误,请按照步骤 3 和 4

  1. sudo apt-get install -f
  2. sudo apt-get install git

引用这个Digital Ocean Git installation link .您还可以选择安装 linuxbrew并用它来安装 git。

关于linux - 无法在 ubuntu 上从源代码安装 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49315562/

相关文章:

android - 无法从 Ubuntu 18.10 访问 Redmi Note 5 Pro

regex - 如何使用 UNIX 命令将整数更改为 float

linux - 如何在 Linux Shell 脚本中检查组是否存在并添加是否不存在

linux - 读取 `stdout` 和 `stderr` 的值

Gitflow 安装问题

git - 使用 grep 排除箭头图案 "->"

git - 需要帮助加载 git-completion.bash 文件

linux - 定期将 bash 历史推送到 github

php - Python 没有正确重启 linux 进程

bash - git pull -X 他们的需要在 ubuntu 中进行 MERGE_MSG 编辑,但在 Windows 中不需要