当前未安装程序“ curl”


66

我正在尝试流星http://meteor.com/examples/leaderboard

我必须使用Windows上熟悉的CURL。

现在,我尝试在Ubuntu 12.04上安装它。

但是我得到这些错误:

kevin@ubuntu:~$ curl https://install.meteor.com | sh
The program 'curl' is currently not installed.  You can install it by typing:
sudo apt-get install curl
kevin@ubuntu:~$ apt-get curl
E: Invalid operation curl
kevin@ubuntu:~$ sudo apt-get curl
[sudo] password for kevin: 
E: Invalid operation curl

如何安装CURL?

解决了它:

我做了这个命令

sudo sed -i -e 's/us.archive.ubuntu.com/archive.ubuntu.com/g' /etc/apt/sources.list

然后我可以做sudo apt-get update,然后sudo apt-get install curl

成功安装curl。

更新:

很抱歉出现明显的错误。我昨天也尝试过,在那里我键入了正确的命令,这给了我这个错误信息:

kevin@ubuntu:~$ sudo apt-get install curl
[sudo] password for kevin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package curl 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 'curl' has no installation candidate

更新2:

试过apt-cache search curl | grep -i curl命令

kevin@ubuntu:~$ apt-cache search curl | grep -i curl
curlftpfs - filesystem to access FTP hosts based on FUSE and cURL
flickcurl-doc - utilities to call the Flickr API from command line - documentation
flickcurl-utils - utilities to call the Flickr API from command line
gambas2-gb-net-curl - The Gambas advanced networking component
gnupg-curl - GNU privacy guard - a free PGP replacement (cURL)
libcupt2-0-downloadmethod-curl - alternative front-end for dpkg -- libcurl download method
libcurl-ocaml - OCaml curl bindings (Runtime Library)
libcurl-ocaml-dev - OCaml libcurl bindings (Development package)
libflickcurl-dev - C library for accessing the Flickr API - development files
libflickcurl0 - C library for accessing the Flickr API
libflickcurl0-dbg - C library for accessing the Flickr API - debugging symbols
libghc-curl-dev - GHC libraries for the libcurl Haskell bindings
libghc-curl-doc - Documentation for the libcurl Haskell bindings
libghc-curl-prof - Profiling libraries for the libcurl Haskell bindings
libghc-download-curl-dev - High-level file download based on URLs
libghc-download-curl-doc - High-level file download based on URLs; documentation
libghc-download-curl-prof - High-level file download based on URLs; profiling libraries
libghc-hxt-curl-dev - LibCurl interface for HXT
libghc-hxt-curl-doc - LibCurl interface for HXT; documentation
libghc-hxt-curl-prof - LibCurl interface for HXT; profiling library
libghc6-curl-dev - transitional dummy package
libghc6-curl-doc - transitional dummy package
libghc6-curl-prof - transitional dummy package
liblua5.1-curl-dev - libcURL development files for the Lua language version 5.1
liblua5.1-curl0 - libcURL bindings for the Lua language version 5.1
libwww-curl-perl - Perl bindings to libcurl
slang-curl - transfer files using HTTP and FTP from S-Lang
spl-curl - SPL Programming Language -- curl adapter
tclcurl - Tcl bindings to libcurl
xmms2-plugin-curl - XMMS2 - curl transport for HTTP
php5-curl - CURL module for php5
libcurl3-gnutls - Multi-protocol file transfer library (GnuTLS)
libcurl3-nss - Multi-protocol file transfer library (NSS)
python-pycurl - Python bindings to libcurl
libcurl3 - Multi-protocol file transfer library (OpenSSL)

更新3:sudo apt-get update在我运行 更新之前,它做了吗。

但这无济于事。

kevin@ubuntu:~$ sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package curl 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

Package libcurl3-dev 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 'curl' has no installation candidate
E: Package 'libcurl3-dev' has no installation candidate

这是什么 apt-cache search curl | grep -i curl 说什么?
catalesia

试了一下,我的更新2
凯文痴笑

您可以随时从curl.haxx.se/download.html自己下载它 并进行构建。您是否更改了存储库?我可以做到,没有问题,没有任何错误。我感兴趣的是为什么apt会给您结果,然后又不允许安装。您在其他任何软件上也有同样的经历吗?
catalesia

1
请包括的输出sudo apt-get update。我认为您的系统缺少某些软件存储库。
豪尔赫·苏亚雷斯·德利斯

我并没有真正改变任何东西,也没有安装任何程序。几乎是全新安装。因此我也不是很了解。我不知道如何悲伤地使自己卷曲。
凯文·辛珀

Answers:


101

回答不同的更新

第一个问题

您需要命令

sudo apt-get install curl

安装中使用的命令丢失:sudo apt-get curl因为apt-get的没有一个命令将不起作用curl

第一次更新

您还想先运行update

sudo apt-get update

您可能要考虑使用以下命令:

sudo apt-get install libcurl3 php5-curl

它也可能与您使用的php版本有关(php5-common?),请参见此处

第二次更新

或者,要使其变得更简单,只需使用命令wget https://install.meteor.com | sh。Curl用于较早版本的ubuntu。它并不是真正必要的工具,但是某些教程确实使用了它。


我已经用我打算显示的错误更新了我的帖子。谢谢您的帮助!
凯文·辛珀

尝试过,仍然错误。我的更新3
Kevin Simper

您是否阅读了我给您的链接?我可能与您使用的php版本有关。还php5-curl安装了吗?如果是这样,您的问题就解决了吗?
don.joey

是的,php5-curl确实安装了。我不理解那篇文章中的解决方案:“您要么需要用官方Ubuntu存储库中的版本替换PHP”。这意味着什么?我不需要PHP。我已经安装了Ubuntu的所有更新。尚未安装任何程序。
凯文·辛珀

1
我确实尝试过wget,但这使我得到了一个.html页面,这不是预期的。但是,我确实在某个隐藏的论坛中找到了解决问题的方法。尝试使用命令“ sudo sed -i -e s / us.archive.ubuntu.com / archive.ubuntu.com / g” /etc/apt/sources.list”,该命令显然可以解决。
凯文·辛珀

0

如果收到未找到curl软件包的错误消息,则必须在安装它之前添加如下存储库:

sudo add-apt-repository ppa:ondrej/php
sudo apt update

4
在当前所有受支持的Ubuntu版本的标准存储库中都可以使用`curl ,除非默认情况下安装了我没有记错的地方。如果收到错误消息,则表示其他错误。不需要PPA。
年长者怪胎

4
curl至少在64位Ubuntu 16.04中默认未安装。除非在Vagrant盒子版本中有特殊要求。
Juha Untinen
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.