arm 开发板更新 gcc/gcc++ | Debain 更新 gcc,无需编译直接更新 gcc
4我的板子是 Orange pi 3,只能以 卧槽来形容。。。
我是搞.net core的,这板子死活搞不了。
刷的是Debain系统。
说实话,这个板子不错,可就是官方的系统实在不敢恭维,内核旧,软件兼容性不行。
不说废话了。
背景
板子系统Debain,内核 4.9,只适配了GCC 4.9.
我要安装 .net core 3 arm64
无法运行,因为要求 GCC version > 5.2
网上的方法,大多是copy的,要下载gcc源码包,然后编译。我想说,你就算用 8G 内存的电脑,解压、配置、编译,没几个小时搞不来。
要是你的设备是 1G 的开发板,估计就 20+ 小时了。
以下命令备用,可能有些刚刚进坑的师弟师妹不熟悉 linux
#查看GCC 版本 gcc -v #apt-get 源的位置 /etc/apt/sources.list #查看系统内核版本 uname -a #查看系统32还是64位 #返回64即为64位,无返回或者返回32、其它,为32为 getconf LONG_BIT #vim 打开文件后 #按 i 修改文本 #按 ESC 键进入命令模式,输入 :wq! 保存并退出
步骤一,更新 apt-get 源
输入命令修改apt源
sudo vim /etc/apt/sources.list
打开的文件中,就是你的默认源,把所有 https 开头的连接,都改成 http ( 带 # 的 不用改)
步骤2
在开头 增加 源
deb http://ftp.debian.org/debian sid main
#上面的一条一定要添加
#下面的不用添加,备用即可
deb http://mirrors.163.com/debian/ jessie main non-free contrib deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib deb-src http://mirrors.163.com/debian/ jessie main non-free contrib deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
第一条是Debain官方源,其它为163的源。如果不加debain源,很可能会报错
步骤3,更新源
apt-get update
可能费时间
步骤4,可能会报错
可能会出现如下的错误提示 (图片中最后3条)
Err http://mirrors.ustc.edu.cn jessie-backports/main arm64 Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] Err http://mirrors.ustc.edu.cn jessie-backports/contrib arm64 Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] Err http://mirrors.ustc.edu.cn jessie-backports/non-free arm64 Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] Get:4 http://ftp.debian.org sid InRelease [242 kB] Get:5 http://ftp.debian.org sid/main Translation-en [6316 kB] Get:6 http://ftp.debian.org sid/main arm64 Packages [8096 kB] Fetched 14.7 MB in 3min 3s (79.7 kB/s) W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-arm64/Packages' in Release file (Wrong sources.list entry or malformed file) W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie/main/binary-arm64/Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie/contrib/binary-arm64/Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie/non-free/binary-arm64/Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie-backports/main/binary-arm64/Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie-backports/contrib/binary-arm64/Packages 404 Not Found [IP: 2001:da8:d800:95::110 80] W: Failed to fetch http://mirrors.ustc.edu.cn/debian/dists/jessie-backports/non-free/binary-arm64/Packages 404 Not Found [IP:
不管他,报错就报错,只要刚刚添加的apt源能够更新即可
步骤5
此命令安装 gcc,安装过程中会出现一些提示记得点 y
sudo apt-get -t sid install libc6 gcc
如无意外,会更新到最新版本,我的更新到 gcc 8.3了
你可能会问,gcc++ 呢?
其实安装gcc的时候,一起安装了
其它,此命令可以装好gcc,gcc++等库
apt-get install build-essential
安装支持 https的方法
sudo apt-get install apt-transport-https
痴者工良(https://whuanle.cn)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?