安装Git
sudo apt install git
Git LFS(Large File Storage, 大文件存储)
sudo apt-get install git-lfs
git lfs install
curl 16 Error:
error: RPC failed; curl 16 Error in the HTTP2 framing layer
fatal: expected flush after ref listing
- 强制git使用HTTP 1.1
git config --global http.version HTTP/1.1
- 想要设置回HTTP2
git config --global http.version HTTP/2
跳转到项目目录
cd ~/msai
msai是我的ai项目目录
下载源码并跳转到源码目录
git clone https://github.com/alibaba-damo-academy/KAN-TTS.git
cd KAN-TTS
git clone https://www.modelscope.cn/damo/speech_personal_sambert-hifigan_nsf_tts_zh-cn_pretrain_16k.git
conda config --show-sources
conda config --add channels https://pypi.tuna.tsinghua.edu.cn/simple
删除指定源
conda config --remove channels https://pypi.tuna.tsinghua.edu.cn/simple
删除所有自定义源 还原默认源
conda config --remove-key channels
sudo vim /home/你的用户名/.condarc
channels:
- defaults
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
show_channel_urls: True
清理源索引缓存让新配置生效
conda clean -i
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Writing to /home/fb/.config/pip/pip.conf
创建名为maas的python开发环境
conda env create -f environment.yaml
原因是git版本使用了GnuTLS库,不是OpenSSL
Collecting git+https://github.com/fbcotter/pytorch_wavelets.git (from -r /mnt/d/develop/Ubuntu/kan-tts/condaenv.s5y8fuxa.requirements.txt (line 19))
Cloning https://github.com/fbcotter/pytorch_wavelets.git to /tmp/pip-req-build-utwg371g
Pip subprocess error:
Running command git clone --filter=blob:none --quiet https://github.com/fbcotter/pytorch_wavelets.git /tmp/pip-req-build-utwg371g
fatal: unable to access 'https://github.com/fbcotter/pytorch_wavelets.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
error: subprocess-exited-with-error
× git clone --filter=blob:none --quiet https://github.com/fbcotter/pytorch_wavelets.git /tmp/pip-req-build-utwg371g did not run successfully.
│ exit code: 128
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× git clone --filter=blob:none --quiet https://github.com/fbcotter/pytorch_wavelets.git /tmp/pip-req-build-utwg371g did not run successfully.
│ exit code: 128
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
failed
CondaEnvException: Pip failed
重新编译Git从GnuTLS版本到OpenSSL版本
sudo apt-get install build-essential fakeroot dpkg-dev
sudo apt-get build-dep git
sudo apt-get install libcurl4-openssl-dev
sudo apt install libssl-dev
cd ~
mkdir src-git
cd src-git
apt-get source git
(base) fb@VP01:~/src-git$ apt-get source git
Reading package lists... Done
E: You must put some 'deb-src' URIs in your sources.list
这是deb-src源码地址被注释掉了,以提高apt update速度,我们需要开启才能下载git的源码
备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
修改源列表,去年deb-src前面的#注释
sudo vim /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted
deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ jammy universe
deb-src http://archive.ubuntu.com/ubuntu/ jammy universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://security.ubuntu.com/ubuntu/ jammy-security universe
deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe
deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse
deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse
更新源列表
sudo apt-get update
重新下载git源码
apt-get source git
进入git源码目录
cd git-2.34.1
(base) fb@VP01:~/src-git$ ll
total 7240
drwxr-xr-x 3 fb fb 4096 Apr 10 00:11 ./
drwxr-x--- 13 fb fb 4096 Apr 9 21:15 ../
drwxr-xr-x 28 fb fb 20480 Apr 10 00:11 git-2.34.1/
-rw-r--r-- 1 fb fb 753396 Feb 15 02:53 git_2.34.1-1ubuntu1.8.debian.tar.xz
-rw-r--r-- 1 fb fb 2927 Feb 15 02:53 git_2.34.1-1ubuntu1.8.dsc
-rw-r--r-- 1 fb fb 6623760 Jan 25 2022 git_2.34.1.orig.tar.xz
(base) fb@VP01:~/src-git$ cd git-2.34.1
(base) fb@VP01:~/src-git/git-2.34.1$
不知道是 2.x.x,
可以用通配符进入第一个匹配目录
cd git-2.*.*/
也可以用ll列出详细目录名称
ll
使用 sed 命令将 debian/control 中的 gnutls 库改为 openssl 库
sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control
删除 test 选项
sed -i -- '/TEST\s*=\s*test/d' ./debian/rules
开始编译
dpkg-buildpackage -rfakeroot -b -uc -us
报错 dpkg-checkbuilddeps: error
dpkg-checkbuilddeps: error: Unmet build dependencies: libz-dev gettext libpcre2-dev | libpcre3-dev libexpat1-dev subversion libsvn-perl libyaml-perl tcl libhttp-date-perl | libtime-parsedate-perl libcgi-pm-perl libmailtools-perl cvs cvsps libdbd-sqlite3-perl unzip libio-pty-perl debhelper-compat (= 10) dh-exec (>= 0.7) dh-apache2 asciidoc (>= 8.6.