如何安装iftop包?

我安装了Ubuntu 12.04,当我尝试时它没有更新。 我更改了Ubuntu和DNS的服务器地址,但它仍然无法正常工作。 我正在尝试安装iotop,但事实并非如此。 我已经更改了我的Ubuntu服务器位置并将DNS更改为Google的默认服务器。 我已经正确安装了Zental,但iotop没有出现,我该如何安装呢?

这里的错误日志:

root@ubuntu:~# sudo apt-get update Ign http://archive.zentyal.org 3.0 InRelease Err http://archive.zentyal.org 3.0 Release.gpg Unable to connect to archive.zentyal.org:http: Ign http://archive.zentyal.org 3.0 Release Ign http://archive.zentyal.org 3.0/extra TranslationIndex Ign http://archive.zentyal.org 3.0/main TranslationIndex Err http://archive.zentyal.org 3.0/main i386 Packages Unable to connect to archive.zentyal.org:http: Err http://archive.zentyal.org 3.0/extra i386 Packages Unable to connect to archive.zentyal.org:http: Err http://archive.zentyal.org 3.0/extra Translation-en_US Unable to connect to archive.zentyal.org:http: Err http://archive.zentyal.org 3.0/extra Translation-en Unable to connect to archive.zentyal.org:http: Err http://archive.zentyal.org 3.0/main Translation-en_US Unable to connect to archive.zentyal.org:http: Err http://archive.zentyal.org 3.0/main Translation-en Unable to connect to archive.zentyal.org:http: Ign http://ppa.launchpad.net precise InRelease Err http://ppa.launchpad.net precise Release.gpg Unable to connect to ppa.launchpad.net:http: Ign http://ppa.launchpad.net precise Release Ign http://ppa.launchpad.net precise/main TranslationIndex Err http://ppa.launchpad.net precise/main Sources Unable to connect to ppa.launchpad.net:http: Err http://ppa.launchpad.net precise/main i386 Packages Unable to connect to ppa.launchpad.net:http: Err http://ppa.launchpad.net precise/main Translation-en_US Unable to connect to ppa.launchpad.net:http: Err http://ppa.launchpad.net precise/main Translation-en Unable to connect to ppa.launchpad.net:http: Ign http://archive.canonical.com precise InRelease Err http://archive.canonical.com precise Release.gpg Unable to connect to archive.canonical.com:http: [IP: 91.189.92.191 80] Ign http://archive.canonical.com precise Release Ign http://archive.canonical.com precise/partner TranslationIndex Err http://archive.canonical.com precise/partner Sources Unable to connect to archive.canonical.com:http: [IP: 91.189.92.191 80] Err http://archive.canonical.com precise/partner i386 Packages Unable to connect to archive.canonical.com:http: [IP: 91.189.92.191 80] Err http://archive.canonical.com precise/partner Translation-en_US Unable to connect to archive.canonical.com:http: [IP: 91.189.92.191 80] Err http://archive.canonical.com precise/partner Translation-en Unable to connect to archive.canonical.com:http: [IP: 91.189.92.191 80] Ign http://us.archive.ubuntu.com precise InRelease Ign http://us.archive.ubuntu.com precise-updates InRelease Ign http://us.archive.ubuntu.com precise-backports InRelease Err http://us.archive.ubuntu.com precise Release.gpg Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates Release.gpg Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports Release.gpg Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Ign http://us.archive.ubuntu.com precise Release Ign http://us.archive.ubuntu.com precise-updates Release Ign http://us.archive.ubuntu.com precise-backports Release Ign http://us.archive.ubuntu.com precise/main TranslationIndex Ign http://us.archive.ubuntu.com precise/multiverse TranslationIndex Ign http://us.archive.ubuntu.com precise/universe TranslationIndex Ign http://us.archive.ubuntu.com precise-updates/main TranslationIndex Ign http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex Ign http://us.archive.ubuntu.com precise-updates/universe TranslationIndex Ign http://us.archive.ubuntu.com precise-backports/main TranslationIndex Ign http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex Ign http://us.archive.ubuntu.com precise-backports/universe TranslationIndex Err http://us.archive.ubuntu.com precise/main Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/universe Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/multiverse Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/main i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/universe i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/multiverse i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/main Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/universe Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/multiverse Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/main i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/universe i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/main Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/universe Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/multiverse Sources Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/main i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/universe i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/main Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/main Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/multiverse Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/multiverse Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/universe Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise/universe Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/main Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/main Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/multiverse Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/multiverse Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/universe Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-updates/universe Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/main Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/main Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/multiverse Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/multiverse Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/universe Translation-en_US Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] Err http://us.archive.ubuntu.com precise-backports/universe Translation-en Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80] 23% [Connecting to security.ubuntu.com (91.189.91.14)] [Connecting to archive.ubuntu.com (91.189.92.202)] 

平:

 root@ubuntu:~# ping -c4 google.com PING google.com (202.166.193.187) 56(84) bytes of data. 64 bytes from 187.cache.google.com (202.166.193.187): icmp_req=1 ttl=62 time=3.08 ms 64 bytes from 187.cache.google.com (202.166.193.187): icmp_req=2 ttl=62 time=4.30 ms 64 bytes from 187.cache.google.com (202.166.193.187): icmp_req=3 ttl=62 time=3.50 ms 64 bytes from 187.cache.google.com (202.166.193.187): icmp_req=4 ttl=62 time=4.34 ms 

错误:

 root@ubuntu:~# sudo apt-get install iftop Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package iftop 

从您的评论中,您似乎正在尝试安装iftop ,但它告诉您它不存在。

iftop位于Universe存储库中,因此您需要启用它。 访问此问题: 如何启用“Universe”存储库? 启用它。 启用它后,首先执行apt-get update ,然后尝试apt-get install iftop


更新包列表的正确命令是:

 sudo apt-get update 

然后,实际升级您的Ubuntu的命令(即下载并安装较新版本的软件包)是:

 sudo apt-get upgrade 

请参阅我对这个问题的回答: https : //askubuntu.com/a/344363/52726 ,以apt-get update有关apt-get updateapt-get upgrade之间差异的更多解释。

安装包(或“应用程序”)的命令是:

 sudo apt-get install  

其中是应用程序的名称。 例如skypevlc等。

您运行的命令apt-get install update告诉Ubuntu安装一个名为update的软件包,该软件包不存在。