美文网首页
由一个git clone引发的一连串

由一个git clone引发的一连串

作者: 菲胖 | 来源:发表于2016-07-28 14:17 被阅读400次

在我的电脑上,git clone经常出现错误,例如
git clone https://github.com/kubernetes/kubernetes.git
error: gnutls_handshake() failed: A TLS packet with unexpected length was received.

这里找到答案,在proxy以后,gnutls工作非常奇怪,但是openssl能工作很好。
因此按照此步骤,重新编译git

sudo apt-get update
sudo apt-get install build-essential fakeroot dpkg-dev libcurl4-openssl-dev
sudo apt-get build-dep git
mkdir ~/git-openssl
cd ~/git-openssl
apt-get source git
dpkg-source -x git_1.7.9.5-1.dsc
cd git-1.7.9.5
vim debian/control   //将libcurl4-gnutls-dev替换成libcurl4-openssl-dev
sudo dpkg-buildpackage -rfakeroot -b -d
386: sudo dpkg -i ../git_1.7.9.5-1_i386.deb
x86_64: sudo dpkg -i ../git_1.7.9.5-1_amd64.deb
  • 问题 1
    Setting up fontconfig (2.11.0-0ubuntu4.1) ...
    Regenerating fonts cache... failed.
    See /var/log/fontconfig.log for more information.
    dpkg: error processing package fontconfig (--configure):
    subprocess installed post-installation script returned error exit status 1
    Setting up apt-utils (1.0.1ubuntu2.6) ...
    Errors were encountered while processing: fontconfig
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    /.local/share/fonts: fc-cache: symbol lookup error: fc-cache: undefined symbol: FcStrListFirst
    

答案是
apt-get remove --purge fontconfig-config
后来发现完全删除fontconfig也会有问题。最后的解决方案是:

cd /usr/lib/x86_64-linux-gnu
rm libfont*
sudo apt-get install libfontconfig1
  • 问题 2
    sudo dpkg-buildpackage -rfakeroot -b -d过程中出现gcc版本过低的情况:
    gcc: error: unrecognized command line option '-fstack-protector-strong'
    但是安装过程中,发现源没有:
    $ sudo apt-get install gcc-4.9 Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
     gcc-4.9 : Depends: cpp-4.9 (= 4.9.2-10ubuntu13) but it is not going to be installed
         Depends: gcc-4.9-base (= 4.9.2-10ubuntu13) but 4.9.3-0ubuntu4 is to be installed
         Depends: libgcc-4.9-dev (= 4.9.2-10ubuntu13) but it is not going to be installed`
    

需要添加源ppa:ubuntu-toolchain-r/test
按理说sudo add-apt-repository ppa:ubuntu-toolchain-r/test这样是可以的,可是一直不成功,后来找到答案说是过时了,正确是
sudo apt-add-repository "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" `
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
(保留原来的4.8.2版本,便于快速切换)
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo update-alternatives --config gcc
sudo update-alternatives --config g++

相关文章

  • 由一个git clone引发的一连串

    在我的电脑上,git clone经常出现错误,例如git clone https://github.com/kub...

  • git服务器配置提交钩子

    在本地clone一个仓库 git clone ssh://�git@server:port/project.git...

  • Udacity Git & Github

    Git git init在当前目录下创建新的空仓库。 git clone $ git clone 创建一个与现...

  • 如何 clone git 项目到一个非空目录

    如果我们向一个非空的目录下 clone git 项目, git clone https://git.coding....

  • Git Bash使用随记

    clone 代码 git clone git@xxxxxx默认master分支 clone 指定分支代码 git ...

  • [Git] git常用命令

    取得Git仓库 初始化一个版本仓库git init Clone远程版本库git clone git@xbc.me:...

  • 2019-04-05

    Git Clone 用法 拷贝一个 Git 仓库到本地,本地目录名称与Git 仓库同名git clone <版本库...

  • git

    仓库 当前目录新建一个代码库 git init检出仓库 git clone检出标签处的仓库 git clone -...

  • git基础操作

    基本: 从master分支clone git clone地址 从指定分支clone git clone -b 远程...

  • git只拉取最新版本

    git clone 中加入参数 --depth=1,只拉取最近的一个 revision。 git clone --...

网友评论

      本文标题:由一个git clone引发的一连串

      本文链接:https://www.haomeiwen.com/subject/tybojttx.html