在ubuntu中安装ruby bundler和更新头的困难

在ubuntu中安装ruby bundler和更新头的困难,ruby,shell,ubuntu,installation,terminal,Ruby,Shell,Ubuntu,Installation,Terminal,我正在学习RubyonRails,因此需要为应用程序安装一些gems。 我正在尝试安装ruby bundler,但出现错误。 我需要一些帮助。。 我将粘贴我在终端中尝试的命令。 提前谢谢 hp@ubuntu:~$ bundle install --without production The program 'bundle' is currently not installed. You can install it by typing: sudo apt-get install ruby-b

我正在学习RubyonRails,因此需要为应用程序安装一些gems。 我正在尝试安装ruby bundler,但出现错误。 我需要一些帮助。。 我将粘贴我在终端中尝试的命令。 提前谢谢

hp@ubuntu:~$ bundle install --without production
The program 'bundle' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-bundler

hp@ubuntu:~$ sudo apt-get install ruby-bundler
[sudo] password for hp: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  ruby ruby1.8
Suggested packages:
ri ruby-dev ruby1.8-examples ri1.8
The following NEW packages will be installed:
  ruby ruby-bundler ruby1.8
0 upgraded, 3 newly installed, 0 to remove and 64 not upgraded.
Need to get 143 kB of archives.
After this operation, 1,139 kB of additional disk space will be used.  
Do you want to continue [Y/n]? y
Err http://ubuntuarchive.hnsdc.com/ubuntu/ oneiric/main ruby all 4.8
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com/ubuntu/ oneiric/universe ruby-bundler all 1.0.15-     0ubuntu2
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com/ubuntu/ oneiric-security/main ruby1.8 i386 1.8.7.352- 2ubuntu0.1
Unable to connect to ubuntuarchive.hnsdc.com:http:
Failed to fetch             http://ubuntuarchive.hnsdc.com/ubuntu/pool/main/r/ruby1.8/ruby1.8_1.8.7.352-2ubuntu0.1_i386.deb  Unable to connect to ubuntuarchive.hnsdc.com:http:
Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/pool/main/r/ruby-     defaults/ruby_4.8_all.deb  Unable to connect to ubuntuarchive.hnsdc.com:http:
Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/pool/universe/r/ruby-bundler/ruby-bundler_1.0.15-0ubuntu2_all.deb  Unable to connect to ubuntuarchive.hnsdc.com:http:
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
hp@ubuntu:~$ sudo apt-get update
Ign http://archive.canonical.com oneiric InRelease                             
Hit http://archive.canonical.com oneiric Release.gpg                           
Hit http://archive.canonical.com oneiric Release                               
Hit http://archive.canonical.com oneiric/partner i386 Packages                  
Ign http://archive.canonical.com oneiric/partner TranslationIndex              
Err http://ubuntuarchive.hnsdc.com oneiric InRelease                                                           

Err http://ubuntuarchive.hnsdc.com oneiric-updates InRelease                   

Err http://ubuntuarchive.hnsdc.com oneiric-security InRelease

Err http://ubuntuarchive.hnsdc.com oneiric Release.gpg
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com oneiric-updates Release.gpg
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com oneiric-security Release.gpg
Unable to connect to ubuntuarchive.hnsdc.com:http:
Ign http://archive.canonical.com oneiric/partner Translation-en_US
Ign http://archive.canonical.com oneiric/partner Translation-en
Reading package lists... Done
W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric/InRelease  

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-updates/InRelease  

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-security/InRelease  

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric/Release.gpg      Unable to connect to ubuntuarchive.hnsdc.com:http:

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-updates/Release.gpg  Unable to connect to ubuntuarchive.hnsdc.com:http:

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-security/Release.gpg  Unable to connect to ubuntuarchive.hnsdc.com:http:

W: Some index files failed to download. They have been ignored, or old ones used instead.
原因可能是什么?? 它与ubuntu存档镜像有关吗?
由于软件包损坏,我甚至无法升级。

似乎您的网络有问题

您没有提供关于正确安装Ruby所做工作的详细信息,因此我将在

在使用Ubuntu作为开发平台时,需要注意的一点是,安装本博客文章中介绍的一些开发工具和库是明智的

13年1月31日-如果您有未满足的软件包依赖项,并且您从第三方源安装软件包时出现软件包依赖项错误。进入您的软件源,确保未选中受限和通用

未满足依赖关系的一个可能原因可能是包数据库损坏和/或某些包安装不正确

要尝试解决此问题,请打开终端并运行以下命令

xyz@ubuntuhost$ sudo apt-get clean
apt get clean清除所有文件/包的本地回购,只保留锁定文件

如果这不能解决您的问题,请按以下顺序尝试这三个命令

xyz@ubuntuhost$ sudo apt-get -f install

xyz@ubuntuhost$ sudo dpkg --configure -a

xyz@ubuntuhost$ sudo apt-get -f install
发布最后一个命令的输出。如果它发现并修复了某些内容,它将报告如下内容

1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-f代表“fixbreaked”。Apt将尝试纠正损坏的依赖项。如果您手动安装了具有未满足的依赖项的软件包,apt get将安装这些依赖项(如果可能),否则它可能只是删除您安装的软件包以解决问题


试一试。

我在博客中尝试通过命令更新,但终端总是出现“无法纠正问题,您持有损坏的软件包”。您可以尝试运行更新管理器,让它更新/修复损坏的软件包。它抱怨的软件包是什么?“以下软件包具有未满足的依赖关系:vim:dependens:vim common=2:7.3.154+hg~74503f6ee649-2ubuntu3,但2:7.3.154+hg~74503f6ee649-2ubuntu3.1是否要安装取决于:vim runtime=2:7.3.154+hg~74503f6ee649-2UBUNTUTU3,但2:7.3.154+hg~74503f6ee649-2UBUNTUTUTU3.1是否要安装安装“您是否运行更新管理器来尝试修复这些问题?每当我尝试这样做时,它都会显示等待apt退出。所以,我正在从终端升级。我是否需要升级到最新版本的ubuntu,或者11.04no.我认为服务器超载了。所以我更改了软件源。它正常工作,但在任何更新中都会显示“你持有损坏的软件包”。
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded