特殊:Badtitle/NS100:AptMoveHowto/simple:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Oneleaf留言 | 贡献
新页面: {{From|https://help.ubuntu.com/community/AptMoveHowto/simple}} {{Languages|UbuntuHelp:AptMoveHowto/simple}} How can I easily transfer all the packages I have downloaded with apt to anothe...
 
Wikibot留言 | 贡献
无编辑摘要
第5行: 第5行:
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.
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.


* You can need to install apt-move from the Universe Repository and dpkg-deve packages.
* Then you need to run this command in the terminal
<pre><nowiki>
<pre><nowiki>
# Commands to be run only once
sudo apt-get install apt-move dpkg-dev
sudo mkdir --parents --mode=a+w /mirrors/debian
sudo mkdir --parents --mode=a+w /mirrors/debian
# Next line is needed if /mirrors/debian already existed
</nowiki></pre>
**** If it comes back saying  /mirrors/debian already existed then you need to put this line in the terminal.
<pre><nowiki> 
sudo chmod a+w --recursive /mirrors/debian
sudo chmod a+w --recursive /mirrors/debian
</nowiki></pre>
</nowiki></pre>
(Or just use synaptic and install the apt-move package) You need to have enabled the universe repository. See AddingRepositoriesHowto
 
* Next you need to update apt-move
<pre><nowiki>
<pre><nowiki>
apt-move update
apt-move update
</nowiki></pre>
</nowiki></pre>
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.
* 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.
<pre><nowiki>
<pre><nowiki>
cd /mirrors/debian # We must be here for dpkg-sc. to create correct relative filenames
cd /mirrors/debian
dpkg-scanpackages pool /dev/null | gzip -9 > dists/stable/main/binary-i386/Packages.gz
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
</nowiki></pre>
 
**** Problem: The restricted section (e.g. restricted linux drivers) is also taken into account
<pre><nowiki> 
mkdir /mirrors/debian/.disk
mkdir /mirrors/debian/.disk
echo "Custom packages" $(hostname) $(date +%y%m%d) > /mirrors/debian/.disk/info
echo "Custom packages" $(hostname) $(date +%y%m%d) > /mirrors/debian/.disk/info
</nowiki></pre>
</nowiki></pre>


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.
* 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.
 
Insert that disk into the non-networked computer and add the cdrom as a repository using synaptic or run


<pre><nowiki>
* 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.
sudo apt-cdrom add
</nowiki></pre>
from the command line.  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.


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.
* 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...
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...


----
----
[[category:CategoryCleanup]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2007年11月22日 (四) 12:02的版本

{{#ifexist: :AptMoveHowto/simple/zh | | {{#ifexist: AptMoveHowto/simple/zh | | {{#ifeq: {{#titleparts:AptMoveHowto/simple|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:AptMoveHowto/simple|1|-1|}} | zh | | }}

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.

  • You can need to install apt-move from the Universe Repository and dpkg-deve packages.
  • Then you need to run this command in the terminal
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.
  
sudo chmod a+w --recursive /mirrors/debian
  • Next you need to update apt-move
apt-move update
  • 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.

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
  
mkdir /mirrors/debian/.disk
echo "Custom packages" $(hostname) $(date +%y%m%d) > /mirrors/debian/.disk/info
  • 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.
  • 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.
  • 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...