Installing g++ 7.0.1 on Debian 8.7 - c++

I have been trying for quite some time to install g++ 7 on my Debian machine. I was able to install it quite easily on my mac (as homebrew had a formula for it). However I cannot seem to find a way to install it on Linux.
This individual had a thread on installing g++ 4.9, and changing the url he gave led me to this page, which seems to be in the right direction... But I imagine installing it this way might lead to a few potential problems down the road when I wish to update these packages.
Is there a source I'm missing? Or is there maybe a place where I can download and compile everything I need to get it running?
Thank you for your help.
Helpful Data:
My kernel is x86_64 Linux 3.16.0-4-amd64.
Edit: After following Dietrich's advice, I am now met with a new error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gcc-7 : Depends: cpp-7 (= 7-20170316-1) but it is not going to be installed
Depends: libcc1-0 (>= 7-20170316-1) but it is not going to be installed
Depends: binutils (>= 2.28) but 2.25-5+deb8u1 is to be installed
Depends: libgcc-7-dev (= 7-20170316-1) but it is not going to be installed
Depends: libisl15 (>= 0.15) but it is not installable
Depends: libmpfr4 (>= 3.1.3) but 3.1.2-2 is to be installed
Depends: libstdc++6 (>= 5) but 4.9.2-10 is to be installed
E: Unable to correct problems, you have held broken packages.
This is how my sources.list is set up:
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
###### For ffmpeg
deb http://www.deb-multimedia.org jessie main non-free
###### For gcc-7 (Experimental)
deb http://httpredir.debian.org/debian experimental main
I'm guessing this is, as you said, a problem with me being on Debian stable? What would I need to do in order to fix this error, while remaining on stable?
Edit 2: Okay, so I figured out that last error. I just had to add go through for every individual dependency that gave my trouble and install it using apt-get install -t testing . Thank you to everyone who replied. You were all very helpful.

You can find similar in the Stack Overflow Unix pages
To install the newest g++ from testing on debian, do the following:
Add debian testing repo to your apt sources by creating a file (with .list extension) on /etc/apt/sources.list.d folder containing the line
deb http://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 should name the file something like preferences or testingpref,etc. If you have a preferences file, you can add it there. Remove the .unused or any . in the filename.
Update database:
sudo apt-get update
Install g++:
sudo apt-get install -t testing g++
This will give you the most recent version of g++ in the repo. Thus it will receive updates and more-easily reversable. You need to use -t testing to get most recent versions.
You may have dependency issues. It may be in experimental instead of testing for your architecture. See https://packages.debian.org/search?keywords=g%2B%2B
For experimental packages (7 is in there) add:
deb http://httpredir.debian.org/debian experimental main
to /etc/apt/sources.list . Similar to above.. pinning should say a=experimental instead of a=testing and lastly,
sudo apt-get install -t experimental g++
Good luck.

The kernel is irrelevant.
GCC 7 has not been released yet, as you can see in the GCC 7 release notes:
Disclaimer: GCC 7 has not been released yet, so this document is a work-in-progress.
You may want to learn about what makes different Linux distros different. In particular, what a rolling distribution is, and how Debian releases work. In a rolling distribution, all of the packages continually get updated to newer versions. Debian 8.7 (Jessie / stable) is not a rolling distribution. The packages versions are frozen and only updated when necessary, for extra stability. The latest version of GCC on Debian 8.7 is GCC 4.9.
Debian 9.0 (Stretch / testing) is a rolling release, at least until it gets frozen. If you switch your computer to Stretch you will get GCC 6.3.
If you need something newer, you can either switch to Sid (unstable), or pin packages from Sid.
However, GCC 7 is only available in experimental because it hasn't been released yet. You can install a single package from experimental if you like, see Debian Experimental for instructions.
Howto
Add to your /etc/apt/sources.list
https://wiki.debian.org/DebianExperimental
Then
apt-get update
apt-get -t experimental install gcc-7

From the page you must download the g++7 for amd64 deb file. Then, as root, run the following command.
dpkg -i file.deb

Related

How to install libbz2 in cross compiler g++-arm-linux-gnueabifh on Ubuntu 14.04

