Updating gcc/gcc++ on ARM Development Board | Update gcc on Debian without compilation

2019年12月15日 48点热度 0人点赞 0条评论
内容目录

4 My board is an Orange Pi 3, and I can only describe it as "卧槽"...

I work with .NET Core, and I just can't get this board to work.

I have flashed the Debian system on it.

To be honest, this board is quite good, but the official system is really not commendable; the kernel is old, and the software compatibility is poor.

Enough of the nonsense.

Background

The system is Debian, with kernel 4.9, only supporting GCC 4.9.

I want to install .NET Core 3 arm64

It cannot run because it requires GCC version > 5.2

 

Most of the methods found online are just copies. They require downloading the GCC source package and compiling it. I want to say, even if you use an 8 GB RAM computer, unpacking, configuring, and compiling will take you several hours.

If your device is a 1 GB development board, it may take over 20 hours.

 

The following commands are for reference; some newcomers might not be familiar with Linux.

# Check GCC version
gcc -v

Location of apt sources

/etc/apt/sources.list

Check system kernel version

uname -a

Check if the system is 32 or 64 bits

If it returns 64, it's 64-bit; if no return or returns 32/other, it's 32-bit

getconf LONG_BIT

After opening a file with vim

Press i to edit text

Press ESC key to enter command mode, type :wq! to save and exit

 

Step 1: Update apt-get sources

Input the command to modify the apt sources

sudo vim  /etc/apt/sources.list

 

In the opened file, change all connections starting with https to http (do not change those with #)

 

 

Step 2

Add sources at the beginning

deb http://ftp.debian.org/debian sid main

# The above line must be added
# The lines below do not need to be added, just keep them for reference
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

  The first line is the official Debian source; the others are from 163. If you do not add the Debian source, it may result in an error.

Step 3: Update sources

apt-get update

This may take some time.

Step 4: Possible error messages

There may be some error messages like the following (the last 3 lines in the picture)

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: 

 

Don't worry about it; errors are errors, as long as the newly added apt source can be updated.

 Step 5

  This command installs gcc; remember to press y when prompted during the installation.

sudo apt-get  -t sid install libc6 gcc

If everything goes well, it will be updated to the latest version; mine was updated to gcc 8.3.

You might ask, what about gcc++?

Actually, when installing gcc, gcc++ was installed together.

Additionally, this command can install gcc, gcc++ and related libraries.

apt-get install build-essential

  Install the method to support https.

sudo apt-get install apt-transport-https

 

痴者工良

高级程序员劝退师

文章评论