以下命令均需要使用 putty 登录到服务器远程执行命令操作,你可以直接复制下面的命令,然后点击 putty 窗口按鼠标右键,粘贴命令。
本步骤不可跳过,需要先执行,后面才可以继续,建议每次安装新软件时,都执行一遍本步骤。
输入如下命令更新软件源:
apt-get update
下面的提示不同的Linux的版本存在不同的差异,但有如下类似的提示时,表示更新成功:
root@241541:~# apt-get update
Get:1 http://archive.ubuntu.com maverick Release.gpg [198B]
Ign http://archive.ubuntu.com/ubuntu/ maverick/main Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick/restricted Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick/universe Translation-en
Get:2 http://archive.ubuntu.com maverick-updates Release.gpg [198B]
Ign http://archive.ubuntu.com/ubuntu/ maverick-updates/main Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-updates/restricted Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-updates/universe Translation-en
Get:3 http://archive.ubuntu.com maverick-security Release.gpg [198B]
Ign http://archive.ubuntu.com/ubuntu/ maverick-security/main Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-security/restricted Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-security/universe Translation-en
Get:4 http://archive.ubuntu.com maverick Release [39.8kB]
Get:5 http://archive.ubuntu.com maverick-updates Release [31.4kB]
Get:6 http://archive.ubuntu.com maverick-security Release [31.4kB]
Get:7 http://archive.ubuntu.com maverick/main i386 Packages [1492kB]
Get:8 http://archive.ubuntu.com maverick/restricted i386 Packages [5992B]
Get:9 http://archive.ubuntu.com maverick/universe i386 Packages [5791kB]
Get:10 http://archive.ubuntu.com maverick-updates/main i386 Packages [380kB]
Get:11 http://archive.ubuntu.com maverick-updates/restricted i386 Packages [1797B]
Get:12 http://archive.ubuntu.com maverick-updates/universe i386 Packages [157kB]
Get:13 http://archive.ubuntu.com maverick-security/main i386 Packages [157kB]
Get:14 http://archive.ubuntu.com maverick-security/restricted i386 Packages [14B]
Get:15 http://archive.ubuntu.com maverick-security/universe i386 Packages [77.9kB]
Fetched 8166kB in 4s (1724kB/s)
Reading package lists... Done