个人工具

UbuntuHelp:AptMoveHowto/simple/zh

来自Ubuntu中文

跳转至: 导航, 搜索






How can I easily transfer all the packages I have downloaded with apt to another box which is not connected to the internet? This How To is a simpler way to transfer downloaded packages from one machine to another. It does not require the recipient to enter GPG keys. It is not reccommended for someone who wants to distribute a cd publicly, for that reason. This is a "quick-and-dirty" way of getting the job done.

我如何轻易的将我通过APT下载的软件包转移到其他没有连接到网络的机器呢?这个HOWTO是一个转移下载的软件包到其他机器的简单方法。
接受方不需要输入公匙就可以进行转移。不建议用于公布CD的用户,应为这凑合完成工作而已。


1. You can need to install apt-move from the Universe Repository and dpkg-deve packages.
2. Then you need to run this command in the terminal

1.你需要安装 “apt-move”(通过Universe源)和“dpkg-deve”
2.然后你需要在终端输入下列指令:

sudo mkdir --parents --mode=a+w /mirrors/debian
  • If it comes back saying /mirrors/debian already existed then you need to put this line in the terminal.

如果返回 /mirrors/debian已经存在,那么你需要在终端输入下列行:

sudo chmod a+w --recursive /mirrors/debian

1. Next you need to update apt-move

接着,你需要更新 apt-move

apt-move update

1. Because of ubuntu repository structure, not all packages are inserted into the Packages.gz file by apt-move. We must remake the

Packages.gz file.

由于ubuntu源的结构问题,不是所有的软件包都能通过apt-move被插入到Packages.gz文件中。我们必须从新创建Packages.gz文件

cd /mirrors/debian
dpkg-scanpackages pool /dev/null | gzip -9 > dists/stable/main/binary-i386/Packages.gz
  • Problem: The restricted section (e.g. restricted linux drivers) is also taken into account

问题:受限制部分(比如 受限的linux 驱动程序)也要被记录在内

mkdir /mirrors/debian/.disk
echo "Custom packages" $(hostname) $(date +%y%m%d) > /mirrors/debian/.disk/info

1. Then, using nautilus-cd-burner burn the contents of the /mirrors/debian folder to a disk. Be sure to show hidden files so that you can copy the .disk file.
2. Insert that disk into the non-networked computer and add the cdrom as a repository using your favorite package manager. When installing the packages from this cd, you will be asked if you want to install these packages without authentification. For the sake of simplicity, the GPG keys and the release file are not included on this simple packages cd. The packages will still be installed without any problems if you answer yes.
3. Apt will prefer to use an authenticated source over an unauthenticated one. If you are on dialup and enable the universe repository, it will still try to download the package from the net and not from the local (unsigned) cd. You must disable the universe repository (or any other repository), update and install the package from the custom cd.

Note: Dapper will not copy deb packages from the install cd to the /var/cache/apt/archives directory, so we no longer need to clean it...

1.然后,使用nautilus-cd-burner 把 /mirrors/debian/ 文件里的内容烧制到光盘里。为了能复制 .disk文件,确定显示隐藏文件。
2.把光盘插入没有连接到网络的电脑里,并且使用你喜欢的包管理工具将 光驱添加为源。当你通过光盘安装软件包的时候,你会被问到是否要安装这些没有通过验证的软件包。出于简单操作的目的,公匙(GPG keys)和版本文件没有包含在简单的软件包光盘里。如果你回答"yes"软件包依然会被顺利安装。
3.APT 趋向于已经通过验证的来源的软件包多于没通过验证的。如果你连网而且激活了universe源,它依然会试着通过网络下载软件包而不是本地光盘。你必须关闭universe源(或者其他的源),从制定的CD更新并安装。

注意:Dapper 不会将安装光盘里的DEB包复制到 /var/cache/apt/archives目录,所以我们不再需要去清除它。。。