Ubuntu18.04LTS 설치 g++ 오류 및 해결 방법

4227 단어
참고 문헌: [1]/questions/35934227/cannot-install-g-on-ubuntu-14-04-lts-i-have-tried-commands-and-software-cen
[2]https://blog.csdn.net/xiangxianghehe/article/details/80112149
오류 출력:
root@DESKTOP-2HT6OMN:/home/h3c# apt install g++
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:
 g++ : Depends: g++-5 (>= 5.3.1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

원인: 소프트웨어 원본 출력이 잘못되었습니다.해결 방법: 소프트웨어 원본을 업데이트합니다.다음으로 바꾸기
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

추가: 이전에 사용한 소프트웨어 원본은 아리 소프트웨어 원본: 버전 1:
#deb 
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##      
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
#     
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##      
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
# Canonical          
##deb http://archive.canonical.com/ubuntu/ xenial partner  
##deb http://extras.ubuntu.com/ubuntu/ xenial main
   :

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

그러다 보니 틀렸어요.참고 문헌:[3]https://blog.csdn.net/zhangjiahao14/article/details/80554616
Ubuntu 12.04(LTS) 코드명은 precise입니다.
Ubuntu 14.04(LTS) 코드는 trusty입니다.
Ubuntu 15.04 코드는vivid입니다.
Ubuntu 15.10 코드는 wily입니다.
Ubuntu 16.04(LTS) 코드는 xenial입니다.
따라서 최신 소프트웨어 원본은 시스템 버전에 대응해야 한다.

좋은 웹페이지 즐겨찾기