简体   繁体   English

Ubuntu上的Swift-没有这样的文件或目录

[英]Swift on Ubuntu - No such file or directory

Trying to install swift on my Ubuntu 14.04.3 server. 尝试在我的Ubuntu 14.04.3服务器上安装swift。 Followed the guide on Swift.org. 遵循Swift.org上的指南。

  • download the install package 下载安装包
  • fetched the gpg keys 获取了gpg密钥
  • verified the .sig file 验证.sig文件
  • extracted the file and added the usr/bin subdir to my PATH 提取文件并将usr / bin子目录添加到我的PATH中

However when I try running swift I get "No such file or directory" 但是,当我尝试运行swift时,出现“没有这样的文件或目录”

Swift seems to be found: 似乎发现了Swift:

icanzilb@underplot:~/public$ which swift
/home/icanzilb/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu14.04/usr/bin/swift

Path is correct: 路径正确:

icanzilb@underplot:~/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu14.04/usr/bin$ echo $PATH
/home/icanzilb/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu14.04/usr/bin:...

But can't run it: 但是不能运行它:

icanzilb@underplot:~/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu14.04/usr/bin$ swift
-bash: /home/icanzilb/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu14.04/usr/bin/swift: No such file or directory

===== =====

Update 1: I tried the development and stable builds of Swift from swift.org and the .sig checks out but still getting the same error. 更新1:我从swift.org尝试了Swift的开发和稳定版本,.sig签出,但仍然出现相同的错误。

Both the swift executable and my Ubuntu are 64 bit. swift可执行文件和我的Ubuntu都是64位。

It really looks like this is a problem of an architecture mismatch, as indicated by one of the commenters, or a corrupted download. 确实看起来这是一个体系结构不匹配的问题(如评论者之一所示)或下载损坏。 The swift executable is in the path and is picked up by which . 雨燕可执行文件的路径和被拾起which Judging from the name of the directory where it is located, it is indeed for Ubuntu 14.04. 从其所在目录的名称来看,确实适用于Ubuntu 14.04。 I would try the following: 我会尝试以下方法:

file `which swift`

This should tell you it is an ELF 64-bit executable, dynamically linked, etc. If that is not the case, you have a corrupted binary somehow. 这应该告诉您它是一个ELF 64位可执行文件,动态链接等。如果不是这种情况,则说明您的二进制文件已损坏。

Then do 然后做

uname -a

which should identify your system as Ubuntu 14, x86_64 among other things. 可以将您的系统识别为Ubuntu 14 x86_64。 If that is the case, you probably have a corrupted binary. 如果是这种情况,则您的二进制文件可能已损坏。 Unpack the downloaded package again and retry. 再次打开下载的软件包的包装,然后重试。 If your system is not x86_64, then you are on a wrong architecture. 如果您的系统不是x86_64,则说明您使用的是错误的体系结构。

Update 2/4/2016: 2016年2月4日更新:

Based on the additional info you provided about the binary and the architecture, I tend to believe this is a platform mismatch. 根据您提供的有关二进制文件和体系结构的其他信息,我倾向于认为这是平台不匹配。 The output of uname doesn't show it is an Ubuntu box. uname的输出未显示它是Ubuntu盒子。 Besides, the Linux kernel is 4.4.0, and the binary is for 2.6.24. 另外,Linux内核是4.4.0,二进制是2.6.24。 I can successfully run the same binary on an Ubuntu 14.04 installation with a 3.19.0 kernel. 我可以在具有3.19.0内核的Ubuntu 14.04安装上成功运行相同的二进制文件。 The kernel version difference is not necessarily a problem in itself, but an indicator that the platform may not be a standard Ubuntu 14.04 install. 内核版本的差异本身并不一定是问题,而是表明该平台可能不是标准的Ubuntu 14.04安装。

As another check, could you please do cat /etc/os-release and cat /etc/lsb-release ? 另外请检查一下cat /etc/os-releasecat /etc/lsb-release吗? Those files should indicate if the platform is indeed Ubuntu. 这些文件应表明该平台是否确实是Ubuntu。 If it is, then I'm wondering how you ended up with this late kernel version. 如果是这样,那么我想知道您如何最终获得了此最新内核版本。 It is possible some other components of the OS are also too recent and incompatible with the Swift binary. 操作系统的其他某些组件可能也太新并且与Swift二进制文件不兼容。 This may be some strange custom Linode image... If you have a machine you can use, virtual or physical, try downloading and installing a standard Ubuntu 14.04. 这可能是一些奇怪的自定义Linode映像...如果您有一台可以虚拟或物理使用的计算机,请尝试下载并安装标准的Ubuntu 14.04。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM