From dbe1718917bc9d60c1d6969494186cb0acc094f8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 14 Jul 2014 21:18:00 +0800 Subject: [PATCH] PUB:20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu @geekpi --- ...rge.net Using 'Reprepro' Tool in Ubuntu.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) rename {translated/tech => published}/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md (76%) diff --git a/translated/tech/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md b/published/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md similarity index 76% rename from translated/tech/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md rename to published/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md index 9c33329655..7c3686fd36 100644 --- a/translated/tech/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md +++ b/published/20140625 Create A '.deb Pacakge Repository' at Sourceforge.net Using 'Reprepro' Tool in Ubuntu.md @@ -1,6 +1,6 @@ -在Ubuntu下使用“Reprepro”工具在Sourceforge.net中创建".deb"包仓库 +在Ubuntu下如何创建远程".deb"包仓库 ================================================================================ -**Reprepro**是一款小巧的命令行工具来方便地创建并管理**.deb**仓库。今天我们会战士如何人使用reprepro简单地创建一个Debian包仓库,并使用**rsync**上传到Sourceforge.net。 +**Reprepro**是一款小巧的命令行工具来方便地创建并管理**.deb**仓库。今天我们会展示给你如何使用reprepro简单地创建一个Debian包仓库,并使用**rsync**上传到Sourceforge.net。 ![Create Deb Package Repository](http://www.tecmint.com/wp-content/uploads/2014/06/Create-Debian-Package-Repository1.png) @@ -10,11 +10,11 @@ $ sudo apt-get install reprepro gnupg -现在你需要使用hnupg生成一个gpg key,这里使用下面的命令。 +现在你需要使用gnupg生成一个gpg key,这里使用下面的命令。 $ gpg --gen-key -它会询问你一些问题,比如你想要哪种key、key的有效期、如果你不知道如何回答,只需点击**Enter** 来选择默认选项(建议) +它会询问你一些问题,比如你想要哪种key、key的有效期、如果你不知道如何回答,只需点击**回车** 来选择默认选项(建议) 当然,它会询问你用户名和密码,在脑海中记住这些,因为我们会在之后需要它。 @@ -85,7 +85,7 @@ ### 步骤 2: 创建一个包仓库并导出key ### -我们现在要开始创建仓库,首先你需要创建一些文件夹,我们的仓库会在**/var/www/apt**目录,让我们先创建这些目录。 +我们现在要开始创建仓库,首先你需要创建一些文件夹,我们的仓库会放在**/var/www/apt**目录,让我们先创建这些目录。 $ sudo su # cd /var/www @@ -98,7 +98,7 @@ # gpg --armor --export username yourmail@mail.com >> /var/www/apt/key/deb.gpg.key -注意:用你之前步骤中输入的用户名代替username,用你的email代替yourmail@mail.com。 +注意:用你之前步骤中输入的用户名代替username,用你的email代替上面的yourmail@mail.com。 我们需要在**/var/www/apt/conf**创建一个文件“**distributions**”。 @@ -106,14 +106,14 @@ 加入下面这几行到distributions这个文件中并保存。 - Origin: (yourname) - Label: (name of repository) - Suite: (stable or unstable) - Codename: (the codename for the distribution you are using, like trusty) - Version: (the version for the distribution you are using, like 14.04) - Architectures: (the repository packages architecture, like i386 or amd64) - Components: (main restricted universe multiverse) - Description: (Some information about the repository) + Origin: (你的名字) + Label: (库的名字) + Suite: (stable 或 unstable) + Codename: (发布的代码名,比如 trusty) + Version: (发布的版本,比如 14.04) + Architectures: (软件包所支持的架构, 比如 i386 或 amd64) + Components: (包含的部件,比如 main restricted universe multiverse) + Description: (描述) SignWith: yes 接下来我们会创建仓库树,运行这些命令: @@ -137,7 +137,7 @@ ### 步骤 3: 在新创建的仓库中加入包 ### -现在准备你的**.deb**包来加入到仓库中。进入 **/var/www/apt**目录,你每次要加包的时候都不得不这么做。 +现在准备你的**.deb**包来加入到仓库中。进入 **/var/www/apt**目录,你每次要加包的时候都必须这么做。 # cd /var/www/apt # reprepro --ask-passphrase -Vb . includedeb Trusty /home/ravisaive/packages.deb @@ -159,7 +159,7 @@ Please enter passphrase: Successfully created './dists/Trusty/InRelease.new' -你的包已经加入了仓库,要移除它: +你的包已经加入了仓库,如果要移除它的话采用如下命令: # reprepro --ask-passphrase -Vb /var/www/apt remove trusty package.deb @@ -167,13 +167,15 @@ ### 步骤 4: 上传仓库到Sourceforge.net ### -要上传仓库到**Sourceforge.net**,你当然需要一个活跃账号与一个活跃项目,让我假设你想要上传仓库到**http://sourceforge.net/projects/myfoo/testrepository**,这里的myfoo是项目名(UNIX名称,不是URL,不是标题),testrepository是你想要上传文件到这上面的目录,这里我们会使用[rsync 命令][1] +要上传仓库到**Sourceforge.net**,你当然需要一个可用的账号与一个可用的项目,让我假设你想要上传仓库到**http://sourceforge.net/projects/myfoo/testrepository**,这里的myfoo是项目名(UNIX上的名称,不是URL,不是标题),testrepository是你想要上传文件到这上面的目录,这里我们会使用[rsync 命令][1]。(LCTT译注:当然你也可以上传到其它的支持Http/Rsync的服务器上,以提供远程软件库的服务。) # rsync -avP -e ssh /var/www/apt/ username@frs.sourceforge.net:/home/frs/project/myfoo/testrepository/ -**注意**:用你在sourceforge.net上的用户名代替username,用你的项目的UNIX类型名称代替myfoo,用你想要存储的文件夹代替testrepository。 +**注意**:用你在sourceforge.net上的用户名代替username,用你的项目的UNIX名称代替myfoo,用你想要存储的文件夹代替testrepository。 -现在你的仓库上传到了**http://sourceforge.net/projects/myfoo/testrepository**,要把它加入到已安装的系统,首先你需要导入仓库key,它会在**/var/www/apt/key/deb.gpg.key**,但是这是一个本地路径,并且你仓库的用户不能添加到他们的系统中,这就是为什么我们要导入来自sourceforge.net的key的原因。 +现在你的仓库(包括设置和key等等)上传到了**http://sourceforge.net/projects/myfoo/testrepository**。 + +要把它加入到一个已装好的系统,首先你需要导入仓库key,它实际上就是**/var/www/apt/key/deb.gpg.key**,但是这是一个本地路径,使用你的仓库的其它用户不能添加到他们的系统中,这就是为什么我们要导入来自sourceforge.net的key的原因。 $ sudo su # wget -O - http://sourceforge.net/projects/myfoo/testrepository/apt/key/deb.gpg.key | apt-key add - @@ -194,7 +196,7 @@ via: http://www.tecmint.com/create-deb-pacakge-repository-in-ubuntu/ -译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出