运行“apt-get update”时出现“方法给出无效的 400 URI 失败消息”

运行“apt-get update”时出现“方法给出无效的 400 URI 失败消息”

当我使用该命令时,sudo apt-get update我收到错误消息Method gave invalid 400 URI Failure message。奇怪的是,每次我使用该命令时,它都会在不同的地方崩溃。

例如:

$ sudo apt-get update
Ign http://dl.google.com stable InRelease                             
Ign http://archive.ubuntu.com saucy InRelease                         
Ign http://ppa.launchpad.net saucy InRelease                         
Hit http://dl.google.com stable Release.gpg                          
Ign http://archive.ubuntu.com saucy-updates InRelease                
Ign http://ppa.launchpad.net saucy InRelease                         
Hit http://dl.google.com stable Release                              
Ign http://ppa.launchpad.net saucy InRelease                          
Hit http://dl.google.com stable/main amd64 Packages                  
Ign http://ppa.launchpad.net saucy InRelease                         
Get:1 http://ppa.launchpad.net saucy Release.gpg [316 B]             
Ign http://archive.ubuntu.com saucy-security InRelease               
Get:2 http://ppa.launchpad.net saucy Release.gpg [316 B]             
E: Method gave invalid 400 URI Failure message 

以下是输出wget -d http://ppa.launchpad.net/ -o /tmp/outputfile.log

$ wget -d http://ppa.launchpad.net/ -o /tmp/outputfile.logSetting --output-file (logfile) to /tmp/outputfile.log

DEBUG output created by Wget 1.14 on linux-gnu.

URI encoding = ‘UTF-8’
--2014-07-10 13:48:37--  http://ppa.launchpad.net/ Resolving ppa.launchpad.net (ppa.launchpad.net)... 91.189.95.83 Caching ppa.launchpad.net => 91.189.95.83 Connecting to ppa.launchpad.net (ppa.launchpad.net)|91.189.95.83|:80... connected. Created socket 4. Releasing 0x0000000000f3dde0 (new refcount 1).

---request begin--- GET / HTTP/1.1 User-Agent: Wget/1.14 (linux-gnu) Accept: */* Host: ppa.launchpad.net Connection: Keep-Alive

---request end--- HTTP request sent, awaiting response... 
---response begin--- HTTP/1.1 200 OK Date: Thu, 10 Jul 2014 12:48:40 GMT Server: Apache/2.2.22 (Ubuntu) Vary: Accept-Encoding Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html;charset=UTF-8

---response end--- 200 OK Registered socket 4 for persistent reuse. URI content encoding = ‘UTF-8’ Length: unspecified [text/html] Saving to: ‘index.html’

     0K .......... .......... .......... .......... .......... 7.72K
    50K .......... .......... .......... .......... .......... 13.3K
   100K .......... .......... .......... .......... .......... 12.6K
  1850K .......... .......... .......... .......... .......... 19.2K
  1900K .......... .......... .......... .......... .......... 8.97K
  1950K .......... .......... .......... .......... ...       
18.2K=2m34s

2014-07-10 13:52:18 (12.9 KB/s) - ‘index.html’ saved [2041092]

这是我的语言环境信息:

$ locale
LANG=en
LANGUAGE=en
LC_CTYPE="en_CA.utf8"
LC_NUMERIC="en_CA.utf8"
LC_TIME="en_CA.utf8"
LC_COLLATE="en_CA.utf8"
LC_MONETARY="en_CA.utf8"
LC_MESSAGES="en_CA.utf8"
LC_PAPER="en_CA.utf8"
LC_NAME="en_CA.utf8"
LC_ADDRESS="en_CA.utf8"
LC_TELEPHONE="en_CA.utf8"
LC_MEASUREMENT="en_CA.utf8"
LC_IDENTIFICATION="en_CA.utf8"
LC_ALL=en_CA.utf8

答案1

您的区域编码设置是utf8代替UTF-8

尝试这个命令:

   sudo locale-gen en_CA.UTF-8

退出终端并重新登录(我不确定是否必须重新启动)。

检查区域设置是否正确修改并尝试 perl 和 apt-get 命令。

相关内容