====== 用 apt-get 安装或移除软体 ====== ===== 安装软体 ===== 如何在你新的 ubuntu 伺服器中安装软体, 请输入下面指令(请将<软体名称>换成你要安装的软体名称): apt-get install <软体名称> 您可以使用 **man apt-get** 来查询更多关于 apt-get 指令的细节 ===== 软体来源清单(sources.list) ===== 如果你输入 apt-get install <软体名称> 后看到下列讯息: Reading package lists... Done Building dependency tree Reading state information... Done **E: Couldn't find package** <软体名称> 这表示您可能打错了软体名称, 或是无法在软体来源清单中找到它. 您可以自动产生软体来源清单(使用在您的 ubuntu server 上面), 工具在这里: http://www.ubuntu-nl.org/source-o-matic/ 这工具会产生如下讯息: # Automatically generated sources.list # http://www.ubuntu-nl.org/source-o-matic/ # # If you get GPG errors with this sources.list, locate the GPG key in this file # and run these commands (where KEY is replaced with that key) # # gpg --keyserver hkp://subkeys.pgp.net --recv-keys KEY # gpg --export --armor KEY | sudo apt-key add - # # If you don't know what to do with this file, read # https://help.ubuntu.com/community/Repositories/CommandLine # Ubuntu supported packages # GPG key: 437D05B5 deb http://us.archive.ubuntu.com/ubuntu gutsy main restricted deb http://us.archive.ubuntu.com/ubuntu gutsy-updates main restricted deb http://security.ubuntu.com/ubuntu gutsy-security main restricted # Ubuntu community supported packages # GPG key: 437D05B5 deb http://us.archive.ubuntu.com/ubuntu gutsy universe multiverse deb http://us.archive.ubuntu.com/ubuntu gutsy-updates universe multiverse deb http://security.ubuntu.com/ubuntu gutsy-security universe multiverse 直接把 **/etc/apt/sources.list** 的内容覆蓋掉(或是用 sftp、其他档案传输软体来覆蓋), 然后在终端机输入指令: apt-get update 一旦你完成后,你可以重试指令 apt-get install <软体名称>, 在软体来源清单内的软体,你都可以使用它.