Uninstalling gcc - linux

I want to uninstall my gcc by terminal. When I type
gcc --version
The output is
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Could anyone help me? How can I install the last version of gcc after that?

Use the following command (Replace <version> with the appropriate version):
sudo apt-get --purge remove gcc-<version>
You can install a specific version of a program using apt, you can use the following command. (Replace <version> with the appropriate version)
sudo apt-get install gcc=<version>
Alternatively, you can use Synaptic Package Manager.
sudo apt-get update
sudo apt-get install synaptic
Note that, you might need GCC for some programs. If you face any driver issues while installing programs / drivers you can install the latest GCC by using:
sudo apt-get install gcc

Related

gfortran-9 installed, but getting "no Fortran compiler found" error (Ubuntu Server 18.04)

I've just installed gfortran-9 on Ubuntu Server 18.04 as follows:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gfortran-9
I've been able to confirm that gfortran-9 is working correctly by compiling and running a simple 'Hello World' program.
I'm now trying to install PyPROSAIL as follows:
sudo -H pip3 install pyprosail
... but I'm receiving the following error:
error: extension 'PyPROSAIL._prosail_model' has Fortran sources but no Fortran compiler found
gfortran-9 --version shows me the following:
GNU Fortran (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
whereis gfortran-9 shows me the following:
gfortran-9: /usr/bin/gfortran-9 /usr/share/man/man1/gfortran-9.1.gz
Why is gfortran-9 apparently not being found? Do I need to manually set a path to gfortran-9 somewhere?
In case anyone else is having the same issue, I was able to solve this by installing a different Fortran compiler - gfortran:
sudo apt-get install gfortran

Error when bootstrapping CMake:Log of errors

To install charmm program I have to install CMake, however, it doesn't install CMake.
[sohyeon#theochem11 cmake-3.15.3]$ ./bootstrap
---------------------------------------------
CMake 3.15.3, Copyright 2000-2019 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /export/home/sohyeon/cmake-3.15.3/Bootstrap.cmk/cmake_bootstrap.log
so I tried to that script
[sohyeon#theochem11 cmake-3.15.3]$ env CC=cc CXX=CC ./bootstrap
But it still occurred same error.
I searched other ways in google. I found this two ways.
$ yum -y install gcc-c++
You need to be root to perform this command.
$ yum install gcc-c++.x86_64
You need to be root to perform this command.
But it is not solve my problem.
(And I saw cmake_bootstrap.log but I don't know what is wrong.)
(Edit)
Thank you all!
OS version : Linux theochem11.hpc.org 2.6.32-279.14.1.el6.x86_64 #1 SMP Tue Nov 6 23:43:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[sohyeon#theochem11 cmake-3.15.3]$ gcc --version
gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[sohyeon#theochem11 cmake-3.15.3]$ g++ --version
g++ (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
cmake-3.15.3 can do bootstrap with g++ versions 6.3 .. 9.2 . ... Earlier g++ versions like 4.9 or 5.3 are failing.
RHEL 6, install gcc-c++-7.3 :
# 1. Install a package with repository for your system:
# On CentOS, install package centos-release-scl available in CentOS repository:
$ sudo yum install centos-release-scl
# On RHEL, enable RHSCL repository for you system:
$ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
# 2. Install the collection:
$ sudo yum install devtoolset-7
# 3. Start using software collections:
$ scl enable devtoolset-7 bash
https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/
Five packages only are installed, with 'yum install devtoolset-7-gcc-c++' :
devtoolset-7-gcc-c++-7.3.1-5.15.el6.x86_64
devtoolset-7-binutils-2.28-11.el6.x86_64
devtoolset-7-libstdc++-devel-7.3.1-5.15.el6.x86_64
devtoolset-7-runtime-7.1-4.el6.x86_64
devtoolset-7-gcc-7.3.1-5.15.el6.x86_64
Packages http://mirror.centos.org/centos/7/sclo/x86_64/rh/devtoolset-7/
Cmake :
cd cmake-3.15.3/
scl enable devtoolset-7 bash // g++ is set to "7.3"
./bootstrap
Note : The command scl enable devtoolset-7 bash is valid for the current terminal session only.
P.S. : cmake3 is available from the EPEL repo https://fedoraproject.org/wiki/EPEL → sudo yum install cmake3 . You get cmake3-3.6.1-3.el6.x86_64 . Provides /usr/bin/cmake3
Epel packages https://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/
Ref. comment
Is there any other way than using yum?
The rpm command can be used to install downloaded packages : Root password is required. Examples ...
rpm -Uvh cmake3-3.6.1-3.el6.x86_64
rpm -Uvh <package>.rpm <package>.rpm <package>.rpm <package>.rpm <package>.rpm
I met the same problems,you can solve it by downloading the latest version

How to install gcc8 using devtoolset-8-gcc

I am using CentOS Linux release 7.3.1611 which has gcc 4.8.5 20150623 installed. I am looking for a way to install a newer version of gcc, specially 8.1. I found the following site on how to install gcc v7 link 1 which describes how to install gcc v7 (using devtoolset-7-gcc*). I did follow the guidelines and was able to install gcc v7. Though, if I followed the same procedure, but used "devtoolset-8-gcc*" instead the return message states "No package devtoolset-8-gcc* available.".
Performed a search and found a page called "Information for build devtoolset-8-gcc-8.1.1-4.el6" link 2, but not sure how to install this. I believe I would need to download the rpm source, compile/build the source, then finally install it.
Basically, I am looking for a easy way to install gcc v8 just like using the method described on link 1.
Thanks in advance.
To install the full tools-set including gfortran on centos 7:
yum install centos-release-scl
yum install devtoolset-8
scl enable devtoolset-8 -- bash
enable the tools:
source /opt/rh/devtoolset-8/enable
you may wish to put the command above in .bash_profile
ref:
https://unix.stackexchange.com/questions/477360/centos-7-gcc-8-installation
devtoolset-8 was only released a short while ago. The linked installation instructions may be of use. However, your question pertains to CentOS, and this does not yet appear to have been made available yet. You can see some evidence of it being build for CentOS here, but it's not been updated for the final release yet.
You could ask on the SCL mailing list for an ETA, or wait until it appears in its final form. In the meantime, you could download the RPMs from koji directly.
The follows worked in centos/rhel 7.
How to install it?
# rpm -ivh http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
# yum install devtoolset-8
Here is the rpm from http://mirror.centos.org/centos/7/extras/x86_64/Packages/ that might be needed to be updated accordingly.
How to use it?
$ scl enable devtoolset-8 bash
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The flags -std=c++17 -lstdc++fs and the following line could be helpful.
#include <experimental/filesystem>

Dart throwing errors on linux: GLIBC_2.14 GLIBC_2.15 not found

I'm running Debian 7.2 on Google Compute Engine (Though I suspect Centos, Red Hat, and Amazon Linux AMI all have the same problem). After downloading the 64-bit Linux version of the Dart SDK from this page, any dart command I run, for example, dart --version, will output the following error:
./editor/dart/dart-sdk/bin/dart: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by ./editor/dart/dart-sdk/bin/dart)
./editor/dart/dart-sdk/bin/dart: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./editor/dart/dart-sdk/bin/dart)
Update: October 2014: Dart can now be installed on Debian with apt-get:
Instructions summarized from the dart website:
# Enable HTTPS for apt.
sudo apt-get update
sudo apt-get install apt-transport-https
# Get the Google Linux package signing key.
sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
# Set up the location of the stable repository.
sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update
# Finally, install the dart package!
sudo apt-get install dart
Instructions for building the binary yourself:
This problem appears to be caused by Google compiling against an edge version of GLIBC (>= 2.15) which is not generally supported on Linux outside of Ubuntu 12 (Precise Pangolin).
First of all, do not attempt to download an experimental version of GLIBC or EGLIBC. I was able to get dart to work using that method, but the rest of my machine fell apart. Updating GLIBC is a recipe for madness.
Instead, the best solution is building dart from source. Despite the GLIBC version requirements of the binary, the source itself has no such requirements. There are wiki pages for installing from source on debian, centos/fedora/red hat/amazon, ubuntu, and other linux versions.
Here is an overview of those steps, which I can confirm works on Debian 7.2. The centos/fedora/redhat steps appear to be the same except they use yum instead of apt-get.
Install subversion and the required build tools:
sudo apt-get -y update
sudo apt-get -y install subversion
sudo apt-get -y install make
sudo apt-get -y install g++
sudo apt-get -y install openjdk-6-jdk
Check out google's depot tools and add gclient to your path
svn co http://src.chromium.org/svn/trunk/tools/depot_tools
export PATH=$PATH:`pwd`/depot_tools
Download the dart source at the desired branch.
Replace 1.2 with whatever branch you wish to build. You can see a list of available versions here. In general, the latest numbered branch is best.
gclient config http://dart.googlecode.com/svn/branches/1.2/deps/all.deps
gclient sync
gclient runhooks
Move into the new dart directory
cd dart
Do only A or B below:
Note: For 32bit, use the --arch=ia32 flag instead.
A. Build the entire Dart SDK including pub, dart2js, dart, etc.:
tools/build.py --mode=release --arch=x64 create_sdk
B. Build just the dart executable:
tools/build.py --mode=release --arch=x64 runtime
The dart executable is now at either out/ReleaseX64/dart or out/ReleaseX64/dart-sdk/bin/dart you can do a smoke test by printing the version
dart/out/ReleaseX64/dart --version
The output should be something like Dart VM version: 1.2.0 (Mon Mar 3 03:06:20 2014) on "linux_x64".
How to help fix this issue
This was much more painful than it needed to be, since the binary clearly doesn't need to be built using GLIBC >= 2.15. If you wish to draw attention to this issue, please star this dart bug.

How to remove java5 from ubuntu 11.04?

I want to remove java5 completely from my ubuntu 11.04 system. On executing java -version, it showing -
java version "1.5.0"
gij (GNU libgcj) version 4.4.5
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
How can I remove it?
If you want to remove completely that java version you need to remove the packages that contain it, see a list of packages with:
sudo dpkg --get-selections | grep jre
In this way you see what jre packages you've installed. Then you can remove the packages with:
sudo apt-get remove old_jre_package
Anyway a better solution is to make more JDK versions coesist, in Ubuntu is easy to do it. You can use the update-alternatives command. So you can install another JDK and switch between the jdk versions with the alternative tools:
sudo update-alternatives --config java
sudo update-alternatives --config javac
For more options see the man page man update-alternatives.
You can search all the jre package in your system by running this command
sudo aptitude search jre
Remove it using this command
sudo apt-get remove sun-java6-jre sun-java6-plugin sun-java6-fonts
You can also try this command to remove all the java files in your system
sudo aptitude remove '~njava'
You should try script oab java.
Yes the better solution is to make more JDK versions by using "update-alternatives" command.
After that you can also set PATH using the command.
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_11 or /usr/lib/jvm/jdk1.6.0_38
export PATH=$JAVA_HOME/bin:$PATH

Resources