如何使用 apt-get 在 Ubuntu 16.04 LTS x64 上安装“libboost-all-dev”

如何使用 apt-get 在 Ubuntu 16.04 LTS x64 上安装“libboost-all-dev”

我正在制作 mangos WoW 自动配置个人脚本,我需要 libboost 来编译应用程序,因为它现在是一项要求。我的发行版是:

mangos@mangos-VB:~/Documents/setup/UbuntuBatches/MaNGOS$ uname -a
Linux mangos-VB 4.4.0-66-lowlatency #87-Ubuntu SMP PREEMPT Fri Mar 3 `16:43:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux`

当我尝试安装它时,得到以下输出:

mangos@mangos-VB:~/Documents/setup/UbuntuBatches/MaNGOS$ sudo apt-get install libboost-all-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:
 libboost-all-dev : Depends: libboost-date-time-dev but it is not going to be installed
                    Depends: libboost-filesystem-dev but it is not going to be installed
                    Depends: libboost-iostreams-dev but it is not going to be installed
                    Depends: libboost-log-dev but it is not going to be installed
                    Depends: libboost-python-dev but it is not going to be installed
                    Depends: libboost-regex-dev but it is not going to be installed
                    Depends: libboost-system-dev but it is not going to be installed
                    Depends: libboost-thread-dev but it is not going to be installed
                    Depends: libboost-wave-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
mangos@mangos-VB:~/Documents/setup/UbuntuBatches/MaNGOS$

mangos@mangos-VB:~/Documents/setup/UbuntuBatches/MaNGOS$ sudo apt-cache policy libboost-all-dev

libboost-all-dev:
  Installed: (none)
  Candidate: 1.58.0.1ubuntu1
  Version table:
     1.58.0.1ubuntu1 500
        500 http://bg.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

答案1

就像@fkraiem说的那样,我的apt-get列表已经过时了,因此apt无法获取有问题的依赖项。我的更新服务器设置为Bulgaria,因为它是最接近的。当我转到时,问题得到了解决Software and updates -> Ubuntu software -> Drop down /Download from:/ -> Select /Main server/。之后,单击CloseReload按钮。打开终端(Ctrl+Alt+T)并输入sudo apt-get update。瞧,它已经修复了!

相关内容