I have installed gcc-4.8
and gcc-6
. The default gcc version is gcc-4.8
, but I want to change the default gcc version to gcc-6
, so I do the following:
$ sudo update-alternatives --remove-all gcc
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 20
then the default gcc version has changed to gcc-6
, but when I run command
$ man gcc
the man page version of gcc is still gcc-4.8
. How can I change the man page version of gcc to gcc-6
? Thanks!
Sorry for my bad English.
I have found the solution:
Find the location of gcc-6
man page:
$ locate gcc-6 | grep 'man'
/usr/share/man/man1/gcc-6.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-6.1.gz
so the location of gcc-6
man page is /usr/share/man/man1/gcc-6.1.gz
Remove the file /usr/share/man/man1/gcc.1.gz
if it exist:
$ sudo rm /usr/share/man/man1/gcc.1.gz
Create a symbolic link to /usr/share/man/man1/gcc-6.1.gz
:
$ sudo ln -s /usr/share/man/man1/gcc-6.1.gz /usr/share/man/man1/gcc.1.gz
Then run comman:
$ man gcc
You will see the man page version of gcc has changed to gcc-6
.
Sorry for my English.