Как правильно обновить gcc7.3 до gcc8 в Ubuntu 18.04.01 LTS?

В моем Ubuntu 18.04 LTS:

marco@PC:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

У меня есть версия GCC 7.3.0:

marco@PC:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu    
7.3.0-21ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-
7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++
--prefix=/usr --with-gcc-major-version-only --program-suffix=-7 
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-
id --libexecdir=/usr/lib --without-included-gettext --enable-
threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-
clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-
default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-
verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-
system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror 
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 
--enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none 
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-21ubuntu1~16.04)

И я хочу установить gcc-8:

marco@PC:~$ sudo apt-get install gcc-8
[sudo] password for marco:
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-8 : Depends: cpp-8 (= 8.1.0-1ubuntu1) but it is not going to be   
installed
         Depends: gcc-8-base (= 8.1.0-1ubuntu1) but 8.1.0-5ubuntu1~16.04 
is to be installed
         Depends: libgcc-8-dev (= 8.1.0-1ubuntu1) but it is not going to 
be installed
E: Unable to correct problems, you have held broken packages.

marco@PC:~$ sudo apt-get install cpp-8
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:
 cpp-8 : Depends: gcc-8-base (= 8.1.0-1ubuntu1) but 8.1.0-5ubuntu1~16.04 
 is to be installed
E: Unable to correct problems, you have held broken packages.

marco@PC:~$ sudo apt-get install gcc-8-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc-8-base is already the newest version (8.1.0-5ubuntu1~16.04).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

marco@PC:~$ sudo apt-get install libgcc-8-dev
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:
 libgcc-8-dev : Depends: gcc-8-base (= 8.1.0-1ubuntu1) but   
8.1.0-5ubuntu1~16.04 is to be installed
                Depends: libasan5 (>= 8.1.0-1ubuntu1) but it is not going
 to be installed
                Depends: libubsan1 (>= 8.1.0-1ubuntu1) but it is not 
 going to be installed
E: Unable to correct problems, you have held broken packages.

marco@PC:~$ sudo apt-get install libasan5
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:
 libasan5 : Depends: gcc-8-base (= 8.1.0-1ubuntu1) but   
 8.1.0-5ubuntu1~16.04 is to be installed
E: Unable to correct problems, you have held broken packages.

marco@PC:~$ sudo apt-get install libubsan1
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:
 libubsan1 : Depends: gcc-8-base (= 8.1.0-1ubuntu1) but     
 8.1.0-5ubuntu1~16.04 is to be installed
E: Unable to correct problems, you have held broken packages.

Итак... кажется, что для установки gcc-8 мне нужно установить другие пакеты, которые зависят от других пакетов, которые сами зависят от gcc-8-base, который уже правильно установлен. И там написано "битые пакеты"... так как решить проблему? Ждем ваших добрых советов и помощи. Marco

0 ответов

Другие вопросы по тегам