I am using arm-linux-gnueabihf-g++-4.8 on an amd64 machine to cross compile boost targeting ARM 32-bit architecture. My OS is Ubuntu 14.04.
It fails to build lib libboost_iostreams because libbz2 does not comes with the compiler. Following is the error detail,
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lbz2
collect2: error: ld returned 1 exit status.
Having a hard time figure out how to install this libbz2 for arm-linux-gnueabihf-g++-4.8. Did not find much document online. Need some help. Thank you very much!
I'd install libbz2-1.0:armhf from Debian jessie repository.
Actually, it is present in the Ubuntu repositories too.
Configure package manager to manage ARM packages:
sudo dpkg --add-architecture armhf
Ubuntu 14.04 codename is 'trusty', so add ARM repositories for trusty by adding the line to the /etc/apt/sources.list file:
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports trusty main
Then update package index:
sudo apt-get update
Install libbz2 for ARM (but abort if it asks to remove any packages):
sudo apt-get install libbz2-1.0:armhf
If apt-get asks to remove half of the system in order to install something big like libc6:armhf, libgcc:armhf, build-essential:armhf etc. then there is a dependency resolution session ahead. There is no precise guide to that.
Also, one minor thing: you may want to add [arch=amd64,i386] annotations to all other repositories in /etc/apt/sources.list to avoid warnings.

Installing gcc on linux

How to install gcc version 4.8 on centos or scientific linux operating systems which require yum for installing.
I tried to download gcc from https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/ and then ran ./configure and then make. After running make it gives me the error: configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Is there some way by which I may install gcc version 4.8 on linux using yum install
I tried:
1). I tried with yum --enablerepo=testing-2-devtools-6 install devtoolset-2-gcc devtoolset-2-gcc-c++ it gives me repository not found
2). yum group install "Development Tools". It gives me Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
3). building it from scratch, you'll have to do ./contrib/download_prerequisites first to get MPFR, GMP and MPC in the GCC source tree, then make a separate directory and run /path/to/gcc/source/configure.
It gives:
configure: error: building out of tree but /home/Softwares/gcc-4.8.2
contains host-x86_64-unknown-linux-gnu
https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/3/html/3.0_Release_Notes/DTS3.0_Release.html#Features
Install the Red Hat Developer Toolset 3.0 (or 2.X) in a way similar to what is described here. (Basically you use a repo someone else built for CentOS).
Google says to try
yum group install "Development Tools"
check out: http://www.cyberciti.biz/faq/centos-rhel-7-redhat-linux-install-gcc-compiler-development-tools/

Matplotlib install issues. Pip Centos - Freetype "Missing" when it is installed

I am using a virtualenv for a django setup. I am trying to build a view that pulls data from logs and then graphs the data. Eventually I would like to have this real-time and live. If you have any recommendations on other solutions that would suit my project best, please do not hesitate to include them in the comment fields below.
I have attempted to install matplotlib from pip using pip install matplotlib.
I receive the following message:
* The following required packages can not be built:
* freetype
I then validated that it was installed
yum install freetype
Package freetype-2.3.11-14.el6_3.1.x86_64 already installed and latest version
I then found that there is a python-matplotlib which is an older version .99. However, I want to keep this inside of the virtual environment and not system wide.
find / -name *freetype*
/var/lib/yum/yumdb/f/d2807dcfe3762c0b9f8ef1d9bf0f05788e73282a-freetype-2.3.11-14.el6_3.1- x86_64
/usr/lib64/libfreetype.so.6.3.22
/usr/lib64/libfreetype.so.6
/usr/share/doc/freetype-2.3.11
I searched all over stackoverflow and only saw solutions for ubuntu which did not transfer over to centos.
Thank you for your time,
John
pip is going to compile matlibplot on your local machine, so you'll need freetype development headers installed as well.
CentOS 6+, Fedora, etc.:
$ sudo yum -y install freetype freetype-devel libpng-devel
On older operating systems (e.g. CentOS 5), you may run into a more specific freetype versioning issue with newer releases of matlibplot. If you're version agnostic, sticking with a legacy 1.3.x release will negate these dependency issues:
$ pip install matplotlib==1.3.1
Please note, you may need to downgrade your numpy to 1.8 in order to make matplotlib 1.3 work.
$ pip install numpy==1.8
Good luck!
I have just had a similar (albeit not exactly the same) situation. I'll write it up here as this page comes up among the first search results.
CentOS 5
pip install matplotlib complains about freetype
Both freetype and freetype-devel are installed.
~/.pip/pip.log provides the explanation of the problem. There is the line:
freetype: no [Requires freetype2 2.3 or later. Found 2.2.1.]
Obviously, the solution is either to upgrade freetype or downgrade matplotlib.
The second is easier (assuming I am OK with the older version).
pip install matplotlib==1.3.1 works fine.
On the matplotlib installation, this is what I did. Not sure if this is going to help you. Just followed the steps here:
http://pkgs.org/centos-6/centos-x86_64/python-matplotlib-0.99.1.2-1.el6.x86_64.rpm.html
I did not use pip, btw and have CentOS 6.4.
I had this happen to me in two different situations, see if yours is one of them:
freetype was installed, but not in the $PATH yet. Just exiting the shell and starting a new one fixed this.
I was building matplotlib from source, and trying to build from the master branch. After I switched to v1.3.x it correctly detected freetype.

