nuBacuk
@nuBacuk
Python/Linux

Как обновить gcc в Debian?

Сейчас стоит Debian Stable, с последними обновлениями и там последний gcc это 4.9.
Как обновить его до 5-ой версии?
apt-get install gcc-5 g++-5–не работают.
  • Вопрос задан
  • 4242 просмотра
Решения вопроса 2
olddirtyjeans
@olddirtyjeans
Потом что нибудь напишу.
/etc/apt/sources.list
deb ftp.debian.org/debian stretch main
deb ftp.us.debian.org/debian testing main contrib non-free
~# apt list --upgradable
~# apt upgrade
~# apt-cache search gcc
~# apt install gcc-5
Ответ написан
Комментировать
nuBacuk
@nuBacuk Автор вопроса
Python/Linux
I needed GCC 5+ installed on debian jessie and, as is available for debian testing (at least on jun-16) you can use apt-pinning to install packages available there (see https://wiki.debian.org/AptPreferences).

To install GCC 5+ from testing on debian jessie using apt-pinning:

Add debian testing repo to your apt sources by creating a file on /etc/apt/sources.list.d folder containing the line deb ftp.us.debian.org/debian testing main contrib non-free
Instruct debian to use testing sources on certain packages by creating a file on /etc/apt/preferences.d containing the following:

Package: *
Pin: release a=testing
Pin-Priority: 100

You can replace the * by the package name that you want to install from testing (in this case would be gcc), but with Pin-Priority: 100, testing packages will be installed only if explicitly told to apt-get
Update apt database: sudo apt-get update
Install gcc from testing: sudo apt-get install -t testing gcc

Note that using -t testing you tell apt-get to install gcc from testing sources as configured earlier.
I strongly suggest to clean any compilation and re-compile any dependency before compiling your sources again.

Have fun!

Нашел здесь unix.stackexchange.com/questions/284817/how-to-ins...
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
sim3x
@sim3x
Без понимания к чему может привести apt-pinning - я б не советовал
Если разрабу нужно собрать что-то кастомное - пусть пилит на том что есть

Как вариант - сделать в /opt раздел для сборки с теми сорцами, что нужны
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы