Então, eu estava tentando configurar meu computador para desenvolvimento. Eu instalei o Ubuntu 14.04 LTS. Eu queria escrever um programa de hello-world. No entanto eu não posso compilá-lo. Após algumas pesquisas, tentei sudo apt-get install build-essential
, que reclamou:
>sudo apt-get install build-essential
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:
build-essential : Depends: g++ (>= 4:4.4.3) but it is not going to be installed
Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Eu tentei alterar a fonte e sudo apt-get update
, sudo apt-get upgrade
e o problema permaneceu. Eu tentei sudo apt-get autoclean
, sudo apt-get install --fix-broken
ou algo assim, não que funcionou.
Além disso, tentei sudo aptitude why-not build-essential
, que dizia:
>sudo aptitude why-not build-essential
p gvfs-bin:i386 Provides gvfs-bin
p gvfs-bin:i386 Suggests gvfs:i386
p gvfs:i386 Suggests gvfs-backends:i386
p gvfs-backends:i386 Depends libgphoto2-port10:i386 (>= 2.5.2)
p libgphoto2-port10:i386 Suggests gphoto2:i386 (> 2.1.0)
p gphoto2:i386 Suggests gthumb:i386
p gthumb:i386 Recommends flex:i386
p flex:i386 Suggests build-essential:i386
p build-essential:i386 Conflicts build-essential
Então, o que está errado aqui?
Além disso, meu arquivo sources.list
:
>cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 14.04.4 LTS _Trusty Tahr_ - Release amd64 (20160217.1)]/ trusty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.163.com/ubuntu/ trusty main restricted
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.163.com/ubuntu/ trusty universe
deb-src http://mirrors.163.com/ubuntu/ trusty universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.163.com/ubuntu/ trusty multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
meu diretório sources.list.d
:
>ls -la /etc/apt/sources.list.d
total 8
drwxr-xr-x 2 root root 4096 4月 10 2014 .
drwxr-xr-x 6 root root 4096 4月 14 14:16 ..
A propósito, alguém poderia dar uma breve explicação sobre o que é um pacote quebrado e por que ele aparece tão facilmente? Ou qual é a razão possível / porque isso está acontecendo? O apt-get não deve ser capaz de corrigir esses problemas ou pelo menos fornecer algumas informações úteis aqui? Eu encontrei esse erro muitas vezes recentemente e não encontrei nenhuma solução.
Muito obrigado.