在新的Debian 9上安装flex

时间:2017-10-08 16:36:31

标签: debian

TL; DR:错误是“Package'flex'没有安装候选者。”

我似乎无法在全新的Debian 9安装上安装flex(在VM上,如果这有所不同)。我已经在Ubuntu 14,16和Raspbian上安装了它,但是在Debian上没有成功。我只尝试过Debian 9,而不是早期版本。

wmeitzen@debianos:~$ su
Password:

root@debianos:/home/wmeitzen# apt-get update

Ign:1 cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch InRelease
Ign:2 cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch Release
Hit:3 cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch/contrib i386 Packages
Ign:4 cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch/contrib all Packages
... (snip) ...
Hit:10 cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch/main i386 Packages
Hit:13 cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch/main Translation-en
Get:17 http://security.debian.org/debian-security stretch/updates InRelease [62.9 kB]
Get:18 http://security.debian.org/debian-security stretch/updates/main Sources [71.4 kB]
Get:19 http://security.debian.org/debian-security stretch/updates/main i386 Packages [180 kB]
Get:20 http://security.debian.org/debian-security stretch/updates/main Translation-en [82.9 kB]
Fetched 397 kB in 0s (421 kB/s)                              
Reading package lists... Done
W: The repository 'cdrom://[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45] stretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

root@debianos:/home/wmeitzen# apt-get upgrade

Reading package lists... Done
Building dependency tree      
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libnautilus-extension1a nautilus nautilus-data
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,581 kB of archives.
After this operation, 1,024 B disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://security.debian.org/debian-security stretch/updates/main i386 nautilus i386 3.22.3-1+deb9u1 [837 kB]
Get:2 http://security.debian.org/debian-security stretch/updates/main i386 nautilus-data all 3.22.3-1+deb9u1 [1,710 kB]
Get:3 http://security.debian.org/debian-security stretch/updates/main i386 libnautilus-extension1a i386 3.22.3-1+deb9u1 [34.7 kB]
Fetched 2,581 kB in 1s (1,471 kB/s)          
Reading changelogs... Done
(Reading database ... 129033 files and directories currently installed.)
Preparing to unpack .../nautilus_3.22.3-1+deb9u1_i386.deb ...
Unpacking nautilus (3.22.3-1+deb9u1) over (3.22.3-1) ...
Preparing to unpack .../nautilus-data_3.22.3-1+deb9u1_all.deb ...
Unpacking nautilus-data (3.22.3-1+deb9u1) over (3.22.3-1) ...
Preparing to unpack .../libnautilus-extension1a_3.22.3-1+deb9u1_i386.deb ...
Unpacking libnautilus-extension1a:i386 (3.22.3-1+deb9u1) over (3.22.3-1) ...
Setting up nautilus-data (3.22.3-1+deb9u1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for libglib2.0-0:i386 (2.50.3-2) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Setting up libnautilus-extension1a:i386 (3.22.3-1+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Setting up nautilus (3.22.3-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...

root@debianos:/home/wmeitzen# apt-get install flex

Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package flex is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'flex' has no installation candidate

root@debianos:/home/wmeitzen#

1 个答案:

答案 0 :(得分:0)

在Debian中肯定有 一个flex包,可以在official package list

上看到

但是,您的sources.list (5)仅包含安全升级(显然flex尚未在Stretch中进行安全升级)和您的安装DVD(出于空间原因没有包含flex个包裹; flexDVD#2上;另请参阅下面我在DVD上的咆哮。)

因此,要解决此问题,您需要使用包含所需软件包的 apt-source (理想情况下,所有官方软件包)。

为此,请将以下行添加到/etc/apt/sources.list(或者,如果您 - 像我一样 - 希望将各种来源保存在不同的文件中,请使用/etc/apt/sources.list.d/stretch.list):

deb http://deb.debian.org/debian/ stretch main

然后运行apt update && apt install flex并享受。

从DVD安装

您正在使用安装DVD?真的?

我还没有看到这些用于......年;我认为正常/推荐使用是通过 netinst 映像安装系统,然后从广泛的互联网安装所有软件包。