ubuntu22.04和ubuntu20.04 的ssh配置不然repo init失败

ubuntu22.04

bash 复制代码
Host *
        HostKeyAlgorithms +ssh-rsa
        pubkeyAcceptedKeyTypes +ssh-rsa
        KexAlgorithms +diffie-hellman-group1-sha1

ubuntu20.04

bash 复制代码
ubuntu@ubuntu-HP-ProDesk-480-G7-PCI-Microtower-PC:~/zyh$ cat ~/.ssh/config
Host *
    KexAlgorithms +diffie-hellman-group1-sha1
    StrictHostKeyChecking no

repo sync同步代码报错

bash 复制代码
Checking out projects:   2% (49/2440) platform/developmenterror: Cannot checkout device/amlogic/yukawa: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 7: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/ubuntu/.bin/repo/main.py", line 541, in <module>
    _Main(sys.argv[1:])
  File "/home/ubuntu/.bin/repo/main.py", line 516, in _Main
    result = run()
  File "/home/ubuntu/.bin/repo/main.py", line 509, in <lambda>
    run = lambda: repo._Run(name, gopts, argv) or 0
  File "/home/ubuntu/.bin/repo/main.py", line 212, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/ubuntu/.bin/repo/subcmds/sync.py", line 994, in Execute
    self._Checkout(all_projects, opt)
  File "/home/ubuntu/.bin/repo/subcmds/sync.py", line 553, in _Checkout
    self._CheckoutWorker(**kwargs)
  File "/home/ubuntu/.bin/repo/subcmds/sync.py", line 435, in _CheckoutWorker
    return self._CheckoutOne(opt, project, *args, **kwargs)
  File "/home/ubuntu/.bin/repo/subcmds/sync.py", line 469, in _CheckoutOne
    project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
  File "/home/ubuntu/.bin/repo/project.py", line 1532, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync, submodules=submodules)
  File "/home/ubuntu/.bin/repo/project.py", line 2774, in _InitWorkTree
    _lwrite(os.path.join(tmpdotgit, HEAD), '%s\n' % self.GetRevisionId())
  File "/home/ubuntu/.bin/repo/project.py", line 1516, in GetRevisionId
    return self.bare_git.rev_parse('--verify', '%s^0' % rev)
  File "/home/ubuntu/.bin/repo/project.py", line 3046, in runner
    (self._project.name, name, p.stderr))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 7: ordinal not in range(128)

从你给出的错误信息可知,repo sync 同步代码时出现了 UnicodeDecodeError 错误,此错误通常是因为 Python 在尝试使用 ascii 编解码器对包含非 ASCII 字符的字符串进行解码时引发的。

bash 复制代码
echo 'export PYTHONIOENCODING=utf-8' >> ~/.bashrc
echo 'export LC_ALL=en_US.UTF-8' >> ~/.bashrc
source ~/.bashrc
相关推荐
小白银子3 小时前
零基础从头教学Linux(Day 45)
linux·运维·junit·openresty
半梦半醒*5 小时前
nginx反向代理和负载均衡
linux·运维·nginx·centos·tomcat·负载均衡
喜欢你,还有大家5 小时前
集群的概述和分类和负载均衡集群
运维·负载均衡
liu****5 小时前
负载均衡式的在线OJ项目编写(六)
运维·c++·负载均衡·个人开发
Elastic 中国社区官方博客7 小时前
CI/CD 流水线与 agentic AI:如何创建自我纠正的 monorepos
大数据·运维·数据库·人工智能·搜索引擎·ci/cd·全文检索
A-刘晨阳7 小时前
Linux安装centos8及基础配置
linux·运维·服务器·操作系统·centos8
恒雨田7 小时前
解决 jenkins 用户 SSH 连接目标服务器时的 Permission denied 问题
运维·ssh·jenkins
迎風吹頭髮7 小时前
UNIX下C语言编程与实践14-UNIX 文件系统格式化:磁盘分区与文件系统创建原理
运维·c语言·unix
Saniffer_SH8 小时前
【高清视频】CXL 2.0 over Fibre演示和答疑 - 将内存拉到服务器10米之外
运维·服务器·网络·人工智能·驱动开发·计算机外设·硬件工程
野熊佩骑8 小时前
一文读懂Redis之数据持久化
linux·运维·数据库·redis·缓存·中间件·centos