Debian 8.10にgcc-5をインストールする方法は?

Debian 8.10にgcc-5をインストールする方法は?

私はbeaglebone greenのdebian 8.10にgcc-5をインストールしようとしています。

私は多くのトピックを見ましたが、次は最も有望なトピックです。 Debian jessie 8.1にGCC 5をインストールする方法

指示に従ってください。

echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list

sudoを使用して同じことをしようとすると、エラーが発生します。

ユーザー権限を高めるために sudo su - を使用すると成功したようです。

debian@beaglebone:~$ echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list
-bash: /etc/apt/sources.list.d/unstable.list: Permission denied
debian@beaglebone:~$ sudo echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list
-bash: /etc/apt/sources.list.d/unstable.list: Permission denied
debian@beaglebone:~$ sudo su -
root@beaglebone:~# echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list
root@beaglebone:~# cat /etc/apt/sources.list.d/unstable.list 

deb http://ftp.us.debian.org/debian unstable main contrib non-free
root@beaglebone:~# exit
logout
debian@beaglebone:~$ sudo cat /etc/apt/sources.list.d/unstable.list

deb http://ftp.us.debian.org/debian unstable main contrib non-free
debian@beaglebone:~$ 

引き続き sudo apt-get update を実行すると、すべてが大丈夫に見えます。

debian@beaglebone:~$ sudo apt-get update
Ign http://deb.debian.org jessie InRelease
Hit http://repos.rcn-ee.com jessie InRelease                                                            
Hit http://deb.debian.org jessie-updates InRelease                                                      
Hit http://deb.debian.org jessie/updates InRelease
Hit https://deb.nodesource.com jessie InRelease
Hit https://deb.nodesource.com jessie InRelease
Hit http://ftp.us.debian.org unstable InRelease
Hit http://deb.debian.org jessie Release.gpg   
Hit http://deb.debian.org jessie Release
Get:1 http://repos.rcn-ee.com jessie/main armhf Packages [987 kB]
Get:2 http://deb.debian.org jessie-updates/main armhf Packages [20 B]            
Get:3 http://deb.debian.org jessie-updates/contrib armhf Packages [20 B]                           
Get:4 https://deb.nodesource.com jessie/main armhf Packages [980 B]                    
Get:5 http://deb.debian.org jessie-updates/non-free armhf Packages [20 B]                               
Get:6 http://deb.debian.org jessie/updates/main armhf Packages [961 kB]                
Get:7 https://deb.nodesource.com jessie/main Sources [20 B]                          
Get:8 https://deb.nodesource.com jessie/main armhf Packages [765 B]                                     
Get:9 http://ftp.us.debian.org unstable/main armhf Packages [11.9 MB]                                   
Get:10 http://deb.debian.org jessie/updates/contrib armhf Packages [994 B]                              
Get:11 http://deb.debian.org jessie/updates/non-free armhf Packages [4,393 B]                           
Get:12 http://deb.debian.org jessie/main armhf Packages [8,898 kB]                                      
Get:13 http://ftp.us.debian.org unstable/contrib armhf Packages [61.4 kB]                               
Get:14 http://ftp.us.debian.org unstable/non-free armhf Packages [78.7 kB]                              
Get:15 http://deb.debian.org jessie/contrib armhf Packages [44.3 kB]                                    
Get:16 http://deb.debian.org jessie/non-free armhf Packages [74.9 kB]                                   
Fetched 23.0 MB in 1min 22s (281 kB/s)                                                                  
Reading package lists... Done
debian@beaglebone:~$ 

しかし、最後のコマンドを試してみると、次のようになります。

apt-get install -t unstable gcc-5

動作しません。デフォルトユーザーとして:

debian@beaglebone:~$ sudo apt-get install -t unstable gcc-5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-5
debian@beaglebone:~$ 

ユーザーを昇格させても同じことが起こります。

root@beaglebone:~# apt-get install -t unstable gcc-5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-5
root@beaglebone:~#

このカーネルイメージを使用していますDebian 8.10 2018-02-01 4GB SD SeeedStudio IoT

この特定のイメージはサポートされている最新のイメージなので、実行する必要があります。HDMIコーナー

C / C ++コードでNode.jsサーバーを実行しようとしています。 node.jsサーバーとアプリケーションを実行できない理由は、次の理由で正しいgccバージョンがないためです。

node server.jsを実行するたびに、次のエラーが発生します。

私のホストにはgccバージョン9.4とNode jsバージョン10.19があります。

うん、私は走った。

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

ホストとターゲットで。

また、debian 8ガイドに従って別のバージョンのnodejsをインストールしましたが、同じ問題が解決しません。

https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-debian-8

どんな助けでも大変感謝します。

ベストアンサー1

問題は、あなたが見つけた指示があなたが使用したいDebianのバージョンと同じくらい古くなっていることです。このような古いソフトウェアを使用しないことを強くお勧めします。最新バージョンの Debian の使用を検討してください。

つまり、必要なバージョンのDebainに適したgcc-5リポジトリを見つける必要があります。 「Unstable」は、「now」バージョンと同様に、現在のバージョンのコード名を意味します。一方、現在の安定版Jessieは時代にはるかに劣っています。このパッケージは互換性がありません。

jessie-backportsもgcc-4.9のみをリリースし、5はリリースしません。 Debian 拡張リポジトリを試してみることもできますが、多くは gcc パッケージに依存し、新しいメジャーバージョンにうまく反応しない可能性があるため、難しいかもしれません。

次の方法でStretchリポジトリを追加できます。

echo "deb http://ftp.us.debian.org/debian stretch main contrib non-free" >> /etc/apt/sources.list.d/buster.list

アップグレードによってシステムが損傷する可能性があるのを防ぐために、これらの新しいリポジトリに低い優先順位を割り当てる必要があります。

cat - > /etc/apt/preferences.d/99stretch <<EOF
Package: *
Pin: release v=9.13
Pin-Priority: 99
EOF

より適切な好みそしてDebian を台無しにしないでください。新しいファイルは、S99stretchシステムがデフォルトでストレッチストアからパッケージをインストールしないように、ストレッチストアを設定する必要があります。たとえば、このリポジトリでソフトウェアのインストールを明示的に有効にして有効にする必要があります。

apt-get install -t strech-main gcc-5

これにより、strechリポジトリからgccを具体的にインストールできます。それにもかかわらず、これはまったく機能しないか、最終的にアップグレード全体を延長する必要があるかもしれません。私はこれを試していなかったし、Jesseに固執したい場合は、これが私がアプローチする方法です。

おすすめ記事