特殊:Badtitle/NS100:AptMoveHowto/breezy
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/AptMoveHowto/breezy }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/af | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Afrikaans| [[::AptMoveHowto/breezy/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ar | • {{#if: UbuntuHelp:AptMoveHowto/breezy|العربية| [[::AptMoveHowto/breezy/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/az | • {{#if: UbuntuHelp:AptMoveHowto/breezy|azərbaycanca| [[::AptMoveHowto/breezy/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/bcc | • {{#if: UbuntuHelp:AptMoveHowto/breezy|جهلسری بلوچی| [[::AptMoveHowto/breezy/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/bg | • {{#if: UbuntuHelp:AptMoveHowto/breezy|български| [[::AptMoveHowto/breezy/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/br | • {{#if: UbuntuHelp:AptMoveHowto/breezy|brezhoneg| [[::AptMoveHowto/breezy/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ca | • {{#if: UbuntuHelp:AptMoveHowto/breezy|català| [[::AptMoveHowto/breezy/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/cs | • {{#if: UbuntuHelp:AptMoveHowto/breezy|čeština| [[::AptMoveHowto/breezy/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/de | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Deutsch| [[::AptMoveHowto/breezy/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/el | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Ελληνικά| [[::AptMoveHowto/breezy/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/es | • {{#if: UbuntuHelp:AptMoveHowto/breezy|español| [[::AptMoveHowto/breezy/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/fa | • {{#if: UbuntuHelp:AptMoveHowto/breezy|فارسی| [[::AptMoveHowto/breezy/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/fi | • {{#if: UbuntuHelp:AptMoveHowto/breezy|suomi| [[::AptMoveHowto/breezy/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/fr | • {{#if: UbuntuHelp:AptMoveHowto/breezy|français| [[::AptMoveHowto/breezy/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/gu | • {{#if: UbuntuHelp:AptMoveHowto/breezy|ગુજરાતી| [[::AptMoveHowto/breezy/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/he | • {{#if: UbuntuHelp:AptMoveHowto/breezy|עברית| [[::AptMoveHowto/breezy/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/hu | • {{#if: UbuntuHelp:AptMoveHowto/breezy|magyar| [[::AptMoveHowto/breezy/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/id | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Bahasa Indonesia| [[::AptMoveHowto/breezy/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/it | • {{#if: UbuntuHelp:AptMoveHowto/breezy|italiano| [[::AptMoveHowto/breezy/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ja | • {{#if: UbuntuHelp:AptMoveHowto/breezy|日本語| [[::AptMoveHowto/breezy/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ko | • {{#if: UbuntuHelp:AptMoveHowto/breezy|한국어| [[::AptMoveHowto/breezy/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ksh | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Ripoarisch| [[::AptMoveHowto/breezy/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/mr | • {{#if: UbuntuHelp:AptMoveHowto/breezy|मराठी| [[::AptMoveHowto/breezy/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ms | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Bahasa Melayu| [[::AptMoveHowto/breezy/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/nl | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Nederlands| [[::AptMoveHowto/breezy/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/no | • {{#if: UbuntuHelp:AptMoveHowto/breezy|norsk| [[::AptMoveHowto/breezy/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/oc | • {{#if: UbuntuHelp:AptMoveHowto/breezy|occitan| [[::AptMoveHowto/breezy/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/pl | • {{#if: UbuntuHelp:AptMoveHowto/breezy|polski| [[::AptMoveHowto/breezy/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/pt | • {{#if: UbuntuHelp:AptMoveHowto/breezy|português| [[::AptMoveHowto/breezy/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ro | • {{#if: UbuntuHelp:AptMoveHowto/breezy|română| [[::AptMoveHowto/breezy/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/ru | • {{#if: UbuntuHelp:AptMoveHowto/breezy|русский| [[::AptMoveHowto/breezy/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/si | • {{#if: UbuntuHelp:AptMoveHowto/breezy|සිංහල| [[::AptMoveHowto/breezy/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/sq | • {{#if: UbuntuHelp:AptMoveHowto/breezy|shqip| [[::AptMoveHowto/breezy/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/sr | • {{#if: UbuntuHelp:AptMoveHowto/breezy|српски / srpski| [[::AptMoveHowto/breezy/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/sv | • {{#if: UbuntuHelp:AptMoveHowto/breezy|svenska| [[::AptMoveHowto/breezy/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/th | • {{#if: UbuntuHelp:AptMoveHowto/breezy|ไทย| [[::AptMoveHowto/breezy/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/tr | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Türkçe| [[::AptMoveHowto/breezy/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/vi | • {{#if: UbuntuHelp:AptMoveHowto/breezy|Tiếng Việt| [[::AptMoveHowto/breezy/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/yue | • {{#if: UbuntuHelp:AptMoveHowto/breezy|粵語| [[::AptMoveHowto/breezy/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/zh | • {{#if: UbuntuHelp:AptMoveHowto/breezy|中文| [[::AptMoveHowto/breezy/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/zh-hans | • {{#if: UbuntuHelp:AptMoveHowto/breezy|中文(简体)| [[::AptMoveHowto/breezy/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:AptMoveHowto/breezy | UbuntuHelp:AptMoveHowto/breezy | {{#if: | :}}AptMoveHowto/breezy}}/zh-hant | • {{#if: UbuntuHelp:AptMoveHowto/breezy|中文(繁體)| [[::AptMoveHowto/breezy/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:AptMoveHowto/breezy|:AptMoveHowto/breezy|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :AptMoveHowto/breezy/zh | | {{#ifexist: AptMoveHowto/breezy/zh | | {{#ifeq: {{#titleparts:AptMoveHowto/breezy|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:AptMoveHowto/breezy|1|-1|}} | zh | | }}
This page will describe how to make a cd which contains packages you have downloaded on one machine which you can then use the cd as a repository that you can easily use on another machine.
For example, I will show how to make a cd which contains all the security updates that has been downloaded.
Except for adding new apt PGP keys, the user of the cd will not need to use the command-line to use it.
Step 1: Install the apt-move package
Apt-move is a tool for creating a debian package repository file structure out of packages that have been downloaded to /var/cache/apt/archives. Installed packages are downloaded there by apt for installation. Apt-move will create this local repository in /mirrors/debian, by default. You need to install the apt-move package from the Universe Repository.
You can change the edit the configuration file located at /etc/apt-move.conf.
COPYONLY=no
to
COPYONLY=yes
So that apt-move doesn't delete file from your /var/cache/apt/archives/.
Step 2: Select the packages you want to put on the cd
In this example, we only want to put freshly downloaded packages. We don't want to put old packages or packages that exist in Ubuntu CD.
First, we clean up the /var/cache/apt/archives from old packages.
sudo apt-get autoclean
Next, we delete packages that exists in the Ubuntu CD. Put your Ubuntu CD on CD-ROM Drive, mount it (if it not automatically mounted) then run the following:
for f in `find /media/cdrom/pool/ -name '*.deb' -printf %f\\n` do if [ -f /var/cache/apt/archives/$f ]; then sudo rm -v /var/cache/apt/archives/$f fi done
Step 3: Run apt move to create the archive structure
Make sure you have enough disk space first.
Because /mirrors/debian is root owned we must become root to make the steps easier.
sudo -s
All the following command run as root. First we clean-up previous mirrors (if exists) then we run apt-move.
rm -rf /mirrors/debian apt-move -d breezy update
Because ubuntu repository structure, not all packages are inserted into the Packages.gz file by apt-move. We must remake Packages.gz with the help of apt-ftparchive.
cd /mirrors/debian apt-ftparchive packages pool/main/ \ | gzip -9c > dists/breezy/main/binary-i386/Packages.gz apt-ftparchive packages pool/restricted/ \ | gzip -9c > dists/breezy/restricted/binary-i386/Packages.gz
We must also remake Release file, to do this we must make an apt configuration file named ~/myapt.conf it contents is like this
APT::FTPArchive::Release { Origin "APT-Move"; Label "APT-Move"; Suite "breezy"; Codename "breezy"; Architectures "i386"; Components "main restricted"; Description "Ubuntu Updates CD"; };
Next, run the following commands:
rm dists/breezy/Release apt-ftparchive -c ~/myapt.conf release dists/breezy/ > Release mv Release dists/breezy/Release
Then we need to make Release.gpg, to make it you must already have your UbuntuHelp:GPGKey set and ready to sign.
gpg -bao dists/breezy/Release.gpg dists/breezy/Release
Next, we delete unwanted .apt-move directory
rm -rf .apt-move
You can identify the cd by making a .disk directory and making an info file in it.
mkdir .disk echo Ubuntu-Updates `date +%Y-%m-%d` > .disk/info
Then we need to put our public keys in it.
gpg --export -a "Your Name" > public.key
Offcourse change Your Name with the name that you use in your PGP.
Thats' all
exit
Step 4: Burn the cd
Copy the contents of what is contained in /mirrors/debian to a cd.
For example you could make an iso by following command:
mkisofs -r -A "Ubuntu Updates `date +%Y%m%d`" -o ubuntu-updates.iso \ /mirrors/debian
Before you could use the CD, you need to add our GPG key to apt GPG keys. Put the CD on CD-ROM Drive, mount it (if it not automatically mounted) then run the following:
apt-key add /cdrom/public.key
Then you could use the CD like any other Ubuntu CD. On a non-networked ubuntu machine, you can run synaptic, insert the cd and go into Synaptic -> Edit -> Add Cdrom and it will add the contents of the cd to your repositories.
You can also do it from the command-line with
sudo apt-cdrom add