当 apt-get install XXX 导致连接失败时该尝试什么

当 apt-get install XXX 导致连接失败时该尝试什么

存储库或服务器是否存在问题,或者我的缓存是否已过时?

我可以ping tw.archive.ubuntu.com的。

它几乎看起来像文件

http://tw.archive.ubuntu.com/ubuntu/pool/main/p/pulseaudio/pulseaudio_1.0-0ubuntu3.1_amd64.deb

不存在。

编辑:

我指向的服务器似乎已过时。我找到了丢失的文件这里

看起来你可以检查服务器是否最新

我现在要研究如何更改我的服务器。

$ sudo apt-get install kcachegrind
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  docbook-xsl exiv2 gstreamer0.10-alsa gstreamer0.10-pulseaudio icoutils kate-data katepart kde-runtime kde-runtime-data kdebase-runtime kdelibs-bin kdelibs5-data kdelibs5-plugins kdoctools kubuntu-debug-installer libasound2-plugins libattica0
  libcanberra-pulse libclucene0ldbl libdbusmenu-qt2 libdlrestrictions1 libexiv2-10 libilmbase6 libiodbc2 libkatepartinterfaces4 libkcmutils4 libkde3support4 libkdecore5 libkdesu5 libkdeui5 libkdewebkit5 libkdnssd4 libkemoticons4 libkfile4 libkhtml5
  libkidletime4 libkio5 libkjsapi4 libkjsembed4 libkmediaplayer4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkparts4 libkpty4 libkrosscore4 libktexteditor4 libnepomuk4 libnepomukquery4a libnepomukutils4 libntrack-qt4-1 libntrack0 libopenexr6
  libphonon4 libplasma3 libpolkit-qt-1-1 libpulse-mainloop-glib0 libqapt-runtime libqapt1 libqca2 libqt4-dbus libqt4-declarative libqt4-designer libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg
  libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libqtwebkit4 libraptor2-0 librasqal3 librdf0 libsolid4 libsoprano4 libspeexdsp1 libssh-4 libstreamanalyzer0 libstreams0 libthreadweaver4 libutempter0 libvirtodbc0 libxml2-utils libyajl1
  ntrack-module-libnl-0 oxygen-icon-theme phonon phonon-backend-gstreamer plasma-scriptengine-javascript pulseaudio pulseaudio-esound-compat pulseaudio-module-x11 pulseaudio-utils qapt-batch qdbus rtkit shared-desktop-ontologies soprano-daemon
  virtuoso-minimal virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common
Suggested packages:
  docbook-xsl-doc-html docbook-xsl-doc-pdf docbook-xsl-doc-text docbook-xsl-doc libsaxon-java libxalan2-java docbook-xsl-saxon fop xalan dbtoepub libterm-readline-gnu-perl libterm-readline-perl-perl kcachegrind-converters khelpcenter4 djvulibre-bin
  hspell libqca2-plugin-cyrus-sasl libqca2-plugin-gnupg libqca2-plugin-ossl libqt4-declarative-folderlistmodel libqt4-declarative-gestures libqt4-declarative-particles libqt4-declarative-shaders qt4-qmlviewer libqt4-dev qt4-qtconfig raptor2-utils
  rasqal-utils librdf-storage-postgresql librdf-storage-mysql librdf-storage-sqlite redland-utils phonon-backend-vlc phonon-backend-xine phonon-backend-mplayer gstreamer0.10-plugins-ugly pavumeter paman paprefs pulseaudio-module-raop
The following NEW packages will be installed:
  docbook-xsl exiv2 gstreamer0.10-alsa gstreamer0.10-pulseaudio icoutils kate-data katepart kcachegrind kde-runtime kde-runtime-data kdebase-runtime kdelibs-bin kdelibs5-data kdelibs5-plugins kdoctools kubuntu-debug-installer libasound2-plugins
  libattica0 libcanberra-pulse libclucene0ldbl libdbusmenu-qt2 libdlrestrictions1 libexiv2-10 libilmbase6 libiodbc2 libkatepartinterfaces4 libkcmutils4 libkde3support4 libkdecore5 libkdesu5 libkdeui5 libkdewebkit5 libkdnssd4 libkemoticons4 libkfile4
  libkhtml5 libkidletime4 libkio5 libkjsapi4 libkjsembed4 libkmediaplayer4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkparts4 libkpty4 libkrosscore4 libktexteditor4 libnepomuk4 libnepomukquery4a libnepomukutils4 libntrack-qt4-1 libntrack0
  libopenexr6 libphonon4 libplasma3 libpolkit-qt-1-1 libpulse-mainloop-glib0 libqapt-runtime libqapt1 libqca2 libqt4-dbus libqt4-declarative libqt4-designer libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql
  libqt4-svg libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libqtwebkit4 libraptor2-0 librasqal3 librdf0 libsolid4 libsoprano4 libspeexdsp1 libssh-4 libstreamanalyzer0 libstreams0 libthreadweaver4 libutempter0 libvirtodbc0 libxml2-utils libyajl1
  ntrack-module-libnl-0 oxygen-icon-theme phonon phonon-backend-gstreamer plasma-scriptengine-javascript pulseaudio pulseaudio-esound-compat pulseaudio-module-x11 pulseaudio-utils qapt-batch qdbus rtkit shared-desktop-ontologies soprano-daemon
  virtuoso-minimal virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common
0 upgraded, 107 newly installed, 0 to remove and 0 not upgraded.
Need to get 918 kB/70.0 MB of archives.
After this operation, 256 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Err http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates/main pulseaudio amd64 1:1.0-0ubuntu3.1
  Connection failed
Failed to fetch http://tw.archive.ubuntu.com/ubuntu/pool/main/p/pulseaudio/pulseaudio_1.0-0ubuntu3.1_amd64.deb  Connection failed
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
$

答案1

好的,事实证明我指向的服务器已经过时了。

我将在这里发布解决问题的步骤(供我自己参考以及遇到类似问题的其他人参考)。

  1. 先试sudo apt-get update一下sudo apt-get install XXX- 您自己的缓存可能已过时。如果失败,请转到 2-5。
  2. 从此处查找附近的最新、快速的新服务器列表
  3. 使用说明这里指向新服务器。
  4. sudo apt-get update指向新服务器后。
  5. sudo apt-get install XXX

令人惊讶的是,ubuntu 自己的服务器似乎已经过时了:

tw.archive.ubuntu.com

如果 Ubuntu 可以修复这些问题就好了,这样它对于新的非技术用户来说会更加友好(或者至少更加明显:也许在期间警告有关陈旧的服务器apt-get install)。

相关内容