Install boost version 1.40

I am using a server running with Ubuntu 12.04
I want to install the boost libraries in it. I know
sudo apt-get install libboost-all-dev
will make the work done, but it installs the latest version version 1.52 or above.
But I need to install the particular version 1.40 as there is a problem in a simulator which I am using for my academic purpose. What is the particular command for that so that I can install the boost libraries along with the other requirements for it like the linking files
Thanks in advance
Quick answer: sudo apt-get install libboost-dev= 1.40.0.1
If it doesn't work, continue reading.
The apt-get does support installing a particular version of a package as long as it is in an archive that apt knows about. From the apt-get manpage:
A specific version of a package can be selected for installation by following the
package name with an equals and the version of the package to select. This will
cause that version to be located and selected for install. Alternatively a specific
distribution can be selected by following the package name with a slash and the version of
the distribution or the Archive name (stable, frozen, unstable).
For e.g. if you wanted to install apache 2.20 for Ubuntu, you would do something like:
sudo apt-get install apache2=2.2.20-1ubuntu1
Note that you may need to do some dependency resolution on your own in this case, but if there are any problems apt-get will tell you what is causing them. For e.g.(on 11.04)
sudo apt-get install apache2=2.2.20-1ubuntu1 \
apache2.2-common=2.2.20-1ubuntu1 \
apache2.2-bin=2.2.20-1ubuntu1 \
apache2-mpm-worker=2.2.20-1ubuntu1
Note: You must first check if build 1.40 is still available. For that use:
aptitude search libboost
If aptitude search command don't give you sufficient results, try sudo aptitude update and then run aptitude search again.
You might have to investigate whether debs from earlier Ubuntu versions can be installed. i.e. remove the current package, download the debs and try installing them. But there could be dependency on older versions of the standard library.If so, you can probably try downloading the source from launchpad.
As a last resort, download from boost.org and build it - painfully!
EDIT: I see you have asked the same question on ubuntu forums and it seems that you have 1.48 as the default. You might have to build the library itself. Can you try this apt-get
sudo apt-get install libboost1.40-all-dev=1.40.0-4ubuntu4
If this doesn't work, you will have to build it and install it yourself. You can download the source from
Download source (1.40.0): libboost 1.40.0 source files
After it's installed, run the following command to hold your installed version, preventing the package manager from automatically updating it in the future:
sudo echo "[packagename] hold" | sudo dpkg --set-selections
Source:How to Downgrade Packages on Ubuntu
Generally you download sources, build it (some parts are not just headers like filesystem on Windows). Then you can select which subset of libraries you want to install (you can make compact version with only what you need). Then by invoking bootstrap script you build it to another directory this subset of libraries you want and then you invoke install.
Here is a pretty good description how to do it: http://ubuntuforums.org/showthread.php?t=1180792

problems of installing kde runtime libraries on Linux

I am trying to install kde runtime libraries for kscope on Linux (2.6.18-308.11.1.el5).
http://kscope.sourceforge.net/install.shtml
I have downloaded kde-runtime-4.9.2 from ftp://ftp.kde.org/pub/kde/stable/4.9.2/src/
But, in the downloaded files, I cannot find INSTALL or other help files about how to install it.
Any help will be appreciated.
Thanks,
This is what you can do(assuming you are not on kubuntu):
1) add kubuntu's backports to your existing ppa(to gain access to KDE libraries):
# sudo add-apt-repository ppa:kubuntu-ppa/backports
2) Update the package index:
# sudo apt-get update
3) Install kdebase-runtime deb package:
# sudo apt-get install kdebase-runtime
this should work
cheers
kscope had it's latest release in 2008 and depends on KDE 3 libraries.
kdelibs 4 are incompatible with kdelibs 3. To get it running you need a distribution that still supports kde3. (or compile kde3 all yourself)
I suggest you use an alternative application - like KDevelop (you actually tagged your question with kdevelop)