[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
apt-howto 2.0
ç°ćă§ăă
apt-howto ăŽăăźă¸ă§ăł 2.0 ă訳ăăžăăăăăŞăăăŞăĽăźă ă
ăăăžăăăçăăăŤćťčŞé ăăăăéĄăăăžăă
ăŞăăĺăăźă¸ă§ăłă¨ĺä¸ăŽçŽćăŞăŠăŻăĺćăĺé¤ăăăŚăăžăă
--
ç°ć ä¸ĺšł <ippei1@xxxxxxxxxxxx>
Debian Description Translation Project [DDTP]
ćĽćŹčŞăăźă ăłăźăăŁăăźăż
http://www.debian.or.jp/devel/doc/Description-ja.html
<!doctype debiandoc system>
<debiandoc>
<book>
<title>APT HOWTO</title>
<author>
<name>Gustavo Noronha Silva</name> <email>kov@debian.org</email>
</author>
<version>2.0.0 - 2005 ĺš´ 9 ć</version>
<abstract>
ăăŽćć¸ăŻăDebian ăŽăăăąăźă¸çŽĄçăŚăźăăŁăŞăăŁă§ăă APT ăŽĺăăŤă¤ăăŚă
ăŚăźăśăŤćˇąăç解ăăŚăăăăă¨ăćĺłăăŚăăžăăăăŽçŽçăŻăć°ăă Debian
ăŚăźăśăŽçć´ťă漽ăŤăăăăăˇăšăă 玥çăŤă¤ăăŚç解ă桹ăăăă¨éĄăäşşăŽćĺŠăă¨
ăŞăăă¨ă§ăăDebian ăŚăźăśăĺžăăăăľăăźăăćšĺăăçŽçă§ăDebian ăă
ă¸ă§ăŻăăŽăăăŤä˝ćăăăžăăă
</abstract>
<copyright>
<copyrightsummary>
Copyright © 2001, 2002, 2003, 2004, 2005 Gustavo Noronha Silva
</copyrightsummary>
<p>
This manual is free software; you may redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
</p>
<p>
This is distributed in the hope that it will be useful, but without
any warranty; without even the implied warranty of merchantability or
fitness for a particular purpose. See the GNU General Public License
for more details.
</p>
<p>
A copy of the GNU General Public License is available as
/usr/share/common-licenses/GPL in the Debian GNU/Linux distribution or
on the World Wide Web at the GNU General Public Licence. You can also
obtain it by writing to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
</p>
</copyright>
<toc>
<chapt>ăŻăăăŤ
<p>
ĺă㍠.tar.gz ăăăăăŚăźăśăăĄăŻăčŞĺ㎠GNU/Linux ăˇăšăă ă§ä˝żăăă
ăăă°ăŠă ăă¨ăŤăłăłăă¤ăŤăăŞăăă°ăŞăăžăăă§ăăăDebian ăä˝ăăăćă
ăăˇăłăŤă¤ăłăšăăźăŤăăăăăăąăźă¸ăŽçŽĄçćŠč˝ăĺăăăˇăšăă ăĺż
čŚă ă¨
čăăăăžăăă<prgn>dpkg</prgn> ă¨ăăăŽăăăăŽăˇăšăă ăŤä¸ăăăăĺĺă§ăă
ćĺ㪠'ăăăąăźă¸' ă¨ăăăăŽăŻăăăă㌠Debian ăŤĺăăŚăăăăăăăŽă§ăă
ăă㯠Red Hat ăăçŹčŞăŽ rpm ăˇăšăă ăä˝ăăă¨ćąşćăăĺ°ăĺăŽăă¨ă§ăăă
<p>
ăăăŤć°ăăŞă¸ăŹăłăăăGNU/Linux 製ä˝č
ăăĄăŽĺżä¸ăŤçăžăăžăăă
彟ăăĺż
čŚă¨ăăŚăăăŽăŻăăăăąăźă¸éăŽäžĺé˘äżăčŞĺçăŤçŽĄçăă
ă˘ăăă°ăŹăźăä¸ă§ăč¨ĺŽăăĄă¤ăŤăŤćł¨ćăćăŁăŚăăăăéŤéă§ăĺŽç¨çăŞă
ĺšçăŽéŤăćšćłă ăŁăăŽă§ăăăăă§ăăžăăDebian ăéăĺăéă㌠APT
- Advanced Packaging Tool - ăçŁăżĺşăăžăăăAPT ăŻăăăă Conectiva ăŤăăŁăŚ
rpm ă§ă使ăăăă秝ć¤ăăăăă䝼ĺ¤ăŽăăŁăšăăŞăăĽăźăˇă§ăłăŤăéŠĺăăăăăŤ
ăŞăăžăăă
<p>
ćŹăăăĽă˘ăŤă§ăŻăConectiva ăŤăă APT ăŽç§ťć¤ă§ăă apt-rpm ăŤăŻč§Śăăžăăă
ăăăăăŽçŽçăŽăăăŽćŹćć¸ă¸ăŽ "ăăă" ăŻćčżăăžăă
<p>
ćŹăăăĽă˘ăŤăŻă2005 ĺš´ 8 ć 31 ćĽçžĺ¨ăŽćŹĄć Debian ăŞăŞăźăšă§ăă <tt>Etch</tt> ăŤ
ĺşăĽăăŚăăžăă
</p>
<sect id="terminology">ĺşćŹç¨čŞă¨ćŚĺżľ
<p>
䝼ä¸ăŤćăăăŽăŻăćŹăăăĽă˘ăŤă§çŽăŤăăăă¨ăŤăŞăăăă¤ăăŽĺşćŹç¨čŞă¨ćŚĺżľă§ăă
<p>
<strong>APT ă˝ăźăš</strong>: APT ă˝ăźăšăŻăDebian ăăăąăźă¸ăŽăŞăă¸ăăŞă¨ăăŚ
ćŠč˝ăăĺ ´ć (é常ă¤ăłăżăźăăăăăăă㯠CD-ROM ăăŽäť) ă§ăă<ref id="sources.list"> ăĺç
§ă
</p>
<p>
<strong>APT ă˝ăźăščĄ</strong>: APT ă˝ăźăščĄ (ă˝ăźăšăŠă¤ăł) ăŻăĺŠç¨ăăă "APT ă˝ăźăš" ă
APT ăŤäźăăăăăŤăč¨ĺŽăăĄă¤ăŤăŤčż˝ĺ ăăčĄă§ăă<ref id="sources.list"> ăĺç
§ă
<p>
<strong>ăă¤ăăŞăăăąăźă¸</strong>: ăă¤ăăŞăăăąăźă¸ăŻăăăăąăźă¸ăăăźă¸ăŁ (dpkg) ăŤ
ăăŁăŚă¤ăłăšăăźăŤăăăăăç¨ćăăăŚăă <tt>.deb</tt> ăăĄă¤ăŤă§ăăăăăŚăăŻăă¤ăăŞ
ăăĄă¤ăŤăĺŤăă§ăăžăăăă˘ăźăăăŻăăŁéäžĺăŽăăźăżă ăăćă¤ăă¨ăăăăžăââăăăăŤ
ăăăăăăŻăă¤ăăŞăăăąăźă¸ă¨ĺźă°ăăžăă
<p>
<strong>Debian ăă¤ăăŁă</strong>: Debian ăŽăăăŤçšĺĽăŤä˝ćăăăăăăąăźă¸ă§ăăăăŽç¨ŽăŽ
ăăăąăźă¸ăŻé常ăăŞăŞă¸ăăŤă˝ăźăšăŤ Debian ăłăłăăăźăŤăăĄă¤ăŤăĺŤăă§ăăăăăăąăźă¸ăŽ
ĺć°ăăźă¸ă§ăłăŻăăŞăŞă¸ăăŤăŽăăă°ăŠă ăžăăŻăăźăżăŽć°ăăźă¸ă§ăłă§ăăăăžăă
</p>
<p>
<strong>Debian ĺ (debianize)</strong>: "Debian ă§ĺŠç¨ă§ăăăăćşĺăă"ăăăăăŻăăĺç´ăŤ
<tt>.deb</tt> ăăŠăźăăăăŤăăăąăźă¸ĺăăă¨ăăćĺłă§ä˝żăăăĺčŠă§ăă
<p>
<strong>ă˝ăźăšăăăąăźă¸</strong>: ă˝ăźăšăăăąăźă¸ăŻăĺŽéăŽă¨ăăădeb ă˝ăźăšăăŠăźăăăă
形ćăă 2ă3 ĺăŽăăĄă¤ăŤăŽăťăăăćăć˝čąĄçăŞĺŽçžŠă§ăă<tt>.dsc</tt> ăăĄă¤ăŤăŻăăăąăźă¸ăŤ
ă¤ăăŚăŽć
ĺ ąăć źç´ăăžăă<tt>.orig.tar.gz</tt> ăăĄă¤ăŤăŻăăăąăźă¸ăŽăŞăŞă¸ăăŤă˘ăăăšăăŞăźă
ăŽă˝ăźăšăć źç´ăăžăă.orig ăŽăŞăă<tt>.tar.gz</tt> ă¨ăăă ăăŽĺĺăŽăăĄă¤ăŤăčŚăăăăă¨ă
ăăăăăăăžăăăăăăŻăDebian ăă¤ăăŁăăăăąăźă¸ă§ăă<tt>.diff.gz</tt> ăăĄă¤ăŤăŻă
ăăăąăźă¸ă¨ă㌠"Debian ĺ" ăăéăăŞăŞă¸ăăŤă˝ăźăšăŤĺŻžăăŚčĄăăăĺ¤ć´ăćşăăŚăăžăăDebian
ăă¤ăăŁăăăăąăźă¸ă§ăŻăăŽç¨ŽăŽăăĄă¤ăŤăčŚă¤ăăăŞăăŻăă§ăă
<p>
<strong>ă˘ăăăšăăŞăźă </strong>: ăăŽĺčŞăŻăé常ăă˝ăăăŚă§ă˘ăăăăŻăăźăżăŽăŞăŞă¸ăăŤăŽ
éçşč
ăăćäžăăăä˝ăăăăăăŻéçşč
čŞčşŤăćĺłăăžăă
<p>
<strong>䝎ćłăăăąăźă¸</strong>: 䝎ćłăăăąăźă¸ăŻăĺŽéăŤăŻĺĺ¨ăăŞăăăăŠăăăăă¤ăăŽçšĺŽăŽ
ăăăąăźă¸ă§ "ćäž (provided)" ăăăä¸čŹçăŞăľăźăăšă¨ăŞăăăăąăźă¸ă§ăă-- ćă躍čżăŞäžăŻă
MTA<footnote>MTA 㯠Mail Transport Agent -- é常ăăĄăźăŤăéĺ俥ăăăľăźăă§ăă</footnote> ă
ĺż
čŚă¨ăăăăăąăźă¸ăŤĺŻžăăăŚăźăśăĺŠç¨ăăăă¨é¸ăă MTA ăäżćăă¤ă¤äžĺé˘äżăćşăăăŚăăă
<package>mail-transport-agent</package> ăăăąăźă¸ă§ăă
</sect>
</chapt>
<chapt id="archive-layout">Debian ă˘ăźăŤă¤ăăŽćŚčŚ
<sect id="archive:suites">Debian ăšă¤ăźăăŽćŚčŚ
<p>
Debian ăŽéçşăŻă"ăšă¤ăźă" ă¨ĺźăă§ăăă3ă¤ăŽăĄă¤ăł "ăăŞăź" ăćă¤ă˘ăăŤă§ă§ăăŚăăžăă
ĺŽĺŽç (stable) ăšă¤ăźăăŻăDebian ăŽćć°ăŞăŞăźăšăăźă¸ă§ăłă§ăăăăšăç (testing) ăšă¤ăźă
ăŻăçčŤä¸ăŻă常ăŤăŞăŞăźăšćşĺăŽă§ăăŚăăăăăźă¸ă§ăłă§ăăăăąăźă¸ăŻä¸ĺŽĺŽçăăŠăłăăăă
ăăšăŚăŽă˘ăźăăăŻăăŁă§ć§çŻăăč´ĺ˝çăŞĺéĄăŽĺ ąĺăŞă 10 ćĽéçľéăăăăŽăĺ
Ľăăžăă
ä¸ĺŽĺŽç (unstable) ăšă¤ăźăăŻăéçşăŽčĄăŞăăăĺ ´ćă§ăăăăšăŚăŽć°ăăăăăąăźă¸ăŻăăŞăŞăźăš
ĺŻč˝ăăŠăăăăšăăăăăăăŤä¸ĺŽĺŽçăŤĺ
ĽăăćçľçăŤăăšăçăŤĺăăăžăă
</p>
<p>
ĺŽĺŽçăšă¤ăźăăŻăăăăąăźă¸ăŽć°ăăăăźă¸ă§ăłăĺ厚ăăăă¨ăŻćąşăăŚăăăžăăă
ăťăăĽăŞăăŁăžăăŻč´ĺ˝çăŞĺéĄă俎ćŁăăć°ăăăŞăă¸ă§ăłă ăăĺăĺăăăžăă
ĺŽĺŽçăŻăĺŽĺŽă§ăăçśăăăă¨ăă¤ăžăč¨ĺŽă玥çăăŚăăă˝ăăăŚă§ă˘ăŽćŻčăă
ĺ¤ăăăă¨ă玥çč
ăŻćĺž
ăăŚăăŞăă¨ăăăă¨ă§ăă
</p>
<p>
ĺ¤ăăŽăăźăŤă§é常ăŽăăŽă¨ăŻăžăŁăăç°ăŞăćąăăăăăăă1ă¤ăŽăšă¤ăźăăăăăžăă
ăăŞăăĄăexperimental ăšă¤ăźăă§ăă
ăžă珏ä¸ăŤăexperimental ăŻčŞĺˇąĺ
čśłăăăšă¤ăźăă§ăŻăăăžăăăă¤ăžăăăăăăĺç´ăŤ
ă¤ăłăšăăźăŤăăăăˇăšăă ăĺžăăă¨ăŻă§ăăăé常ăŻĺčż°ăăăăĄăŽăŠăăăŽăšă¤ăźăă¨
ă¨ăăŤä˝żăĺż
čŚăăăă¨ăăăă¨ă§ăăăăăŚăăŽĺ ´ĺăŻăä¸ĺŽĺŽçăé¸ćč˘ă¨ăŞăăžăă
</p>
<p>
ĺŽéăŤĺăšă¤ăźăăŽăăĄă§ă漾ăăŚĺŽé¨çăŞăŽă§ăç°ăŞăćąăăăŞăăăžăă
ăĄăłăăăä¸ĺŽĺŽçăŤĺ
ĽăăăŤăŻĺŁăăŚăăăžăăŻćşĺä¸čśłă¨ćăŁăăăăąăźă¸ăă
ćăçŠçĽăăăŽăĄăłăăăŤăăŁăŚĺşăăăšăăăăăă㍠experimental ăŤăăŁăŚăăžăă
ćŹĺ˝ăŤéçşăĺŠăăăă¨ćăŁăŚăăŚăăăăĺŠç¨ăăăă¨ăŤăă貏䝝ăčŞĺă§č˛ ăă
ă¨ăăăŽă§ăŞăăă°ăexperimental ă使ăăŞăă§ăă ăăă
</p>
</sect>
<sect id="archive:suites:sections">Debian ăťăŻăˇă§ăł
<p>
Debian ăŞăă¸ăăŞăŽĺăšă¤ăźăăŻăé常ă1ă¤äťĽä¸ăŽăťăŻăˇă§ăłă§ć§ćăăăŚăăžăă
ăăăăŽĺĺă¨çŽçăŻăé
ĺ¸č
ăŤăăŁăŚĺ塎ä¸ĺĽă§ăăDebian čŞčşŤăŻă3ă¤ăŽăťăŻăˇă§ăłă
ćăŁăŚăăžăămainăcontribănon-free ă§ăă
</p>
<p>
<tt>main</tt> ăťăŻăˇă§ăłăŻăĺ
ŹĺźăŞ Debian ă§ăă
<url
id="http://www.debian.org/social_contract#guidelines" name="Debian
ăăŞăźă˝ăăăŚă§ă˘ăŹă¤ăăŠă¤ăł"> (DFSG) ăŤćşć ăăă˝ăăăŚă§ă˘ă§ă
äžĺ寞蹥ă DFSG ăŤćşć ăăă˝ăăăŚă§ă˘ăŽăăŽăŽăżăă<url id="http://www.debian.org/social_contract"
name="礞äźčŚç´"> ăŤĺžăŁăŚă˘ăźăŤă¤ăăŽăăŽăťăŻăˇă§ăłăŤĺ
Ľăăžăă
ăăăăŽćć¸ăéăăŚămain ăťăŻăˇă§ăłăŤăŻăăăăŤĺžăŁăă˝ăăăŚă§ă˘ă ăă
訹ĺŻăăŚăăăă¨ă確ç´ăăăă¨ă§ăDebian ăŻăăŚăźăśă main ăăă˝ăăăŚă§ă˘ă
ă¤ăłăšăăźăŤăăă¨ăăŤäżĄé źăăăŤčśłăăčŞçąăŤă¤ăăŚăŽĺççă§ć確ăŞĺşç¤ć¨ćşăćäžăăžăă
</p>
<p>
<!-- The <tt>contrib</tt> section is composed of DFSG-compliant software
which depend on non-DFSG-compliant software or data to work. The
<tt>non-free</tt> section is composed of software which do not conform
to the DFSG but may be distributed. You should check the license of
each software from non-free you want to install to evaluate if they're
good enough for you to accept. -->
<!-- <tt>contrib</tt> ăťăŻăˇă§ăłăŻăDFSG ćşć ăŽă˝ăăăŚă§ă˘ăăćăăăŽă§ăăăĺä˝ăă
ä¸ă§é DFSG ćşć ăŽă˝ăăăŚă§ă˘ăžăăŻăăźăżăŤäžĺăăăăŽă§ăă<tt>non-free</tt>
ăťăŻăˇă§ăłăŻăDFSG ăŤćşć ăăŞăăăŽăŽăé
ĺ¸ăŻĺŻč˝ăŞă˝ăăăŚă§ă˘ăăćăăăŽă§ăă
non-free ăăă¤ăłăšăăźăŤăăă¨ăăŤăŻăăăăĺăĺ
ĽăăăŤĺĺă ă¨čŠäžĄăăăăăŤă
ĺă˝ăăăŚă§ă˘ăŽăŠă¤ăťăłăšă確čŞăăŚăă ăăă -->
</p>
</sect>
<sect id="trustchain">APT's chain of trust
<sect id="trustchain">APT ăŽäżĄé źăŽéŁé
<p>
APT comes equipped with a cryptographic chain-of-trust that extends
from the debian developers to the end users.
APT ăŻăDebian éçşč
ăăă¨ăłăăŚăźăśă¸ă¨ćĄăăćĺˇĺăăăäżĄé źăŽéŁéă
ĺăăŚăăžăă
<p>
The chain starts with the package maintainers who sign and upload
their packages. Each signature is checked against the packager's key
which was uploaded when they became an official Debian developer.
This key was itself verified personally by other Debian
developers.
ăăŽéŁéăŻăăăăąăźă¸ăŤç˝˛ĺăăŚă˘ăăăăźăăăăăăąăźă¸ăĄăłăăăă
ĺ§ăžăăžăăĺ署ĺăŻăăĄăłăăăĺ
ŹĺźăŽ Debian éçşč
ă¨ăŞăŁăéăŤă˘ăă
ăăźăăăăéľă¨ç
§ĺăăăžăăăăŽéľčŞä˝ăŻăäťăŽ Debian éçşč
ăŤăăŁăŚ
ç§çăŤčŞč¨źăăăŚăăžăă
<p>
Once the uploaded package is verified as having been signed by the
maintainer, an MD5 sum of the package is computed and put in the
Packages file. The MD5 sums of all of the packages files are then
computed and put into the Release file. The Release file is then
signed by the archive key which is created once a year and distributed
by the FTP server. This key is also on the Debian keyring.
ă˘ăăăăźăăăăăăăąăźă¸ăăĄăłăăăŤăă署ĺăăăăŚăăăă¨ă訟ć
ăăăă¨ăăăŽăăăąăźă¸ăŽ MD5 ăľă ĺ¤ăč¨çŽăăăPackages ăăĄă¤ăŤĺ
ăŤ
č¨čż°ăăăžăăĺ
¨ Packages ăăĄă¤ăŤăŽ MD5 ăľă ĺ¤ăč¨çŽăăăRelease
ăăĄă¤ăŤĺ
ăŤč¨čż°ăăăžăăăăăă Release ăăĄă¤ăŤăŻĺš´ăŤä¸ĺşŚä˝ćăăă
ă˘ăźăŤă¤ăéľăŤăăŁăŚç˝˛ĺăăăFTP ăľăźăăŤăăŁăŚé
ĺ¸ăăăžăăăăŽéľă
ăžăăDebian ăŽéľăŞăłă°ă§ăă
<p>
Therefore, the end user, having added the archive key to his keyring ,
can check that the <tt>Release</tt> file was signed by the proper key,
the MD5 sums of all the <tt>Packages</tt> files, and the MD5 sums of
all the Debian packages. APT automates this process:
ăăăăŁăŚă¨ăłăăŚăźăśăŻăčŞĺăŽéľăŞăłă°ăŤă˘ăźăŤă¤ăéľăčż˝ĺ ăăă°ă
<tt>Release</tt> ăăĄă¤ăŤăćŁăăéľă§ç˝˛ĺăăăŚăăăăŠăăăă
ĺ
¨ <tt>Packages</tt> ăăĄă¤ăŤăŽ MD5 ăľă ĺ¤ăĺ
¨ Debian ăăăąăźă¸ăŽ
MD5 ăľă ĺ¤ăăă§ăăŻăăăă¨ăă§ăăžăăAPT ăŻăăăŽĺŚçăčŞĺĺăăŚ
ăăăžă:
<p>
During update (see <ref id="update">), APT checks the signature of the
Release files by using its keyring (see <ref id="apt-key"> for
information on this) and the MD5 sums of the Packages files (which are
recorded in the Release files).
ć´ć° (<ref id="update"> ăĺç
§) ăŽéăAPT ăŻăăŽéľăŞăłă° (芳ăăć
ĺ ąăŻ
<ref id="apt-key"> ăĺç
§) ă使ăŁăŚăRelease ăăĄă¤ăŤăŽç˝˛ĺ㨠(Release
ăăĄă¤ăŤĺ
ăŤč¨é˛ăăăŚăă) PackagesăăĄă¤ăŤăŽ MD5 ăľă ĺ¤ăăă§ăăŻăăžăă
<p>
During upgrade or installation of a package (see <ref id="upgrade">
and <ref id="install"> respectively) APT checks the MD5 sums of the
packages (which are stored in the Packages files).
ăăăąăźă¸ăŽă˘ăăă°ăŹăźăăă¤ăłăšăăźăŤ (ăăăă <ref id="upgrade"> ă¨
<ref id="install"> ăĺç
§) ăŽéăAPT 㯠(Packages ăăĄă¤ăŤĺ
ăŤč¨é˛ăăăŚăă)
ăăăąăźă¸ăŽ MD5 ăľă ĺ¤ăăă§ăăŻăăžăă
<p>
If any of these steps fails, the user is warned, and the process
halts.
ăăăăŽăšăăăăŽăŠăăă§ĺ¤ąćăăă¨ăăŚăźăśăŤčŚĺăçşăăăăŚĺŚçăŻ
ĺć˘ăăžăă
</sect>
</chapt>
<chapt id="basico">ĺşćŹçăŞč¨ĺŽ
<sect id="sources.list">/etc/apt/sources.list ăăĄă¤ăŤ
<p>
APT ăŻćä˝ăŽä¸é¨ăŤăĺŠç¨ĺŻč˝ăŞăăăąăźă¸ăŽä¸čŚ§ă§ăă 'ă˝ăźăš' ăăĄă¤ăŤă
使ç¨ăăžăăăăŽăăĄă¤ăŤă <tt>/etc/apt/sources.list</tt> ă§ăă
<p>
ăăŽăăĄă¤ăŤăŤăŻé常ă䝼ä¸ăŽăăăŞă¨ăłăăŞăăăăžăă
<p>
<example>
deb http://host/debian distribution section1 section2 section3
deb-src http://host/debian distribution section1 section2 section3
</example>
<p>
ăăĄăăăä¸č¨ăŻćśçŠşăŽăăŽă§ăăŁăŚăăăŽăžăžă§ăŻä˝żăăžăăă
ĺčĄăŽĺé ăŤăă <tt>deb</tt> 㨠<tt>deb-src</tt> ăŻăă˘ăźăŤă¤ăăŽç¨ŽéĄă
示ăăŚăăžăăă¤ăžăăé常使ăăłăłăă¤ăŤć¸ăżăŽăăăąăźă¸ă§ăăăă¤ăăŞ
ăăăąăźă¸ (<tt>deb</tt>)ăăăăăăăŞăŞă¸ăăŤăŽăăă°ăŠă ă˝ăźăšă¨ Debian ăŽ
ăłăłăăăźăŤăăĄă¤ăŤ (<tt>.dsc</tt>) ăăăăłăăă°ăŠă ă 'Debian ĺ'
ăăăŽăŤĺż
čŚăŞĺ¤ć´çšăĺŤăă <tt>diff.gz</tt> ăăćăă˝ăźăšăăăąăźă¸
(<tt>deb-src</tt>) ă§ăă<ref id="sourcehandling"> ăĺç
§ăăŚăă ăăă
<p>
Debian ăŽăăăŠăŤă㎠sources.list ăŻé常ă䝼ä¸ăŽăăăŤăŞăŁăŚăăžăă
<p>
<example>
deb http://http.us.debian.org/debian stable main
deb http://security.debian.org stable/updates main
#deb-src http://http.us.debian.org/debian stable main
#deb-src http://security.debian.org stable/updates main
</example>
<p>
䝼ä¸ăŻ Debian ăŽĺşćŹă¤ăłăšăăźăŤăŤĺż
čŚăŞčĄă§ăăćĺ㎠<tt>deb</tt> čĄăŻă
ăŞăăŁăˇăŁăŤăŽă˘ăźăŤă¤ăă示ăăŚăăžăă2 čĄçŽăŻ Debian ăťăăĽăŞăăŁă˘ăă
ă°ăŹăźăăŽă˘ăźăŤă¤ăă§ăă
<p>
ćĺžăŽ 2 čĄăŻăłăĄăłăă˘ăŚăăă㌠('#' ă§ĺ§ăžăŁăŚ) ăăăŽă§ăAPT ăŻăăăăçĄčŚăăžăă
ăăă㯠<tt>deb-src</tt> čĄă§ăDebian ăŽă˝ăźăšăăăąăźă¸ăćăăŚăăžăă
ăăšăăĺăłăłăă¤ăŤçŽçă§ăăă°ăŠă ă˝ăźăšăé ťçšăŤăăŚăłăăźăăăăŽăŞăă
ăăăăŽčĄăŽăłăĄăłăăĺ¤ăăŚăă ăăă
<p>
<tt>/etc/apt/sources.list</tt> ăăĄă¤ăŤăŤăŻăĺ税ăŽčĄă桡ĺ¨ăăăăă¨ă
ă§ăăžăăAPT 㯠<tt>http</tt>ă<tt>ftp</tt>ă<tt>file</tt> (ăăźăŤăŤ
ăăĄă¤ăŤăăă¨ăă°ăăŚăłăăăă ISO9660 ăăĄă¤ăŤăˇăšăă ä¸ăŽăăŁăŹăŻăăŞ
ăŞăŠ)ă<tt>ssh</tt> ăŞăŠăç°ăŞă税éĄăŽă˘ăźăŤă¤ăăŤă寞ĺżă§ăăžăă
</sect>
<p>
Remember: everytime you want to add a source for APT to grab packages
from this is the file you're going to edit.
注ćďźăăăąăźă¸ăĺĺžăăăă㍠APT ç¨ăŽă˝ăźăšăčż˝ĺ ăăăă¨ăăŻă
ĺż
ăăăŽăăĄă¤ăŤă硨éăăŚăă ăăă
</p>
<p>
Do not forget to update the list of packages after modifying
the <tt>/etc/apt/sources.list</tt> file, see <ref id="update">. You
must do this to let APT know what packages are available from the
sources you specified.
<tt>/etc/apt/sources.list</tt> ă俎ćŁăăĺžăŻăăăăąăźă¸ä¸čŚ§ăć´ć°ăăăŽă
ĺżăăŞăă§ăă ăăă芳ăă㯠<ref id="update"> ăĺç
§ăăŚăă ăăăăăŞăă
ćĺŽăăă˝ăźăšăăĺ
ĽćĺŻč˝ăŞăăăąăźă¸ă APT ăŤçĽăăăăŽăŤăĺż
é ăŞĺŚçă§ăă
</p>
</sect>
<sect id="apt-key">Authenticating packages
<sect id="apt-key">ăăăąăźă¸ăŽčŞč¨ź
<p>
As of APT version 0.6, packages are authenticated to ensure that they
originate from the source that they claim to originate from. This is
an optional security feature. If the system can't authenticate the
package upon installation, it'll ask you whether or not you want to
abort the installation.
APT ăŽăăźă¸ă§ăł 0.6 䝼éă確ăăŞă˝ăźăšăăä˝ăăăăă¨ăäżč¨źăăăăăŤă
ăăăąăźă¸ăŻčŞč¨źăăăăăăŤăŞăăžăăăăăăŻăťăăĽăŞăăŁä¸ăŽčż˝ĺ ćŠč˝ă§ăă
ă¤ăłăšăăźăŤćăŤăˇăšăă ăăăăąăźă¸ăčŞč¨źă§ăăŞăăă°ăă¤ăłăšăăźăŤăä¸ć˘
ăăăăŠăăăĺ°ăăŚăăžăă
<p>
Since this authentication is based on cryptographic methods, APT
maintains it's own keyring. Each of the entries in your
<tt>sources.list</tt> file will have a corresponding key. However, if
you're using unofficial APT sources, it's possible that a source
you're using won't be authenticated. If this is the case, you should
encourage the maintainer of that source to implement authentication on
their site.
ăăŽčŞč¨źăŻćĺˇĺććłăĺ
ăŤăăŚăăăăăAPT ăŻĺ°ç¨ăŽéľăŞăłă°ăäżćăăŚ
ăăžăă<tt>sources.list</tt> ăăĄă¤ăŤĺ
ăŽĺă¨ăłăăŞăă¨ăŤă寞ĺżăăéľă
ćăŁăŚăăžăăăăăăŞăăăéĺ
ŹĺźăŞ APT ă˝ăźăšă使ăŁăŚăăăŽăŞăăăăă
čŞč¨źăăăŚăăŞăĺŻč˝ć§ăăăăžăăăăŽĺ ´ĺăĺ˝čŠ˛ă˝ăźăšăŽăĄăłăăăŤĺŻžăăŚ
彟ăăŽăľă¤ăăŤčŞč¨źăĺŽčŁ
ăăăăĺ§ăăăšăă§ăăăă
<p>
To take advantage of this security feature, you need to add a key to
APT's keyring for each authenticated source. This can be done with
GPG, but APT provides a tool, <prgn>apt-key</prgn>, which is a
simplified wrapper to GPG.
ăăŽăťăăĽăŞăăŁćŠč˝ăĺŠç¨ăăăŤăŻăčŞč¨źć¸ăżăŽă˝ăźăšăă¨ăŤéľă APT ăŽăăź
ăŞăłă°ăŤčż˝ĺ ăăĺż
čŚăăăăžăăGPG ă使ăă°ĺŻč˝ă§ăăăAPT 㯠<prgn>apt-key</prgn>
ă¨ăăăăźăŤăćäžăăŚăăžăăăă㯠GPG ăŤĺŻžăăăˇăłăăŤăŞăŠăăăźă§ăă
<p>
<prgn>apt-key</prgn> is easy to use. The tricky part of this process
is getting a key for each of your sources, and making sure that you
can trust that key.
<prgn>apt-key</prgn> ăŽä˝żăćšăŻç°Ąĺă§ăăćé ä¸ă§ćł¨ćăčŚăăçŽćăŻă
ĺă˝ăźăšç¨ăŽéľăĺ
Ľćăăăă¨ă¨ăăăŽéľăäżĄé źă§ăăăăŠăăă確čŞăă
ăă¨ă§ăă
</p>
<p>
Debian's archive key will be installed in
<file>/usr/share/apt/debian-archive.gpg</file>, so you can simply use
that file to add the official archives' key to your APT keyring by
doing this:
Debian ă˘ăźăŤă¤ăăŽéľăŻă<file>/usr/share/apt/debian-archive.gpg</file> ăŤ
ă¤ăłăšăăźăŤăăăžăăăăŁăŚăăŽăăĄă¤ăŤă使ăă°ă䝼ä¸ăŽăăăŤĺŽčĄăăă ă
㧠APT ăŽéľăŞăłă°ăŤĺ
Źĺźă˘ăźăŤă¤ăăŽéľăčż˝ĺ ă§ăăžă:
</p>
<p>
<example>
# apt-key add /usr/share/apt/debian-archive.gpg
</example>
</p>
<p>
For external, unofficial sources you'll need to find out where did
they provide their public key so that you can import it into your APT
keyring.
ăă䝼ĺ¤ăŽéĺ
ŹĺźăŞă˝ăźăšăŽĺ ´ĺăŻăAPT éľăŞăłă°ăŤă¤ăłăăźăă§ăăăăăŤă
ĺ˝čŠ˛ă˝ăźăšăćäžăăŚăăĺ
Źééľăć˘ăăŞăăă°ăŞăăŞăă§ăăăă
</p>
<p>
If you choose to disable the cryptographic checking of Release files
for some reason you can add the following to APT's configuration (see
<ref id="apt.conf">):
ä˝ăăăŽççąă§ Release ăăĄă¤ăŤăŽćĺˇăă§ăăŻăçĄĺšăŤăăăŤăŻăAPT ăŽč¨ĺŽăŤ
䝼ä¸ăŽč¨čż°ăčż˝ĺ ăăŚăă ăă (<ref id="apt.conf"> ăĺç
§):
</p>
<p>
<example>
APT::Get::AllowUnauthenticated "true";
</example>
</p>
</sect>
<sect id="cdrom">sources.list ăăĄă¤ăŤăŤ CD-ROM ăčż˝ĺ ăă
<p>
APT ă使ăŁăŚăăăąăźă¸ăă¤ăłăšăăźăŤăăăăăˇăšăă ăčŞĺçăŤă˘ăă
ă°ăŹăźăăăăŽăŤ CD-ROM ă使ăăăăŽăŞăăăăă <tt>sources.list</tt>
ăŤč¨čż°ăăăă¨ăă§ăăžăăăăŽăăăŤăŻă䝼ä¸ăŽäžăŽăăăŤ
<prgn>apt-cdrom</prgn> ăăă°ăŠă ă使ç¨ăăŚăă ăăă
<p>
<example>
# apt-cdrom add
</example>
<p>
ăăŠă¤ă㍠Debian ㎠CD-ROM ăĺ
ĽăăŚăăăŚăă ăăăăăă°ăŠă ăŻ
CD-ROM ăăăŚăłăăăćĺšăŞ Debian ㎠CD ă§ăăă°ăăăąăźă¸ăŤ
é˘ăăć
ĺ ąăć˘ăăžăăCD-ROM ăŽč¨ĺŽăăăĺ¤ăăŁăŚăăĺ ´ĺă§ăă䝼ä¸ăŽ
ăŞăăˇă§ăłă使ăăă¨ăă§ăăžăă
<p>
<example>
-h - ăăŤăă襨示
-d directory - CD-ROM ăŽăăŚăłăä˝ç˝Ž
-r - čŞčăăă CD-ROM ăŽĺĺĺ¤ć´
-m - ăăŚăłăăčĄăŞăăŞă
-f - éŤéă˘ăźăăpackage ăăĄă¤ăŤăŽăă§ăăŻăčĄăăŞă
-a - ĺłĺŻăšăăŁăłă˘ăźă
</example>
<p>
ăă¨ăă°ćŹĄăŽăăăŤ:
<p>
<example>
# apt-cdrom -d /home/kov/mycdrom add
</example>
<p>
sources.list ăŤčż˝ĺ ăăăă¨ăŞăăŤăCD-ROM ăčĺĽăăăăă¨ăă§ăăžăă
<p>
<example>
# apt-cdrom ident
</example>
<p>
ăăŽăăă°ăŠă 㯠CD-ROM ă <tt>/etc/fstab</tt> ĺ
ă§éŠĺăŤč¨ĺŽ
ăăăŚăăĺ ´ĺăŽăżĺä˝ăăăă¨ăŤćł¨ćăăŚăă ăăă
</sect>
</chapt>
<sect id="apt.conf">The APT configuration file
<sect id="apt.conf">APT č¨ĺŽăăĄă¤ăŤ
<p>
APT uses <file>/etc/apt/apt.conf</file> as its main configuration
file. Although, as you will find out, there's no file named like that
in a default install, you can safely create one and add your edits
there. If you prefer, there's a more modular way of handling
configuration: you can place individual files with whatever names you
choose into <file>/etc/apt/apt.conf.d/</file>.
APT ăŻă丝ăăč¨ĺŽăăĄă¤ăŤă¨ă㌠<file>/etc/apt/apt.conf</file> ă使ăăžăă
ă§ăăăć°ăĽăăŽăăăŤăăăăŠăŤăăŽă¤ăłăšăăźăŤćăŤăŻăăŽăăăŞăăĄă¤ăŤăŻ
ăŞăăĺŽĺ
¨ăŤä˝ćăăăłçˇ¨éăăăă¨ăă§ăăžăăćăăŞăăč¨ĺŽăčĄăŞăăŽăŤăă
ă˘ă¸ăĽăźăŤĺźăŞćšćłăćĄăăă¨ăă§ăăžă: äťťćăŽĺĺăäťăăĺĺĽăŽăăĄă¤ăŤă
<file>/etc/apt/apt.conf.d/</file> ĺ
ăŤé
罎ăăŚăă ăăă
<p>
Beware of two facts when you choose the modular way: some Debian
packages will drop their configuration stuff into that directory, so
you have to try to prevent name clashes by, for example, adding a
<tt>-local</tt> suffix to the name. Also, the configuration is read
ordered by the file name, so you can add a number at the very
beginning of your filename to position it on the sequence. For
example, you can name it <tt>00000myconf-local</tt> if you want to
make sure it will be the first configuration to be considered.
ă˘ă¸ăĽăźăŤĺźăŽćšćłăćĄăéăŻă2 ă¤ăŽäşćăŤćł¨ćăăŚăă ăă: ăžăăăăă¤ăăŽ
Debian ăăăąăźă¸ăŻăä¸č¨ăăŁăŹăŻăăŞĺ
ăŤčŞăăŽč¨ĺŽĺ
厚ăé
罎ăăăă¨ăăăăžăă
ăăŁăŚăăĄă¤ăŤĺ㍠<tt>-local</tt> ă¨ăăŁăćĽĺ°žčžăäťăăăŞăŠăăŚăĺĺăčĄçŞ
ăăăŽăéżăăŚăă ăăă揥ăŤăč¨ĺŽăŻăăĄă¤ăŤĺé ăŤčŞăżčžźăžăăžăăé çŞăćĺŽ
ăăăŤăŻăăăĄă¤ăŤĺăŽĺ
é ăŤć°ĺăčż˝ĺ ăăŚăă ăăăăă¨ăă°ăćĺăŤčŞăżčžźă
ă§ćŹ˛ăăč¨ĺŽăŻă<tt>00000myconf-local</tt> ă¨ăăŁăăăĄă¤ăŤĺăŤăăŚăă ăăă
<p>
To know the syntax and options accepted by those configuration files,
check out the <tt>apt.conf(5)</tt> manpage.
ăăăăŽč¨ĺŽăăĄă¤ăŤă§ä˝żç¨ă§ăăć§ćăăŞăăˇă§ăłăŻă<tt>apt.conf(5)</tt> ăŽ
man ăăźă¸ă調ăšăŚăă ăăă
</sect>
<sect id="apt:policy">Adjusting APT priority for packages
<sect id="apt:policy">ăăăąăźă¸ăŽ APT ĺŞĺ
庌ă調ć´ăă
<p>
APT uses a prioritization algorithm to decide what repository it
should grab a given package from. Here's a simple example:
ćĺŽăăăăăąăźă¸ăăŠăŽăŞăă¸ăăŞăăĺĺžăăăŽăăĺ¤ćăăăŽăŤă
APT ăŻĺŞĺ
庌ă˘ăŤă´ăŞăşă ă使ăŁăŚăăžăă䝼ä¸ăŻç°ĄĺăŞčŚćŹă§ă:
</p>
<p>
<example>
$ apt-cache policy apt-howto
apt-howto:
Installed: 1.8.10.3-1
Candidate: 1.8.11-1
Version table:
1.8.11-1 0
500 http://ftp.nl.debian.org sid/main Packages
*** 1.8.10.3-1 0
500 http://ftp.nl.debian.org sarge/main Packages
100 /var/lib/dpkg/status
</example>
</p>
<p>
I have two sources here: a sid and a sarge one, and that's all.
ăăă§ăŻ 2 ă¤ăŽă˝ăźăšăăăăžă: sid 㨠sarge ă ăă§ăă
</p>
<p>
The installed version is marked with <tt>***</tt>. We can see its
installed because of the mention of the
<file>/var/lib/dpkg/status</file> file, too, which holds the
information about the current state of the system. We can also see
that the package comes from sid. The sarge version is also listed as
available.
### 訳注ďźä¸č¨ăŽč¨čż°ăčŚćŹă¨ć´ĺć§ăĺăăŚăăŞă???
### ă¤ăłăšăăźăŤăăăŚăăăŽăŻ sarge çăŽăăăŤčŚăăă...
### apt-howto ăăăąăźă¸ăŤĺŻžă㌠BTS ć¸ #342600
ă¤ăłăšăăźăŤć¸ăżăăźă¸ă§ăłăŤăŻ <tt>***</tt> ă¨ăăăăźăŻăäťăăŚăăžăă
çžĺ¨ăŽăˇăšăă ăŽçść
ăŤé˘ăăć
ĺ ąăč¨é˛ăăŚăă <file>/var/lib/dpkg/status</file>
ăăĄă¤ăŤăŽč¨čż°ăŤăăŁăŚăăăăăă¤ăłăšăăźăŤć¸ăżă§ăăăă¨ăăăăăžăăăăăŤă
ĺ˝čŠ˛ăăăąăźă¸ă sid ăŽăăŽă§ăăăă¨ăăăăăžăăsarge çăĺŠç¨ĺŻč˝ă§ăăć¨ă
襨示ăăăŚăăžăă
</p>
<p>
APT gives priority 100 for installed packages, as we can see, and 500
for all other sources with a single exception: the
<tt>experimental</tt> suite, which, as we already said, is treated in
a special way by many tool. APT's algorithm will prefer to install
packages from sources with higher priority. If priorities are the
same, then it will prefer the highest version. You can see that by
looking at the <tt>Candidate</tt> field, which lists the newer
version, from unstable, as candidate for installation: it wants to
upgrade it.
ăăăăăŽă¨ăăăă¤ăłăšăăźăŤć¸ăżăăăąăźă¸ăŤĺŻžăăŚăAPT ăŻĺŞĺ
庌 100 ă
äťĺ ăăŚăăžăăăăŽäťăŽă˝ăźăšăŤĺŻžăăŚăŻăĺŻä¸ăŽäžĺ¤ăé¤ăăŚĺŞĺ
庌 500 ă
äťĺ ăăžă: ăăŽäžĺ¤ă¨ăŻ <tt>experimental</tt> ăšă¤ăźăă§ăăă§ăŤčż°ăšăăăăŤă
ĺ¤ăăŽăăźăŤă§çšĺĽćąăăăăŚăăžăăAPT ăŽă˘ăŤă´ăŞăşă ă§ăŻăĺŞĺ
庌ăŽéŤă
ă˝ăźăšăăăăăąăźă¸ăă¤ăłăšăăźăŤăăăăăŤĺŞăăžăăĺŞĺ
庌ăĺăăŞăă
ăăć°ăăăăźă¸ă§ăłăé¸ăłăžăă<tt>Candidate</tt> ăŽé
çŽăčŚăă°ăăăŽăă¨ă
ăăăăžăăä¸č¨ăŽčŚćŹă§ăŻăă¤ăłăšăăźăŤĺčŁă¨ăăŚä¸ĺŽĺŽçăŤăăć°ăăźă¸ă§ăłă
襨示ăăăŚăăžă: ă˘ăăă°ăŹăźăăăăăŞăă§ăăăă
</p>
<p>
If you want to have the sid source only to install selected packages
and don't want APT to automatically consider packages from that source
as candidates for upgrades, then you must tweak its priorities. You do
that using the <tt>Archive</tt> field of the <tt>Release</tt> file of
the source you want to give priority to. You can find that information
out by looking at the Release file which the update process
downloaded:
ćĺŽăăăăăąăźă¸ăŻ sid ă˝ăźăšă ăăăă¤ăłăšăăźăŤăăAPT ă sid ăŤăă
ăăăąăźă¸ăćŠć˘°çăŤă˘ăăă°ăŹăźăĺčŁă¨ăżăŞăăŞăăăăŤăăăăă°ăăăŽ
ĺŞĺ
庌ăŤćăĺ ăăĺż
čŚăăăăžăăĺŞĺ
庌ăäťĺ ăăăă˝ăźăšăŽ <tt>Release</tt>
ăăĄă¤ăŤĺ
ă§ă<tt>Archive</tt> é
çŽă使ăŁăŚăă ăăăć´ć°ĺŚçćăŤăăŚăłăăźă
ăăă Release ăăĄă¤ăŤăčŚăă°ăăăŽć
ĺ ąăĺžăăăžăă
</p>
<p>
<example>
# grep ^Archive /var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sarge_main_binary-i386_Release
Archive: stable
</example>
</p>
<p>
Notice that the filename changes depending on your source line. To
make APT keep your packages at the stable suite, then, you add a file
with the following contents to <file>/etc/apt/apt.conf.d/</file>:
ăăĄă¤ăŤĺăŻăă˝ăźăščĄăŤĺżăăŚĺ¤ăăăă¨ăŤćł¨ćăăŚăă ăăăăăăąăźă¸ă
ĺŽĺŽçăšă¤ăźăăŤäżă¤ăă APT ăč¨ĺŽăăăŤăŻă䝼ä¸ăŽĺ
厚ăĺăăăăĄă¤ăŤă
<file>/etc/apt/apt.conf.d/</file> ăŤčż˝ĺ ăăŚăă ăă:
</p>
<p>
<example>
APT::Default-Release "stable";
</example>
</p>
<p>
Then, APT policy will have changed:
ăăă¨ăAPT ăŽăăŞăˇăźăĺ¤ć´ăăăă§ăăă:
</p>
<p>
<example>
$ apt-cache policy apt-howto
apt-howto:
Installed: 1.8.10.3-1
Candidate: 1.8.10.3-1
Version table:
1.8.11-1 0
500 http://ftp.nl.debian.org sid/main Packages
*** 1.8.10.3-1 0
990 http://ftp.nl.debian.org sarge/main Packages
100 /var/lib/dpkg/status
</example>
</p>
<p>
APT will give priority 990 for its default source for any package,
the other sources remain just like before. Packages from other sources
which are installed will have their priority raised from 100 to
500. Why is APT not going to downgrade them? Because APT will only
consider a downgrade in case something is given a priority above
1000. That means, though, that APT will not automatically upgrade the
versions from the non-default sources unless the tool you're using
wants to try to help you there, which is the case for aptitude.
APT ăŻăăăăŠăŤăăŽă˝ăźăšăŤĺŻžăăŚăăăăăăăąăźă¸ç¨ăŤĺŞĺ
庌 990 ă
äťĺ ăăžăăăăŽäťăŽă˝ăźăšăŤĺŻžăăŚăŻăĺžćĽăŽçść
ăäżăĄăžăăäťăŽă˝ăźăšăă
ă¤ăłăšăăźăŤăăăăăăąăźă¸ăŻăăăŽĺŞĺ
庌ă 100 ăă 500 ăŤä¸ăăăžăă
ăŞă APT ăŻăăăăăăăŚăłă°ăŹăźăăăăă¨ăăŞăăŽă§ăăăă? ăăŽççąăŻă
APT 㯠1000 䝼ä¸ăŽĺŞĺ
庌ăä¸ăăăăĺ ´ĺăŽăżăăŚăłă°ăŹăźăăčăăăăă§ăă
ăăăăăŽăă¨ăŻă使ăŁăŚăăăăźăŤăćĺŠăăăăă¨ăăŚăăăŞăăăăă
APT ăŻčŞĺçăŤéăăăŠăŤăăŽă˝ăźăšăăăăźă¸ă§ăłăŽă˘ăăă°ăŹăźăăčĄăŞăăŞă
ăă¨ăćĺłăăžăăăă㯠aptitude ăŤăĺ˝ăŚăŻăžăăžăă
</p>
<p>
Defining priority for groups of packages based on many other criteria
is also possible by using the <file>/etc/apt/preferences</file>
configuration file. You can even convince APT to try to downgrade your
whole system, although that's not supported and should not be tried
by the faint of heart. You can have more information about that by
reading the <tt>apt_preferences(5)</tt> manpage..
äťăŽć§ă
ăŞĺşćşăĺ
ăŤăăä¸çž¤ăŽăăăąăźă¸ăŽĺŞĺ
庌ăĺŽăăăŽăă
<file>/etc/apt/preferences</file> č¨ĺŽăăĄă¤ăŤă使ăă°ĺŻč˝ă§ăă
APT ăŤĺŻžăăŚăăˇăšăă ĺ
¨ä˝ăăăŚăłă°ăŹăźăăăăăă¨ăăăă§ăăžăăă
ăăăŻăľăăźăăŽĺŻžčąĄĺ¤ă§ăăăčç
ăŞäşşă芌ăăšă§ăăŻăăăžăăă
ăă芳ăăć
ĺ ąăŻă<tt>apt_preferences(5)</tt> ㎠man ăăźă¸ăčŞăă§
ăă ăă...
</sect>
<sect id="proxy">Using APT through a proxy
<sect id="proxy">ăăăăˇçľçąă§ APT ă使ă
<p>
If you are using APT in a network in which all http and ftp
connections are made through a proxy, then you'll have to setup APT to
use that proxy. You can do this by editing the
<file>/etc/apt/apt.conf</file> configuration file or by placing a
configuration file inside the <file>/etc/apt/apt.conf.d/</file>
directory, which makes it is easier to organize the configuration
stuff (take a look at <ref id="apt.conf">).
ăăšăŚăŽ http ăăăł ftp ćĽçśăăăăăˇçľçąă¨ăŞăŁăŚăăăăăăŻăźăŻĺ
ă§
APT ă使ăŁăŚăăăŽăŞăăAPT ăăăŽăăăăˇă使ăăăč¨ĺŽăăĺż
čŚăăă
ă§ăăăăăăŽăăăŤăŻă<file>/etc/apt/apt.conf</file> č¨ĺŽăăĄă¤ăŤă硨é
ăăăă<file>/etc/apt/apt.conf.d/</file> ăăŁăŹăŻăăŞĺ
ăŤč¨ĺŽăăĄă¤ăŤă
é
罎ăăŚăă ăăăĺžč
ăŽćšăăĺč¨ĺŽé
çŽă厚ćăŤçľçšĺă§ăăžă
(<ref id="apt.conf"> ăĺç
§)ă
<p>
If that file does not exist, then create it and add lines like these:
č¨ĺŽç¨ăŽăăĄă¤ăŤăăŞăăă°ăăăăä˝ćăăŚäťĽä¸ăŽčĄăčż˝ĺ ăăŚăă ăă:
<p>
<example>
Acquire::http::proxy "http://<var>proxy</var>:<var>port</var>";
Acquire::ftp::proxy "http://<var>proxy</var>:<var>port</var>";
</example>
<p>
Replace <var>proxy</var> and <var>port</var> for those given by your
network administrator. You can also specify user and password if the
proxy requires like this:
<var>proxy</var> 㨠<var>port</var> ăŽçŽćăŻăăăăăŻăźăŻçŽĄçč
ăă
ćĺŽăăăĺ
厚ăŤç˝ŽăćăăŚăă ăăăăăăăˇăčŚćąăăăŞăă䝼ä¸ăŽăăăŤăăŚ
ăŚăźăśă¨ăăšăŻăźăăćĺŽăăăă¨ăă§ăăžă:
<p>
<example>
Acquire::http::proxy "http://<var>user</var>:<var>password</var>@<var>proxy</var>:<var>port</var>";
</example>
<p>
There are many other useful options you can set for APT on the
<file>/etc/apt/apt.conf</file> configuration file, see <ref
id="apt.conf">.
<file>/etc/apt/apt.conf</file> č¨ĺŽăăĄă¤ăŤă§ăŻăăăŽäťăŤăĺ¤ăăŽäžżĺŠăŞ
ăŞăăˇă§ăłăč¨ĺŽăăăă¨ăă§ăăžăă<ref id="apt.conf"> ăĺç
§ăăŚăă ăăă
</sect>
</chapt>
<chapt id="apt-get">ăăăąăźă¸ăŽçŽĄç
<sect id="aptitude">Using the Debian Package Manager: aptitude
<sect id="aptitude">Debian ăăăąăźă¸ăăăźă¸ăŁăŽä˝żç¨: aptitude
<p>
Debian has long lived with a package manager which was known to be
difficult to understand and use, called <prgn>dselect</prgn>. The
Debian system is now moving towards a new default manager
called <prgn>aptitude</prgn>, which is also based on the APT library.
Debian ăŻéˇăéă<prgn>dselect</prgn> ă¨ăăĺăŽăç解ă¨ä˝żç¨ăéŁăăăă¨
ă§çĽăăăăăăąăźă¸ăăăźă¸ăŁă¨ĺ
ąăŤćŠăă§ăăžăăăçžĺ¨ăŽ Debian ăˇăšăă
ăŻă<prgn>aptitude</prgn> ă¨ăăĺăŽć°čŚăăăŠăŤăăăăźă¸ăŁă¸ă¨ĺăăŁăŚ
ăăžăăăăăăžă APT ăŠă¤ăăŠăŞăĺ
ăŤăăŚăăžăă
<p>
If you installed Sarge you will have <prgn>aptitude</prgn> installed
by default on the base system, otherwise install
the <package>aptitude</package> package by running, for example, this
command before continuing:
Sarge ăă¤ăłăšăăźăŤăăŚăăăŞăă<prgn>aptitude</prgn> ăăăźăšăˇăšăă ăŽ
ăăăŠăŤăă¨ăăŚă¤ăłăšăăźăŤăăăŚăăă§ăăăăăăă§ăŞăăă°ăĺ
ăŤé˛ăĺăŤ
䝼ä¸ăŽăăăŞăłăăłăăĺŽčĄăăŚă<package>aptitude</package> ăăăąăźă¸ă
ă¤ăłăšăăźăŤăăŚăă ăăă
</p>
<p>
<example>
# apt-get install aptitude
</example>
<p>
Try to avoid using <prgn>apt-get</prgn> and use <prgn>aptitude</prgn>
instead, as it knows much more about what APT is able to do and have
some unique features like marking packages that were automatically
installed to satisfy dependencies and ask to remove them automatically
when they are no longer needed.
<prgn>apt-get</prgn> ă使ăăŽăć˘ăă䝣ăă㍠<prgn>aptitude</prgn> ă
使ăăăĺżăăăŚăă ăăăă¨ăăăŽă <prgn>aptitude</prgn> 㯠APT ăŤĺŻč˝
ăŞäşăŤé˘ăăăŻăăăŤĺ¤ăăŽçĽčăĺăăŚăăăăžăäžĺé˘äżăćşăăăăčŞĺ
çăŤă¤ăłăšăăźăŤăăăăăăăăąăźă¸ăŤăăźăŻăäťăăăăăăăä¸čŚăŤăŞăŁ
ăćăŤăŻčŞĺçăŤĺé¤ăăăăŠăăăĺ°ăăŚăăă¨ăăŁăăăăă¤ăăŽăŚăăźăŻ
ăŞćŠč˝ăĺăăŚăăăăă§ăă
<p>
<prgn>aptitude</prgn> has two main modes: a ncurses-based UI in which
you can navigate through a list of packages much
like <prgn>dselect</prgn> and a command line-based UI, much
like <prgn>apt-get</prgn>. Most examples in this document use the
command line-based UI, giving tips on which command is used to achieve
the same results in the <prgn>aptitude</prgn> dselect-like UI.
<prgn>aptitude</prgn> ăŤăŻ 2 ă¤ăŽăĄă¤ăłă˘ăźă - <prgn>dselect</prgn> ăŤ
ăăäźźăăăăąăźă¸ä¸čŚ§ĺ
ă渥ăćŠăăă¨ăă§ăă ncurses ăăźăšăŽ UI ă¨ă
<prgn>apt-get</prgn> ăŤăăäźźăăłăăłăŠă¤ăłăăźăšăŽ UI - ăăăăžăă
ćŹćć¸ĺ
ăŽĺ¤§ĺăŽäžăŻăłăăłăăŠă¤ăłăăźăšăŽ UI ă使ăŁăŚăăă
<prgn>aptitude</prgn> ㎠deselect 䟟㪠UI ă¨ĺć§ăŞçľćăĺžăăăăŤ
使ăăăăłăăłă㎠tips ăć示ăăžăă
<p>
To fire up this UI, type <tt>aptitude</tt> in a terminal -- there's no
need to be root at this time, aptitude will request root powers when
it needs them automatically. Let's check out the basics: to access the
menubar at the top of the screen you need to press F10, as the second
line suggests. This second line has a summary of the most commonly
used features like getting help, quitting, updating list of packages
and proceeding.
ă㎠UI ă辡ăĄä¸ăăăŤăŻă獯ćŤă§ <tt>aptitude</tt> ă¨ăżă¤ăăăŚăă ăă --
çžćçšă§ăŻ root ăŤăŞăĺż
čŚăŻăăăžăăăaptitude ăŻăroot 樊éăĺż
čŚăŞć
ăŤăŻčŞĺçăŤčŚćąăăŚăăžăă
<p>
Do take a look at the <tt>User Manual</tt> which is located at the help
menu to understand how the thing works.
ăŠăŽăăăŤĺä˝ăăăăŤă¤ăăŚç解ăăăŤăŻăăăŤăăĄăăĽăźăŤăă
<tt>User Manual</tt> ăĺç
§ăăăăăŤăăŚăă ăăă
<p>
Notice that <prgn>aptitude</prgn> works in a way similar to other
package managers: you make all your selections and
then <tt>commits</tt> the changes. Almost all actions done in managing
the installation of a package will require pressing the <tt>g</tt> key
two times to be effective. The first time you press <tt>g</tt> you'll
be presented with the list of changes being done, then you
press <tt>g</tt> again to confirm the changes or <tt>q</tt> to go
back.
<prgn>aptitude</prgn> ăŻăäťăŽăăăąăźă¸ăăăźă¸ăŁă¨äźźăĺä˝ăăăăă¨ăŤ
注ćăăŚăă ăă: ăăšăŚăŽé¸ćăčŞĺă§čĄăŞăăăăăăĺ¤ć´ă<tt>ăłăăă</tt>
ăăžăăăăăąăźă¸ăŽă¤ăłăšăăźăŤçŽĄçćăŤčĄăŞăăăăťăźăăšăŚăŽă˘ăŻăˇă§ăłăŻă
ĺŽéăŤĺšĺăçşćŽăăăăŽăŤ <tt>g</tt> ăăźă 2 ĺćźăĺż
čŚăăăă§ăăăă
ćĺ㍠<tt>g</tt> ăćźăăă¨ăăŻăĺŽčĄăăăăă¨ăăŚăăĺ¤ć´ăŽä¸čŚ§ă襨示
ăăăžăăăăăăĺ¤ć´ăćżčŞăăăăăŤăă 1 ĺ <tt>g</tt> ăćźăăă
ăăăăŻĺ
ăŤćťăăă㍠<tt>q</tt> ăćźăăžăă
<p>
Similarly, you can press the <tt>Enter</tt> key to get more details
about a package or group of packages -- for example, you can
press <tt>Enter</tt> when the selection is on 'New Packages' to see
the a list of sections. By pressing <tt>Enter</tt> on a section you
will see the list of new packages in that section and you can see more
details on a package by pressing <tt>Enter</tt> on it. Notice that
entering a package's details will change <prgn>aptitude</prgn>'s view
context, so you'll need to press <tt>q</tt> to go back.
ĺć§ăŤă<tt>Enter</tt> ăăźăćźăă°ĺä˝ăŽăăăąăźă¸ăăăăąăźă¸ăŽă°ăŤăźă
ăŤé˘ăă芳細ăĺžăăă¨ăă§ăăžă -- ăă¨ăă°ăé¸ćă 'New Packages' ăŤăă
ă¨ă㍠<tt>Enter</tt> ăćźăă°ăăťăŻăˇă§ăłăŽä¸čŚ§ăčŚăăă¨ăă§ăăžăă
ăăăťăŻăˇă§ăłăŽä¸ă§ <tt>Enter</tt> ăćźăă°ăăăŽăťăŻăˇă§ăłĺ
ăŽć°ăă
ăąăźă¸ä¸čŚ§ăčŚăăă¨ăă§ăăăăăŤăăăăăąăźă¸ăŽä¸ă§ <tt>Enter</tt> ă
ćźăă°ăăăŽăăăąăźă¸ăŽčŠłç´°ăčŚăăă¨ăă§ăăžăăăăăąăźă¸ăŽčŠłç´°čĄ¨ç¤şćăŤ
<tt>Enter</tt> ăćźă㨠<prgn>aptitude</prgn> ăŽčĄ¨ç¤şĺ
厚ăĺ¤ăăŁăŚăăžă
ăŽă§ăćťăăŤăŻ <tt>q</tt> ăćźăăŞăăă°ăŞăăŞăăă¨ăŤćł¨ćăăŚăă ăăă
<p>
The packages are categorized by default based on their installation
status and some other special categories. You'll be seeing this when
you first enter <prgn>aptitude</prgn>
ăăăŠăŤăă§ăŻăăăăąăźă¸ăŻă¤ăłăšăăźăŤçść
ă¨ăăŽäťăŽçšĺĽăŞăŤăă´ăŞă§
ĺéĄăăăŚăăžăă<prgn>aptitude</prgn> ă¨ăłăăłăĺ
ĽĺăăŚčľˇĺăăéăŤă
ćĺăŤăăă襨示ăăăžăă
<p>
<example>
--- New Packages
--- Upgradable Packages
--- Installed Packages
--- Not Installed Packages
--- Obsolete and Locally Created Packages
--- Virtual Packages
--- Tasks
</example>
<p>
New Packages has the packages that entered Debian since the last time
you cleared your list of new packages using the <tt>Forget new packages</tt>
option in the Actions menu, or the "<tt>f</tt>" key.
New Packages ă¨ăŻăAction ăĄăăĽăźĺ
㎠<tt>Forget new packages</tt> ăŞă
ăˇă§ăłă使ăăă"<tt>f</tt>" ăăźă使ăŁăŚćĺžăŤć°čŚăăăąăźă¸ä¸čŚ§ăăŻăŞă˘
ăăŚäťĽéăDebian ăŤĺé˛ăăăăăăąăźă¸ăŽăă¨ă§ăă
<p>
Upgradable Packages are installed packages that have new versions
available. Installed Packages are the installed packages proper, Not
Installed Packages are the ones you did not install but are available
from one of the APT sources. Obsolete and Locally Created Packages are
those packages that are no longer available from at least one APT
source or the ones you created yourself. Virtual Packages are packages
defining a service rather than a particular software and that are
"provided" by several specific packages. Finally, Tasks are the collections
of packages which serve a specific purpose, also used by the
<prgn>tasksel</prgn> program.
Upgradable Packages ăŻăă¤ăłăšăăźăŤć¸ăżă§ăŞăăă¤ć°ăăźă¸ă§ăłăĺ
ĽćĺŻč˝ăŞ
ăăăąăźă¸ă§ăăInstalled Packages ăŻćŁăăă¤ăłăšăăźăŤć¸ăżăŞăăăąăźă¸ă§ă
Not Installed Packages ăŻćŞă¤ăłăšăăźăŤă ă APT ă˝ăźăšăŽ 1 ă¤ăăĺ
ĽćĺŻč˝
ăŞăăăąăźă¸ă§ăăObsolete and Locally Created Packages ăŻĺ°ăŞăă¨ă 1 ă¤
㎠APT ă˝ăźăšăăĺ
Ľćăă§ăăŞăăăăąăźă¸ăăčŞä˝ăăăăăąăźă¸ă§ăă
Virtual Packages ăŻçšĺŽăŽă˝ăăăŚă§ă˘ă¨ăăăăăŻăľăźăăšĺ
厚ăĺŽçžŠăăŚ
ăăăč¤ć°ăŽçšĺŽăăăąăźă¸ăŤăăŁăŚ "ćäžăăă" ăăăąăźă¸ă§ăăćĺžăŤă
Tasks ăŻçšĺŽăŽçŽçăŤä˝żăăăăăăąăźă¸éă§ă<prgn>tasksel</prgn> ăŤăăŁăŚă
使ăăăžăă
<p>
Pressing <tt>Enter</tt> on any of those will expand the tree to something
like this:
䝼ä¸ăŽăăăăăŽä¸ă§ <tt>Enter</tt> ăćźăă°ă揥ăŽăăăŞăăŞăźăŤĺąé
ăăăžă:
<p>
<example>
--\ Not Installed Packages
--- admin - Administrative utilities (install software, manage users, etc)
--- base - The Debian base system
[...]
</example>
<p>
Going even deeper we'll have:
ăăăŤćˇąăć˝ăă¨ă揥ăŽăăăŤăŞăăžă:
<p>
<example>
--\ games - Games, toys, and fun programs
--- contrib - Programs which depend on software not in Debian
--\ main - The main Debian archive
p 3dchess <none> 0.8.1-10
</example>
<p>
This shows us one package which is a not installed one, that is a game
and that is available from the main Debian repository, which is what
the Debian distribution is officially.
ä¸č¨ăŽäžă§ăŻăćŞă¤ăłăšăăźăŤăŞăăăąăźă¸ă 1 ă¤čĄ¨ç¤şăăăŚăăžăă
ăăăŻă˛ăźă ă§ăăăĺ
ŹĺźăŞ Debian ăăŁăšăăŞăăĽăźăˇă§ăłă§ăă main
Debian ăŞăă¸ăăŞăăĺ
ĽćĺŻč˝ăŞăă¨ăăăăăžăă
<p>
On the center of the screen there's a marked line that is filled with
some text when you select a package. That is what we call the <tt>short
description</tt> of the package. Below it there's a text box containing
more detailed information on the package. That's the <tt>long
description</tt>. Some times the long description is too big to fit
the rectangle reserved for it, so you can press the "<tt>z</tt>"
key to scroll it down and "<tt>a</tt>" to scroll it up again.
ăăăăăąăźă¸ăé¸ćăăă¨ăăšăŻăŞăźăłăŽä¸ĺ¤ŽăŤăăă¤ăăŽćçŤ ăăăŞă
ăăźăŻäťăăŽčĄăçžăăăžăăăăăŻăăăąăźă¸ăŽ<tt>çă誏ć (short description)</tt>
ă¨ĺźă°ăăăăŽă§ăăăăŽä¸ăŤăŻăăăšăăăăŻăšăăăăăăăąăźă¸ăŤé˘ăă
ăă芳ăăć
ĺ ąăč¨ăăăŚăăžăăăă㯠<tt>éˇă誏ć (long description)</tt> ă¨
ĺźă°ăăžăăéˇă誏ćăŻă大ăăăăŚăăăŻăšĺ
ăŤĺăžăăŞăăă¨ăăăăžăă
ăăŽé㯠"<tt>z</tt>" ăăźăćźăăŚĺ
ăŤé˛ăă ăă"<tt>a</tt>" ăăźă§ĺžćťă
ăăăă¨ăă§ăăžăă
<p>
Check <ref id="install"> for more information on the data shown here.
ăăă§čĄ¨ç¤şăăăăăźăżăŤé˘ăăăă芳ăăć
ĺ ąăŻă<ref id="install"> ă
ĺç
§ăăŚăă ăăă
</sect>
<sect id="update">ĺŠç¨ĺŻč˝ăŞăăăąăźă¸ăŽä¸čŚ§ăć´ć°ăă
<p>
ăŠăŽăăăąăźă¸ăă¤ăłăšăăźăŤć¸ăżă§ăăŠăăćŞă¤ăłăšăăźăŤăăăŠăŽăăăąăźă¸ă
ă¤ăłăšăăźăŤĺŻč˝ăăŤă¤ăăŚăŽč¨é˛ç¨ăŤăăăăąăźă¸ăˇăšăă ăŻăăŠă¤ăăźăăŞ
ăăźăżăăźăšă使ç¨ăăžăă<prgn>apt-get</prgn> ăăă°ăŠă ăŻăăŚăźăśă
ă¤ăłăšăăźăŤăčŚćąăăăăăąăźă¸ăčŚă¤ăăăăăăŽăăăąăźă¸ăéŠĺăŤĺä˝
ăăăăăŤĺż
čŚăŞčż˝ĺ ăăăąăźă¸ăčŚă¤ăăăŽăŤăăăŽăăźăżăăźăšă使ăăžăă
<p>
ăăŽăăźăżăăźăšăć´ć°ăăăŤăŻă<prgn>apt-get update</prgn> ă¨ăăăłăăłă
ă使ăăžăăăăŽăłăăłă㯠<tt>/etc/apt/sources.list</tt> ăŤč¨čż°ăăăŚăă
ă˘ăźăŤă¤ăĺ
ăŽăăăąăźă¸ä¸čŚ§ăć˘ăăžăăăăŽăăĄă¤ăŤăŤé˘ăă芳ăăć
ĺ ąăŻ
<ref id="sources.list"> ăĺç
§ăăŚăă ăăăaptitude ㎠ncurses ă¤ăłăżăź
ăă§ă¤ăšă§ăăăąăźă¸ä¸čŚ§ăć´ć°ăăăŤăŻă"<tt>u</tt>" ăăźă使ăăă¨ăă§ă
ăžăă
<p>
One of the steps that APT takes in updating your database is to verify
that the list of packages and their MD5 sums is secure. It does this
by verifying a cryptographic signature, and checking some MD5 sums;
see <ref id="trustchain"> for more information. If APT finds that the
signature is incorrect, or that the MD5 sums do not match, you may get
an error while updating your package database. This is to prevent
trojaned packages from being installed on your computer. If this
occurs, there may be a configuration problem (such as an out-of-date
key) which you can solve. Failing this, you should contact the
administrator of the apt source that failed.
APT ăăăźăżăăźăšăć´ć°ăăéăŽĺŚç㎠1 ă¤ăŤăăăăąăźă¸ä¸čŚ§ă¨ăăŽ
MD5 ăľă ĺ¤ăĺŽĺ
¨ăăŠăăăŽç˘şčŞăăăăžăăăăăŻćĺˇĺ署ĺă¨ăăă¤ăăŽ
MD5 ăľă ĺ¤ă確čŞăăăă¨ăŤăăčĄăŞăăăžăă署ĺăćŁăăăŞăăŁăăă
MD5 ăľă ĺ¤ăä¸č´ăăŞăăă¨ăŤ APT ăć°ăĽăă¨ăăăăąăźă¸ăăźăżăăźăšăŽ
ć´ć°ä¸ăŤă¨ăŠăźčĄ¨ç¤şăăăăžăăăăăŻăăăŞăăŽăłăłăăĽăźăżăŤăăă¤ăŽ
ć¨éŚŹăăăąăźă¸ăă¤ăłăšăăźăŤăăăăŽăé˛ăăăăŽćŞç˝Žă§ăăăăŽă¨ăŠăź
ăçşçćăŤăŻă解湺ĺŻč˝ăŞč¨ĺŽăăŠă㍠(ć䝣é
ăăŽéľăŞăŠ) ăĺĺ ăă
ăăăžăăăăăăŤă夹ćăăăŞăăĺéĄă¨ăŞăŁăŚăă APT ă˝ăźăšăŽçŽĄçč
ăŤéŁçľĄăăšăă§ăă
<p>
ĺŻč˝ăŞăăăąăźă¸ć´ć°ăŤă¤ăăŚăŽć
ĺ ąăćć°ăŤäżă¤ăăăŤăăăŽăłăăłăă
ĺŽćçăŤĺŽčĄăăăŽăŻčŻăă˘ă¤ăă˘ă§ăăăťăăĽăŞăăŁé˘éŁăŽă˘ăăăăźăăŻ
ăŞăăăă§ăă
</sect>
<sect id="searching">Searching for packages
<sect id="searching">ăăăąăźă¸ăŽć¤ç´˘
<p>
Aptitude provides a very flexible and powerful search feature.
You can access it by pressing the "<tt>/</tt>" (slash) key.
That will open a small dialog on the center of the screen.
aptitude ăŻăăăăăŚćčťăă¤ĺźˇĺăŞć¤ç´˘ćŠč˝ăćäžăăžăă
"<tt>/</tt>" (ăšăŠăăˇăĽ) ăăźăćźăăă¨ă§ăăăŽćŠč˝ăĺŠç¨ă§ăăžăă
ăšăŻăŞăźăłä¸ĺ¤ŽăŤĺ°ăăŞăă¤ă˘ăă°ăéăă§ăăăă
<p>
You can then type the name of a package. Aptitude will search as
you type. If the package it finds is not exactly the one you want
you can press enter for the dialog to vanish and then press the
"<tt>n</tt>" key to repeat the search for the same string.
ăăăŤăăăąăźă¸ĺăăżă¤ăăăŚăă ăăăăżă¤ăĺ
厚ăŤć˛żăŁăŚăaptitude ăŻ
ć¤ç´˘ăčĄăŞăăžăăčŚă¤ăăŁăăăăąăźă¸ăć˘ăăŚăăăăŽă¨ăŻç°ăŞăĺ ´ĺă
Enter ăćźăăŚăă¤ă˘ăă°ăćśăăăăăă "<tt>n</tt>" ăćźăăă¨ă§
ĺăćĺĺă§ăŽć¤ç´˘ăçš°ăčżăăă¨ăă§ăăžăă
<p>
You can use regular expressions<footnote>regular expressions
are special strings to match sentences based on some conditions,
take a look at the regex(7) manpage</footnote> on the search dialog,
just beware that aptitude has its own search language which sometimes
overlaps with the regular expressions' one. Let's move on to an
example, then: if you want to have an exact match to the string
"gnome" type "<tt>^gnome$</tt>" on the search dialog.
ć¤ç´˘ăă¤ă˘ăă°ă§ăŻćŁčŚčĄ¨çž<footnote>ćŁčŚčĄ¨çžă¨ăŻăăăă¤ăăŽćĄäťśăĺ
ăŤ
ăăćăŤăăăăăçšĺĽăŞćĺĺăŽăă¨ă§ăăregex(7) ㎠man ăăźă¸ăĺç
§
ăăŚăă ăă</footnote>ă使ăăă¨ăă§ăăžăăăă ăăaptitude ăŻćŁčŚ
襨çžă¨éč¤ăăăă¨ăăăçŹčŞăŽć¤ç´˘č¨čŞăĺăăŚăăăă¨ăŤćł¨ćăăŚăă ăăă
ă§ăŻäžăŤç§ťăăžăăă: "gnome" ă¨ăăćĺĺăŤćŁç˘şăŤăăăăăăăăă°ă
ć¤ç´˘ăă¤ă˘ăă°ă§ "<tt>^gnome$</tt>" ă¨ăżă¤ăăăŚăă ăăă
<p>
Notice that when searching like this you are simply searching for
the package names. If you want to search for descriptions you need
to use "<tt>~d</tt>" right before the search term. So, if you want
to search for all packages mentioning "isolinux" on their descriptions
you'd write "<tt>~disolinux</tt>" at the search dialog.
ăăŽăăăŞć¤ç´˘ćăŻăăăăąăźă¸ĺăŽć¤ç´˘ăčĄăŞăŁăŚăăă ăă§ăăăă¨ăŤ
注ćăăŚăă ăăăăăăąăźă¸čŞŹććăŽć¤ç´˘ăăăăăă°ăć¤ç´˘ç¨čŞăŽç´ĺăŤ
"<tt>~d</tt>" ă使ăĺż
čŚăăăăžăăăăăăŁăŚă誏ććä¸ă§ "isolinux"
ăŤč¨ĺăăŚăăĺ
¨ăăăąăźă¸ăć¤ç´˘ăăăăă°ăć¤ç´˘ăă¤ă˘ăă°ă§
"<tt>~disolinux</tt>" ă¨ăżă¤ăăăăă¨ăŤăŞăă§ăăăă
<p>
You can also search for all packages which are currently broken
by searching for "<tt>~b</tt>", search for all the packages which
were removed but which configuration files have been kept searching
for "<tt>~c</tt>".
ăžăă"<tt>~b</tt>" ă使ăă°çžĺ¨ĺŁăăŚăăĺ
¨ăăăąăźă¸ăć¤ç´˘ă§ăăžăă
"<tt>~c</tt>" ă使ăă°ăĺé¤ć¸ăżă ăč¨ĺŽăăĄă¤ăŤăŻćŽăŁăŚăăĺ
¨ăăăąăźă¸ă
ć¤ç´˘ă§ăăžăă
<p>
For more advanced searching on <prgn>aptitude</prgn> take a look
at Aptitude's <tt>User Manual</tt>, which you can find inside
the Help menu.
<prgn>aptitude</prgn> ăŽăăéŤĺşŚăŞć¤ç´˘ăŤă¤ăăŚăŻăaptitude ăŽ
<tt>User Manual</tt> ăĺç
§ăăŚăă ăăăăăŤăăĄăăĽăźĺ
ăŤăăăžăă
<p>
You can also use the command line to search for packages like this:
揥ăŽăăăŤăăă°ăăłăăłăăŠă¤ăłă§ăć¤ç´˘ăčĄăŞăăă¨ăă§ăăžă:
<p>
<example>
$ aptitude search '~c'
c A abiword-common - WYSIWYG word processor based on GTK2
c A acme - Enables the "multimedia buttons" found on
(...)
</example>
<p>
As you can see, you can use any aptitude search string when using the
command line too, and <prgn>aptitude</prgn> provides you some information
on the state of the packages that we are going to discuss through this
manual.
ăăăăăŽă¨ăăăăłăăłăăŠă¤ăłă使ăŁăŚăăćă§ă aptitude ăŽăăăăć¤ç´˘
ćĺĺăĺŠç¨ă§ăă<prgn>aptitude</prgn> ăŻăăăąăźă¸çść
ăŤé˘ăăăăă¤ă
ăŽć
ĺ ąăćäžăăŚăăăžăăăăăŻćŹăăăĽă˘ăŤă§čż°ăšăăă¨ăăŚăăăăŽă§ăă
</sect>
<sect id="install">ăăăąăźă¸ăŽă¤ăłăšăăźăŤă¨ĺă¤ăłăšăăźăŤ
<p>
ăăăăăçăăăĺž
ăĄćăă§ăăăăăťăšă§ă! sources.list ăç¨ćăă
APT ăŽéľăŞăłă°ăŤăăŞăăŽéľăčż˝ĺ ăăĺŠç¨ĺŻč˝ăŞăăăąăźă¸ăŽä¸čŚ§ăć´ć°ăăăă
揲ăăăăăąăźă¸ăă¤ăłăšăăźăŤăăăŤăŻ <tt>aptitude</tt> ăĺŽčĄăăă ăă§ăă
<p>
When you enter <prgn>aptitude</prgn> you can have it install one or
more packages by pressing the "<tt>+</tt>" key while the package in
question is selected. You can use the "<tt>/</tt>" key to search for
the package you want, see <ref id="searching">. When you request
the installation of a package it will be marked with a green color and
the line will look like in this example:
<prgn>aptitude</prgn> ă辡ăĄä¸ăăă¨ăăăăąăźă¸ăŽé¸ćä¸ăŤ "<tt>+</tt>" ă
ćźăăă¨ă§ 1 ă¤ăŞăăč¤ć°ăŽăăăąăźă¸ăă¤ăłăšăăźăŤă§ăăžăăăăăąăźă¸ă
ć˘ăăŤăŻ "<tt>/</tt>" ăăźă使ăăă¨ăă§ăăžăă<ref id="searching"> ăĺç
§
ăăŚăă ăăăăăăăăąăźă¸ăŽă¤ăłăšăăźăŤăčŚćąăăă¨ăă°ăŞăźăłăŽăăźăŻăäťăăŚ
ăăŽčĄăŻćŹĄăŽäžăŽăăăŤčĄ¨ç¤şăăăžă:
<p>
<example>
pi celestia-gnome <none> 1.3.0-1
</example>
<p>
This means that the package is not installed ('p') and is marked
for installation. The word <tt><none></tt> means no version
is installed and the version number after it is the one that is
being marked for installation.
ăăŽäžă§ăŻăăăăąăźă¸ăćŞă¤ăłăšăăźăŤ ('p') ă§ăăăă¤ăłăšăăźăŤăčĄăŞă
ăăźăŻăäťăăŚăăžăă<tt><none></tt> ă¨ăăĺčŞăŻăăăăŞăăăźă¸ă§ăłă
ă¤ăłăšăăźăŤăăăŚăăŞăăă¨ăćĺłăăŚăăăçśăăăźă¸ă§ăłăăłăăźăŻ
ăăăăă¤ăłăšăăźăŤăăăăăźă¸ă§ăłă§ăă
<p>
Notice that when you do that other packages will be marked for
installation automatically. Those are the dependencies,
suggestions and recommendations of the selected package. They
will most probably be marked like this:
ä¸č¨ăŽćé ăčĄăŞăŁăéăŤăäťăŽăăăąăźă¸ăŤăčŞĺçăŤă¤ăłăšăăźăŤăŽăăźăŻă
äťăăăăăă¨ăăăăŽăŤćł¨ćăăŚăă ăăăăăăŻé¸ćăăăăăąăźă¸ăŽ
äžĺăććĄăć¨ĺĽ¨é˘äżăŤăăăăŽă§ăă大ĺăŽĺ ´ĺă䝼ä¸ăŽăăăŞăăźăŻăäťăăă
ăžă:
<p>
<example>
piA gnome-bin <none> 1.4.2-16
</example>
<p>
The uppercased 'A' means that this package is being installed
because another package depends on it. All packages installed
like that will be removed when no longer needed. You can have that
mark set manually by typing "<tt>M</tt>" with the cursor positioned
at a package.
大ćĺ㎠'A' ăŻăäťăŽăăăąăźă¸ăäžĺăăŚăăăăăŤĺ˝čŠ˛ăăăąăźă¸ă
ă¤ăłăšăăźăŤăăăăă¨ăćĺłăăžăăăăŽăăăŤăăŚă¤ăłăšăăźăŤăăă
ăăăąăźă¸ăŻăä¸čŚăŤăŞăă¨ĺé¤ăăăžăăăăăąăźă¸ăŽä¸ăŤăŤăźă˝ăŤă
罎ă㌠"<tt>M</tt>" ă¨ăżă¤ăăăă°ăćä˝ćĽă§ăăŽćĺŽăčĄăŞăăă¨ă
ă§ăăžăă
<p>
A 'U' sign at the forth column means that package comes from an
untrusted source, which means there's no signed <tt>Release</tt> file
for the source that package comes from or its public key has not been
imported into APT's keyring. See <ref id="apt-key"> to understand what
you should do to have that source be trusted. You may have that same
package in one of the trusted sources too, though, so you may want to
take a look at the detailed information about available versions of
that package.
4 ćĄçŽăŤ 'U' ă襨示ăăăŚăăă¨ăäżĄé źă§ăăŞăă˝ăźăšăăćĽăăăăąăźă¸
ă§ăăăă¨ăćĺłăăžăăăăăŻăăăăąăźă¸ăăăă˝ăźăšăŽ <tt>Release</tt>
ăăĄă¤ăŤăŤç˝˛ĺăăăăŚăăŞăăăăăŽĺ
Źééľă APT ăŽéľăŞăłă°ăŤă¤ăłăăźă
ăăăŚăăŞăăă¨ăćĺłăăžăăă˝ăźăšăčŞč¨źăăăăăŤĺŽć˝ăăšăäşăçĽă
ăŤăŻă<ref id="apt-key"> ăĺç
§ăăŚăă ăăăĺăăăăąăźă¸ăäżĄé źă§ăă
ă˝ăźăšăŽ 1 ă¤ăŤăĺĺ¨ăăăă¨ăăăăžăăăăŁăŚĺ˝čŠ˛ăăăąăźă¸ăŽĺ
ĽćĺŻč˝
ăŞăăźă¸ă§ăłăŤă¤ăăŚă芳ăăć
ĺ ąă調ăšăćšăčŻăă§ăăăă
<p>
You can have detailed information about the package you want to
install by pressing <tt>Enter</tt> while the package is selected.
This will bring you to something like this:
ă¤ăłăšăăźăŤăăăăăăąăźă¸ăŽčŠłç´°ăŞć
ĺ ąă揲ăăăă°ăăăăąăźă¸ăŽé¸ćä¸
㍠<tt>Enter</tt> ăćźăăŚăă ăăă揥ăŽăăăŞć
ĺ ąăĺžăăăžă:
<p>
<example>
i A --\ xterm 4.2.1-14 4.2.1-14
Description
xterm - X terminal emulator
xterm is a terminal emulator for the X Window System. It provides DEC VT102
and Tektronix 4014 compatible terminals for programs that cannot use the
window system directly. This version implements ISO/ANSI colors and most of
the control sequences used by DEC VT220 terminals.
Priority: optional
Section: x11
Maintainer: Branden Robinson <branden@debian.org>
Compressed size: 547k
Uncompressed size: 1130k
Source Package: xfree86
--\ Depends
--- libc6 (>= 2.3.2.ds1-4)
--- libfreetype6 (>= 2.1.5-1)
--- libncurses5 (>= 5.3.20030510-1)
--- libxaw7 (> 4.1.0)
--- xlibs (> 4.1.0)
--- xlibs (> 4.2.0)
--\ Conflicts
--- xbase (< 3.3.2.3a-2)
--- suidmanager (< 0.50)
--\ Replaces
--- xbase (< 3.3.2.3a-2)
--- Packages which depend on xterm
--\ Versions
p A 4.3.0-0pre1v4
i A 4.2.1-14
</example>
<p>
Those versions which are trusted will not have the 'U' letter at the
forth column, so you just pick the one you want and tell aptitude to
install. Our example above has different versions coming from trusted
sources.
äżĄé źă§ăăăăźă¸ă§ăłăŤăŻ 4 ćĄçŽăŤ 'U' ăŽćĺăçĄăăŽă§ăă¤ăłăšăăźăŤ
ăăăăăŽăé¸ă㧠aptitude ăŤă¤ăłăšăăźăŤăăăăäźăăă ăă§ăă
ä¸ăŽäžă§ăŻăäżĄé źă§ăăă˝ăźăšăŤăăç°ăŞăăăźă¸ă§ăłă襨示ăăăŚăăžăă
</p>
<p>
Notice that almost always, when you see three or more dashes you can
press <tt>Enter</tt> to have it expand. It will then become something
like <tt>--\</tt>. You now have plenty of information on this package,
like what packages it depends on and which it conflicts<footnote>a
package which conflicts with another one or with a specific version of
another package cannot be installed at the same time as that package
or package version</footnote>, for example.
ć
ĺ ąăćĄĺ¤§ăăăă㍠<tt>Enter</tt> ăćźăăă¨ăă§ăăăăăˇăĽăă
ăťăźĺ¸¸ăŤ 3 ĺ䝼ä¸ăăăă¨ăŤćł¨ćăăŚăă ăăăăăăăă°ĺ˝čŠ˛ăăăąăźă¸ăŤ
é˘ăă大éăŽć
ĺ ąăĺžăăăžăăăă¨ăă°ăăăăäžĺăăŚăăăăăąăźă¸ă
čĄçŞ<footnote>äťăŽăăăąăźă¸ăăçšĺŽăăźă¸ă§ăłăŽäťăŽăăăąăźă¸ă¨čĄçŞ
ăăăăăąăźă¸ăŻăăăăăŽăăăąăźă¸ăăăźă¸ă§ăłă¨ĺćăŤă¤ăłăšăăźăŤ
ă§ăăžăă</footnote>ăăăăăąăźă¸ăŞăŠă§ăă
<p>
Also notice that at the end of the screen (you can go down using the
arrow keys or page down) you'll find the different <tt>Versions</tt>
available for that package. The <package>xterm</package> package
has two available versions for me, because I have more than one
APT source providing it at different versions.
ăžăăšăŻăŞăźăłăŽćĺž (ç˘ĺ°ăăźă Page Down ăăźă§ä¸ăăăă¨ăă§ă
ăžă) ăŤăŻăĺ˝čŠ˛ăăăąăźă¸ăŽĺ
ĽćĺŻč˝ăŞĺĽăăźă¸ă§ăłă襨示ăăăŚăă
ăă¨ăŤă注ćăăŚăă ăăăä¸ăŽäžă§ăŻă<package>xterm</package> ăŤăŻ
ĺ
ĽćĺŻč˝ăŞăăźă¸ă§ăłă 2 ă¤ăăăžăăăăăŻç°ăŞăăăźă¸ă§ăłăćäžăă
1 ă¤äťĽä¸ăŽ APT ă˝ăźăšăćĺŽăăŚăăăăă§ăă
<p>
You can install the version you want by pressing "<tt>+</tt>" on
it. Remember that you need to ask <prgn>aptitude</prgn> to proceed
with the marks you have made. You do that by pressing "<tt>g</tt>".
<prgn>Aptitude</prgn> will then show a list of actions it's going
to perform where you can see if it is doing what you want:
ă¤ăłăšăăźăŤăăăăăźă¸ă§ăłăŽä¸ă§ "<tt>+</tt>" ăćźăă°ăăăăă¤ăłăšăăźăŤ
ă§ăăžăăäťăăăăźăŻăŽĺŚçăé˛ăăăă <prgn>aptitude</prgn> ăŤčŚćąăăŞăăă°
ăŞăăŞăăă¨ăŤćł¨ćăăŚăă ăăăăăŽăăăŤăŻ "<tt>g</tt>" ăćźăăŚăă ăăă
<prgn>Aptitude</prgn> ăŻăăăăĺŽčĄăăăă˘ăŻăˇă§ăłăŽä¸čŚ§ă襨示ăăăŽă§ă
ăăăćăżăŠăăăŞăŽăăŠăăăăă§ăăŻă§ăăžăă
<p>
<example>
--\ Packages being automatically installed to satisfy dependencies
ciA calctool <none> 4.3.16-2
--\ Packages being held back
ih libgnomeprintui2.2-0 2.4.0-1 2.4.2-1
--\ Packages to be installed
pi gwget2 <none> 0.7-3
--\ Packages to be removed
ip qvwm 1:1.1.12-11:1.1.12-1</example>
<p>
The entries should be easily understandable. The new thing here is a
package being held back. You can read more about that in <ref
id="holding">. After checking the changes are the ones you wish
confirm the selections by pressing the "<tt>g</tt>" key again.
ĺé
çŽăŽç解ăŻĺŽšćă§ăăăăăăă§çŽć°ăăăŽăŻăäżćăăăŚăăăăăąăźă¸
ă§ăă芳ăă㯠<ref id="holding"> ăĺç
§ăăŚăă ăăăĺ¤ć´çšăćăă§ăă
ăăŽă§ăăăăŠăăăăă§ăăŻăăĺžăŻă"<tt>g</tt>" ăăźăĺăłćźăăŚé¸ćă
ćżčŞăăŚăă ăăă
<p>
<prgn>aptitude</prgn> will now start the process of downloading and
installing the packages you have selected. APT may also start
upgrading any packages that need to be upgraded at this time (see <ref
id="upgrade">). If you have selected packages from untrusted sources
aptitude will show you a list of those packages and prompt you before
starting to obtain the packages whether you really want to install
them. See <ref id="trustchain"> for more information on secure
sources.
ăăăă <prgn>aptitude</prgn> ăŻăé¸ćăăăăăąăźă¸ăŽăăŚăłăăźăă¨
ă¤ăłăšăăźăŤĺŚçăéĺ§ăăžăăAPT ăŻăăŽćçšă§ă˘ăăă°ăŹăźăăĺż
čŚăŞ
ăăăąăźă¸ăŽă˘ăăă°ăŹăźăăéĺ§ăăăăăăăžăă (<ref id="upgrade"> ă
ĺç
§)ăäżĄé źă§ăăŞăă˝ăźăšăŤăăăăăąăźă¸ăé¸ăă ăŽăŞăăaptitude ăŻ
ăăăăŽăăăąăźă¸ä¸čŚ§ă襨示ăăŚăăăăąăźă¸ăĺĺžéĺ§ĺăŤćŹĺ˝ăŤăăăăŽ
ă¤ăłăšăăźăŤăćăă§ăăăŽă確čŞăăŚăăă§ăăăăĺŽĺ
¨ăŞă˝ăźăšăŤé˘ăă
ăă芳ăăć
ĺ ąăŻă<ref id="trustchain"> ăĺç
§ăăŚăă ăăă
<p>
If you want to reinstall a package, say, to have files you removed
by accident recovered or something you can press the "<tt>L</tt>"
key to mark it for reinstallation. You'll then go through the same
process as if you were installing it.
ăă¨ăă°ăăŁăăĺé¤ăăŚăăžăŁăăăĄă¤ăŤă垊ć§ăăăăă¨ăăŁăççąă§ă
ăăăăăąăźă¸ăĺă¤ăłăšăăźăŤăăăĺ ´ĺă"<tt>L</tt>" ăăźăćźăăŚ
ĺă¤ăłăšăăźăŤăŽăăźăŻăäťăăăă¨ăă§ăăžăăăăŽĺžăŻăé常ăŽ
ă¤ăłăšăăźăŤă¨ĺăćé ă§ăă
<p>
You can also use <prgn>aptitude</prgn> without the interactive
UI to install or reinstall packages like this:
揥ăŽăăăŤăăă°ăaptitude ăŽĺŻžčŠąĺź UI ă使ăăăŤăăăąăźă¸ăŽ
ă¤ăłăšăăźăŤăĺă¤ăłăšăăźăŤăčĄăŞăăă¨ăă§ăăžă:
<p>
<example>
# aptitude install <var>package1</var> <var>package2</var> ...
# aptitude --reinstall install <var>package1</var> <var>package2</var> ...
</example>
</sect>
<sect id="manual-install">Installing manually downloaded or locally created debian packages
<sect id="manual-install">ćä˝ćĽă§ăăŚăłăăźăăăăăăźăŤăŤăŤä˝ćăă Debian ăăăąăźă¸ăŽă¤ăłăšăăźăŤ
<p>
If you have downloaded a <tt>.deb</tt> file manually from the internet
or has got a <tt>.deb</tt> from any source other than using APT
you will not be able to use <prgn>aptitude</prgn> or any other APT-based
program to install it.
ćä˝ćĽă§ăăŚăłăăźăăă <tt>.deb</tt> ăăĄă¤ăŤăăAPT ă使ăăŞăă˝ăźăšăă
ĺ
Ľćăă <tt>.deb</tt> ăăĄă¤ăŤăŽĺ ´ĺăăăăă¤ăłăšăăźăŤăăăŽăŤ
<prgn>aptitude</prgn> ăäťăŽ APT ăăźăšăŞăăă°ăŠă ă使ăăă¨ăŻă§ăăŞă
ă§ăăăă
<p>
You'll then need to use the underlying package management tool,
which is the one that actually does the hard work of installing
packages -- even aptitude calls this tool for installing: <prgn>dpkg</prgn>.
ăăă§ä¸ä˝ăŤĺĺ¨ăăăăăąăźă¸çŽĄçăăźăŤă使ăĺż
čŚăăăăžăăăăă
ăăăăăăąăźă¸ăŽă¤ăłăšăăźăŤă¨ăăéĺ´ĺăĺŽéăŤć
ăŁăŚăăžă --
aptitude ăăăă¤ăłăšăăźăŤĺŚçç¨ăŤăŻăăŽăăźăŤăĺźăłĺşăăŚăăžăă
ăăŽĺ㯠<prgn>dpkg</prgn>ă
<p>
You can install a package by doing:
揥ăŽăăăŤăăŚăăăăąăźă¸ăă¤ăłăšăăźăŤă§ăăžă:
<p>
<example>
# dpkg -i <var>file.deb</var>
</example>
<p>
If you want to use the <tt>unstable</tt> branch of Debian or wishes
to create Debian packages you better learn more about <prgn>dpkg</prgn>!
It's a very powerful tool and has many useful options.
Debian ăŽ<tt>ä¸ĺŽĺŽç</tt>ă使ăŁăăăDebian ăăăąăźă¸ăä˝ćăăă
ăŽăŞăă<prgn>dpkg</prgn> ăŤă¤ăăŚćˇąăĺŚăă ćšăčŻăă§ăăă!
ă¨ăŚă埡ĺăŞăăźăŤă§ăĺ¤ăăŽäžżĺŠăŞăŞăăˇă§ăłăĺăăŚăăžăă
</sect>
<sect id="remove">ăăăąăźă¸ăŽĺé¤
<p>
ăăăăăąăźă¸ăăăŻă使ăăăăŞăăŽăŞăăAPT ă使ăŁăŚăˇăšăă ăă
ĺăé¤ăăă¨ăă§ăăžăă
To do this just type "<tt>-</tt>" while having the package
selected on <prgn>aptitude</prgn>. That will mark the package for removal
with a purple-colored line, like this:
ăăăčĄăŞăăŤăŻă<prgn>aptitude</prgn> ăé¸ćăăé㍠"<tt>-</tt>" ă
ăżă¤ăăăă ăă§ăăăăăąăźă¸ăŤăŻĺé¤ă示ăăăźăŻăäťăăăăĺ˝čŠ˛čĄăŻ
揥ăŽăăăŤç´Ťč˛ă§čĄ¨ç¤şăăăžă:
<p>
<example>
id celestia-gnome 1.3.0-1 1.3.0-1
</example>
<p>
Notice that this will result in a line that looks like this, after the
package is removed:
ăăăąăźă¸ăŽĺé¤ĺžăŻăčĄă揥ăŽăăăŤăŞăăă¨ăŤćł¨ćăăŚăă ăă:
<p>
<example>
c ocaml-base <none> 3.07.2a-1
</example>
<p>
There's a <tt>c</tt> at the beginning of the line, instead of
a <tt>p</tt>. This means that, in my system, the ocaml-base package
was removed but the configuration files are still hanging around. To
remove the package with its configuration files you have to use the
"<tt>_</tt>" key<footnote>The underscore key, usually found together
with the dash, typeable by pressing shift while pressing the dash
key.</footnote>, instead -- that's called purge.
čĄăŽĺ
é ăŤăŻ <tt>p</tt> ăŽäťŁăă㍠<tt>c</tt> ă¨čĄ¨ç¤şăăăŚăăžăăăă
ăŻăăˇăšăă ăă ocaml-base ăăăąăźă¸ăŻĺé¤ăăăăăŽăŽăăăŽč¨ĺŽăăĄă¤ăŤ
ăŻäžçśă¨ăăŚćŽăŁăŚăăăă¨ăćĺłăăžăăč¨ĺŽăăĄă¤ăŤăĺŤăăŚăăăąăźă¸ă
ĺé¤ăăăŤăŻă䝣ăă㍠"<tt>_</tt>" ăăź<footnote>ă˘ăłăăźăšăłă˘ăăźăŽăă¨ă
čąčŞăăźăăźăă§ăŻé常ăăăăˇăĽă¨ĺăăăźăŤăăăžăăăˇăăăćźăăŞăă
ăăăˇăĽăăźăćźăă¨ăżă¤ăă§ăăžă</footnote> ă使ăĺż
čŚăăăăžăă
ăă㯠purge ă¨ĺźă°ăăžăă
<p>
One important note: if you try to remove a package which is a dependency
of an installed package you'll end up having broken packages, as the
top of the aptitude screen shows:
éčŚăŞćł¨ć: ă¤ăłăšăăźăŤć¸ăżăŽăăăąăźă¸ăäžĺăăŚăăăăăąăźă¸ăĺé¤
ăăăă¨ăăĺ ´ĺăăăăąăźă¸ăĺŁăăŚăăžăă§ăăăăaptitude ăŽăšăŻ
ăŞăźăłä¸é¨ăŤă揥ăŽăăăŤčĄ¨ç¤şăăăžă:
<p>
<example>
aptitude 0.2.13 #Broken: 1 Will free 208MB of disk space
</example>
<p>
The broken packages will be marked like this:
ĺŁăăăăăąăźă¸ăŤăŻă揥ăŽăăăŤăăźăŻăäťăăăăžă:
<p>
<example>
iBA openoffice.org 1.1.0-3 1.1.0-3
</example>
You can try to solve the brokenness for yourself, by having the offending
packages removed as well, so that no broken depends are left or ask
<prgn>aptitude</prgn> to proceed, pressing the "<tt>g</tt>" key. It
will then try to fix all the brokenness. If the solution taken by the
program does not satisfy your wishes you can manually fix it before
confirming with "<tt>g</tt>".
ĺĺ ă¨ăŞăŁăŚăăăăăąăźă¸ăĺé¤ăăŚăĺŁăăäžĺé˘äżăćŽăăŞăăăăŤ
ăăăă¨ă§ăĺŁăăçść
ăŽäżŽĺžŠăčŞĺă§čŠŚăżăăă¨ăă§ăăžăăăăăăŻ
"<tt>g</tt>" ăćźăăŚă<prgn>aptitude</prgn> ăŤĺŚçăé˛ăăăăăŤčŚćą
ăăăă¨ăă§ăăžăăăăšăŚăŽç ´ĺŁçść
ă俎ćŁăăăă¨čŠŚăżăă§ăăăă
ăăă°ăŠă ăŤăă解湺ăĺ¸ćăćşăăăŞăăŁăĺ ´ĺă"<tt>g</tt>" ă§ç˘şčŞ
ăăĺăŤćä˝ćĽă§äżŽćŁăăăă¨ăă§ăăžăă
<p>
You can search for broken packages typing "<tt>/</tt>" and using
"<tt>~b</tt>" as search string and pressing <tt>Enter</tt>, you can
then search for the next match using the "<tt>\</tt>" key. You can
search broken packages by simply pressing the "<tt>b</tt>" key, also;
pressing it again will show you the next broken package. See <ref
id="search"> for more information on finding packages.
"<tt>/</tt>" ăăżă¤ăăăŚăăć¤ç´˘ćĺĺă¨ă㌠"<tt>~b</tt>" ă使ăăăă
ăă <tt>Enter</tt> ăćźăăă¨ă§ĺŁăăăăăąăźă¸ăć¤ç´˘ă§ăăžăă
"<tt>\</tt>" ăăźă使ăă°ćŹĄăŤăăăăăçľćăć¤ç´˘ă§ăăăăăŻçš°ăčżă
ăă¨ăă§ăăžăăăăăąăźă¸ăŽć¤ç´˘ăŤé˘ăăăă芳ăăć
ĺ ąăŻă
<ref id="search"> ăĺç
§ăăŚăă ăăă
<p>
As usual, you can have packages removed or purged through the
command line interface like this:
ăă¤ăă¨ĺăăăăŤă揥ăŽăăăŤăăă°ăłăăłăăŠă¤ăłă¤ăłăżăźăă§ă¤ăšçľçą
ă§ăăăąăźă¸ăŽĺé¤ă purge ăčĄăŞăăă¨ăă§ăăžă:
<p>
<example>
# aptitude remove <var>package1</var> <var>package2</var> ...
# aptitude purge <var>package1</var> <var>package2</var> ...
</example>
</sect>
<sect id="upgrade">ăăăąăźă¸ăŽă˘ăăă°ăŹăźă
<p>
ăăăąăźă¸ăŽă˘ăăă°ăŹăźăăŻăAPT ăˇăšăă ăŽĺ大ăŞććă§ăă
Aptitude will
automatically mark the packages that have newer versions for upgrade
so all you have to do to upgrade your system is, usually, update the
lists of packages (see <ref id="update">) and then ask
<prgn>aptitude</prgn> to proceed, by typing "<tt>g</tt>" and, after
reviewing the changes, confirming with "<tt>g</tt>", again. If
aptitude is not marking the upgrades automatically you can press the
"<tt>U</tt>" (upper "u") key to ask it to. This is a configuration
option which lives on the <tt>Options->Misc</tt> menu.
aptitude ăŻăă˘ăăă°ăŹăźăç¨ăŽć°ăăźă¸ă§ăłăăăăăăąăźă¸ăŤčŞĺçăŤ
ăăźăŻăäťăăŚăăăăŽă§ăăˇăšăă ăă˘ăăă°ăŹăźăăăăŽăŤĺż
čŚăŞăŽăŻă
é常ăŽĺ ´ĺăăăăąăźă¸ăŽä¸čŚ§ăć´ć° (<ref id="update"> ăĺç
§) ăă
"<tt>g</tt>" ăăżă¤ăă㌠<prgn>aptitude</prgn> ăŤĺŚçăé˛ăăăăć示
ăăŚĺ¤ć´ĺ
厚ăé˛čŚ§ăăĺžăăăä¸ĺşŚ "<tt>g</tt>" ăăżă¤ăăăŚç˘şčŞăăăă¨
ă ăă§ăăaptitude ăčŞĺçăŤă˘ăăă°ăŹăźăăŽăăźăŻăäťăăŞăăă°ă
"<tt>U</tt>" (大ćĺ㎠U) ăăźăćźăăŚăăźăŻăäťăăăăć示ă§ăăžăă
ăă㯠<tt>Options->Misc</tt> ăĄăăĽăźĺ
ăŤăăč¨ĺŽăŞăăˇă§ăłă§ăă
<p>
You can check the list of packages that have new versions available
looking at the <tt>Upgradable Packages</tt> category:
<tt>Upgradable Packages</tt> ăŤăă´ăŞăčŚăă°ăĺŠç¨ĺŻč˝ăŞć°ăăźă¸ă§ăł
ăăăăăăąăźă¸ăŽä¸čŚ§ăăă§ăăŻă§ăăžă:
<p>
<example>
--\ Upgradable Packages
--\ libs - Collections of software routines
--\ main - The main Debian archive
iu libgnomeprintui2.2-0 2.4.0-1 2.4.2-1
</example>
<p>
Packages marked for upgrade have their lines cyan-colored and have the
character <tt>u</tt> as the action that is going to be performed.
If you want to upgrade to a new release, then take a look at the next
section, <ref id="dist-upgrade">.
ă˘ăăă°ăŹăźăăŽăăźăŻăäťăăăăăăăąăźă¸ăŻăăăŽčĄăŽč˛ăăˇă˘ăłă¨
ăŞăŁăŚăăăĺŽčĄăăăăă¨ăăŚăăă˘ăŻăˇă§ăłă¨ă㌠<tt>u</tt> ăŽćĺă
襨示ăăăŚăăžăăć°ăŞăŞăźăšă¸ă˘ăăă°ăŹăźăăăăăă°ă揥ăŽ
<ref id="dist-upgrade">ăťăŻăˇă§ăłăĺç
§ăăŚăă ăăă
</sect>
<sect id="dist-upgrade">ć°ăŞăŞăźăšă¸ăŽă˘ăăă°ăŹăźă
<p>
APT ăŽćŹćŠč˝ăŤăăăă¤ăłăżăźăăăăăăăŻć°ăă CD (čłźĺ
ĽăăăăŽăăISO ă¤ăĄăźă¸ă¨
ăăŚăăŚăłăăźăăăăăŽ) ă使ăŁăŚăĺ
¨ Debian ăˇăšăă ăä¸ĺşŚăŤă˘ăăă°ăŹăźă
ăăăă¨ăă§ăăžăă
<p>
ăă¨ăă°ăDebian ăŽĺŽĺŽçăŞăă¸ă§ăł 0 ă使ăŁăŚăăŚăăŞăă¸ă§ăł 3 ㎠CD ă
財ăŁăŚăăă¨ăăžăăăăŽć°ăă CD ăĺ
㍠APT ă使ăŁăŚăăˇăšăă ăă˘ăăă°ăŹăźă
ă§ăăžăăăăŽăăăŤăŻă<prgn>apt-cdrom</prgn> (<ref id="cdrom"> ăĺç
§)
ă使ăŁăŚ CD ă <tt>/etc/apt/sources.list</tt> ăŤčż˝ĺ ăăăăăă
ĺčż°ăŽćé ăŤĺžăŁăŚă¤ăłăšăăźăŤăé˛ăăăă㍠<tt>aptitude</tt> ăĺŽčĄăăžăă
<p>
APT ăŻă<ref id="apt:policy"> ă§ç¤şăăă˝ăźăšăŽĺŞĺ
庌ăč¨ĺŽăăăŚăăă¨ăă
é¤ăă常ăŤćć°ăăźă¸ă§ăłăŽăăăąăźă¸ăć˘ăăă¨ăŤćł¨ćăăŚăă ăăă
ăăăăŁăŚă严ćšăŽă˝ăźăšăŽĺŞĺ
庌ăĺăăăăăă˘ăźăŤă¤ăăäťăŽă˘ăźăŤă¤ă
ăăăéŤăĺŞĺ
庌ăćă¤ĺ ´ĺă<tt>etc/apt/sources.list</tt> ㍠CD ăăăć°ăă
ăăźă¸ă§ăłăŽăăăąăźă¸ăĺŤăă˘ăźăŤă¤ăăč¨čż°ăăăŚăăă°ăAPT ăŻăăăă
ăăăąăźă¸ăăăŚăłăăźăăăžăă
<p>
If you want to update your system from the Internet you only need to
setup the <file>/etc/apt/sources.list</file> file accordingly.
Upgrading to a new stable release is usually just a matter of running
the normal upgrade process on <prgn>aptitude</prgn>. If your
<file>/etc/apt/sources.list</file> uses the release codename<footnote>For
example, Debian 3.0 was called woody, Debian 3.1 is sarge</footnote>
you'll need to update it to the new name or change it to `stable'.
ă¤ăłăżăźăăăă§ăˇăšăă ăć´ć°ăăăăă°ăĺż
čŚăŞăŽăŻ
<file>/etc/apt/sources.list</file> ăăĄă¤ăŤăăăăŤĺżăăŚč¨ĺŽăăă ăă§ăă
ć°ăăĺŽĺŽçăŞăŞăźăšă¸ăŽă˘ăăă°ăŹăźăăŻăé常ă<prgn>aptitude</prgn> ăŽ
ć¨ćşçăŞă˘ăăă°ăŹăźăĺŚçăĺŽčĄăăă ăă§ăă
<file>/etc/apt/sources.list</file> ă§ăŞăŞăźăšăŽăłăźăăăźă <footnote>ăă¨ăă°
Debian 3.0 㯠woody ă¨ĺźă°ăăŚăăăDebian 3.1 㯠sarge ă§ă</footnote>ă
使ăŁăŚăăăŽăŞăăăăăć°ăăăłăźăăăźă ă `stable' ăŤĺ¤ć´ăăĺż
čŚă
ăăă§ăăăă
<p>
So, for example, this line:
ă¤ăžăăăă¨ăă°ćŹĄăŽčĄ:
<p>
<example>
deb http://http.us.debian.org/debian sarge main
</example>
<p>
Would have to read like one of the following as soon as Etch is
released as stable for the computer to be kept up-to-date with
the current stable system:
ăŻăăłăłăăĽăźăżăćć°ăŽĺŽĺŽçăˇăšăă ă¨ăăŚäżă¤ăăăŤăetch ă
ĺŽĺŽçă¨ăăŚăŞăŞăźăšăăăç´ĺžăŤćŹĄăŽčĄăŽăăăăăŽăăăŤć¸ăćăă
ĺż
čŚăăăăžă:
<p>
<example>
deb http://http.us.debian.org/debian etch main
deb http://http.us.debian.org/debian stable main
</example>
<p>
The difference here is that the first one will keep you at etch
as long as you wish, even if a new stable comes out. This may be
useful if you want to decide when to upgrade to the new stable.
The second example will automatically update your box to the new
stable when it is released.
ăăă 2 čĄăŽéăăŻăćĺăŽäžăŻć°ĺŽĺŽçăçťĺ ´ăăĺžăăćăăăă
etch ăŽçść
ăäżăĄăžăăć°ăăĺŽĺŽçă¸ăŽă˘ăăă°ăŹăźăććăăčŞĺ
ă§ćąşăăăĺ ´ĺăŤäžżĺŠă§ăă2 çŞçŽăŽäžăŻć°ĺŽĺŽçăăŞăŞăźăšăă揥珏ă
čŞĺçăŤăăˇăłăć´ć°ăăžăă
</sect>
<sect id="holding">Keeping packages on hold
<sect id="holding">ăăăąăźă¸ă hold çść
ăŤäżă¤
<p>
As we saw on the previous section, <prgn>aptitude</prgn> will
automatically mark packages for upgrade. If you want to keep the
current version installed, though, you can ask it to put the
package <tt>on hold</tt>.
ăăăžă§ăŽăťăŻăˇă§ăłă§čŚăŚăăăăăŤă<prgn>aptitude</prgn> ăŻăăăąăźă¸ăŤ
寞ăăŚčŞĺçăŤă˘ăăă°ăŹăźăăŽăăźăŻăäťăăžăăăăăăçžĺ¨ă¤ăłăšăăźăŤ
ăăăŚăăăăźă¸ă§ăłăäżăĄăăăă°ăăăŽăăăąăźă¸ă <tt>hold çść
</tt>ăŤ
ăăăăčŚćąă§ăăžăă
<p>
This is achieved by pressing the "<tt>=</tt>" key. Packages being
held from upgrades will look like this:
ăăăŻă"<tt>=</tt>" ăăźăćźăăă¨ă§ĺŻč˝ăŤăŞăăžăăă˘ăăă°ăŹăźăă
ăăŞăăăčŚćąăăăăăăąăźă¸ăŻă䝼ä¸ăŽăăăŤčĄ¨ç¤şăăăžă:
<p>
<example>
ih alien 8.41 8.41
</example>
<p>
In this example, the <package>alien</package> package will be kept
at version 8.41 even if a new version appears on an APT source --
notice the <tt>h</tt> character at the left. To have it
upgraded/upgradable again just mark it for installation.
ăăŽäžă§ăŻă<package>alien</package> ăăăąăźă¸ç¨ăŽć°ăăźă¸ă§ăłă APT
ă˝ăźăšăŤçťĺ ´ (čĄăŽĺˇŚĺ´ăŤ <tt>h</tt> ăŽćĺăăăăă¨ăŤćł¨ć) ăăŚăă
ăŤăăăăăăăăăźă¸ă§ăł 8.41 ăŽăžăžäżăăăžăăăăăă˘ăăă°ăŹăźă
ĺŻč˝ăŤăăăŤăŻăă¤ăłăšăăźăŤç¨ăŽăăźăŻăäťăăă ăă§ăă
<p>
You can put packages on hold using the command line interface, too,
by running:
揥ăŽăăăŤĺŽčĄăăă°ăăłăăłăăŠă¤ăłă¤ăłăżăźăă§ă¤ăšă使ăŁăŚă
ăăăąăźă¸ă hold çść
ăŤă§ăăžă:
<p>
<example>
# aptitude hold <var>package1</var> <var>package2</var> ...
</example>
</sect>
<sect id="clean">Removing unused package files: clean and autoclean
<sect id="clean">ćŞä˝żç¨ăăăąăźă¸ăŽăăĄă¤ăŤăĺé¤ăă: clean 㨠autoclean
<p>
When you install a package APT retrieves the needed files from the hosts
listed in /etc/apt/sources.list, stores them in a local repository
(<file>/var/cache/apt/archives/</file>), and then proceeds with
installation; see <ref id="install">.
ăăăąăźă¸ăŽă¤ăłăšăăźăŤćăŤăAPT 㯠/etc/apt/sources.list ăŤč¨čźăăă
ăăšăăăĺż
čŚăŞăăĄă¤ăŤăĺĺžăă
ăăźăŤăŤăŞăă¸ă㪠(<file>/var/cache/apt/archives/</file>) ăŤäżĺăăžăă
ăăăăă¤ăłăšăăźăŤăŤé˛ăżăžăă<ref id="install"> ăĺç
§ăăŚăă ăăă
<p>
In time the local repository can grow and occupy a lot of disk space.
Fortunately, APT provides tools for managing its local repository:
<prgn>APT</prgn>'s <tt>clean</tt> and <tt>autoclean</tt> methods.
ćăçľă¤ăŤă¤ăăŚăăźăŤăŤăŞăă¸ăăŞăŻč¨ăăŚăăă大éăŽăăŁăšăŻçŠşéă
ĺ ăăăăăŤăŞăăžăă嚸ăăAPT ăŻăăźăŤăŤăŞăă¸ăăŞă玥çăăăăăŽ
ăăźăŤăćäžăăŚăăžă - <prgn>APT</prgn> ㎠<tt>clean</tt> ăăăł
<tt>autoclean</tt> ăĄă˝ăăăăăăŤĺ˝ăăăžăă
<p>
The clean method is invoked through the <tt>Clean package cache</tt>
menu item in the Actions menu. It is used to delete all the <tt>.deb</tt>
files downloaded. The autoclean method is invoked through the <tt>Clean
obsolete files</tt> option, also in the Actions menu.
clean ăĄă˝ăăăŻăActions ăĄăăĽăźĺ
㎠<tt>Clean package cache</tt>
ă˘ă¤ăă ăŤăăŁăŚĺźăłĺşăăăžăăăăŚăłăăźăć¸ăżăŽĺ
¨ <tt>.deb</tt> ăăĄă¤ăŤă
ĺé¤ăăăŽăŤä˝żăăăžăăautoclean ăĄă˝ăăăŻăĺăă Actions ăĄăăĽăźĺ
ăŽ
<tt>Clean obsolete files</tt> ăŞăăˇă§ăłăéăăŚĺźăłĺşăăăžăă
<p>
The autoclean method is to be used by those who like to keep a local
copy of the packages currently installed, mostly. It only deletes those
<tt>.deb</tt> files which are no longer provided by any APT source
and are, thus, obsoleted by a newer version.
autoclean ăĄă˝ăăăŻé常ăçžĺ¨ă¤ăłăšăăźăŤăăăŚăăăăăąăźă¸ăŽăăźăŤăŤ
ăłăăźăŻćŽăăŚăăăăäşşă使ăăžăăăăŻăăăăŞă APT ă˝ăźăšăăăćäž
ăăăŚăăăăăăăăć°ăăźă¸ă§ăłăŤăăŁăŚć§ĺźă¨ăŞăŁă <tt>.deb</tt>
ăăĄă¤ăŤăŽăżăĺé¤ăăžăă
</sect>
</chapt>
<chapt id="sourcehandling">ă˝ăźăšăăăŽć§çŻ
<sect id="source">ă˝ăźăšăăăąăźă¸ăŽăăŚăłăăźă
<p>
ăăŞăźă˝ăăăŚă§ă˘ăŽä¸çă§ăŻăă˝ăźăšăłăźăă§ĺ埡ăăăăăă°ăŽĺ¤ă
ă˝ăźăšă俎ćŁăăăŽăŻăăăăăă¨ă§ăă
Building from source may also
be useful if you want to enable features that are disabled in the
official package, or disable some which is enabled.
ă˝ăźăšăăć§çŻăăăă¨ăŻăžăăĺ
Źĺźăăăąăźă¸ă§ăŻçĄĺšăŤăŞăŁăŚăăćŠč˝ă
ćĺšăŤăăăăéăŤćĺšăŤăŞăŁăŚăăăăŽăçĄĺšăŤăăéăŤă彚çŤăĄăžăă
ăăŽăăăŤăŻăăăă°ăŠă ăŽă˝ăźăšăăăŚăłăăźăăăŞăăă°ăŞăăŞăă§ăăăă
APT ăˇăšăă ăŻăăŁăšăăŞăăĽăźăˇă§ăłä¸ăŽĺ¤ăăŽăăă°ăŠă ăŽă˝ăźăšăłăźăă¨ă
ăăŽăăă°ăŠă ă .deb ĺăăăăăŤĺż
čŚăŞĺ
¨ăăĄă¤ăŤăĺ
ĽćăăăăăŽă
ç°ĄĺăŞćšćłăćäžăăžăă
<p>
Debian ă˝ăźăšăŽăăăă使ăćšă¨ăăŚăŻăăăă°ăŠă ăŽć°ăăăăźă¸ă§ăłă
éŠĺăăăĺ ´ĺăŞăŠă§ăăăă¨ăă°ăstable ăăŁăšăăŞăăĽăźăˇă§ăłăŤ
unstable ä¸ăŽăăă°ăŠă ă使ăĺ ´ĺăŞăŠă§ăăăăăăăąăźă¸ă stable ç¨ăŤ
ăłăłăă¤ăŤăăăŤăŻăăăŽăăŁăšăăŞăăĽăźăˇă§ăłă§ĺŠç¨ĺŻč˝ăŞăăăŤ
äžĺé˘äżă調ć´ă㌠.deb ăçćăăžăă
<p>
ăăŽăăăŤăŻă<tt>/etc/apt/sources.list</tt> ä¸ăŽ <tt>deb-src</tt> ăŽ
ă¨ăłăăŞă unstable ĺăă¨ăŞăŁăŚăăŞăăă°ăŞăăžăăăăăăŤă¨ăłăăŞă
ćĺš (ă˘ăłăłăĄăłă) ăŤăŞăŁăŚăăĺż
čŚăăăăžăă<ref id="sources.list"> ă
ĺç
§ăăŚăă ăăă
<p>
Aptitude, the Debian Package Manager is mainly targeted at binary
packages. To use source packages we'll need to use <prgn>apt-get</prgn>
instead.
Debian ăŽăăăąăźă¸ăăăźă¸ăŁă§ăă aptitude ăŻăăă¤ăăŞăăăąăźă¸ă
丝ăŞĺŻžčąĄă¨ăăŚăăžăăă˝ăźăšăăăąăźă¸ăćąăăŤăŻă䝣ăăăŤ
<prgn>apt-get</prgn> ă使ăĺż
čŚăăăă§ăăăă
ă˝ăźăšăăăąăźă¸ăăăŚăłăăźăăăăŤăŻă䝼ä¸ăŽăłăăłăă使ăăžă:
<p>
<example>
$ apt-get source packagename
</example>
<p>
ăăăŤăă 3 ă¤ăŽăăĄă¤ăŤăăăŚăłăăźăăăăžă: <tt>.orig.tar.gz</tt>ă
<tt>.dsc</tt>ă<tt>.diff.gz</tt> ă§ăăDebian ăă¤ăăŁăăăăąăźă¸ăŽ
ĺ ´ĺă3 çŞçŽăŽăăĄă¤ăŤăŻăăŚăłăăźăăăăăćĺăŽăăŽăé常ăŻăăĄă¤ăŤĺä¸ăŤ
<tt>"orig"</tt> ăŻäťăăžăăă
<p>
<tt>.dsc</tt> ăăĄă¤ăŤăŻădpkg-source ăă˝ăźăšăăăąăźă¸ă
<var>packagename-version</var> ăŽăăŁăŹăŻăăŞăŤĺąéăăăăăŤ
使ăăăžăăăăŚăłăăźăăăăĺă˝ăźăšăăăąăźă¸ăŤăŻă.deb ăăăąăźă¸ă
ä˝ăăăăŤĺż
čŚăŞăăĄă¤ăŤăĺŤăžăăŚăă <tt>debian/</tt> ăăŁăŹăŻăăŞă
ăăăžăă
<p>
ăăŚăłăăźăăăăăăąăźă¸ăčŞĺçăŤć§çŻăăăŤăŻă揥ăŽäžăŽăă
㍠<tt>-b</tt> ăăłăăłăăŠă¤ăłăŤäťĺ ăăžă:
<p>
<example>
$ apt-get -b source packagename
</example>
<p>
ăăŚăłăăźăć㍠.deb ăä˝ăăŞăăŽăŞăăăăŚăłăăźăăăăăăăąăźă¸ă
ăăăăŁăŹăŻăăŞĺ
ă§ćŹĄăŽăăăŤăăăă¨ă§ăĺžăăä˝ăăă¨ăă§ăăžăă
<p>
<example>
$ dpkg-buildpackage -rfakeroot -uc -b
</example>
<p>
Notice that to build most packages you'll need at least the following
packages: <package>devscripts</package>, <package>dpkg-dev</package>,
<package>debhelper</package>, <package>fakeroot</package>, take a look
at <ref id="install"> and install them before proceeding. Most
packages will also depend on compilation tools, so it may be useful to
install the <package>build-essential</package> package as well. Other
packages may be needed, take a look at <ref id="build-dep"> for more
information.
大ĺăŽăăăąăźă¸ăć§çŻăăăăăŤăŻăĺ°ăŞăă¨ă䝼ä¸ăŽăăăąăźă¸ăĺż
čŚă¨
ăŞăăă¨ăŤćł¨ćăăŚăă ăă: <package>devscripts</package>ă<package>dpkg-dev</package>ă
<package>debhelper</package>ă<package>fakeroot</package>ă
ĺ
ăŤé˛ăĺ㍠<ref id="install"> ăčŚăŚăăăăăă¤ăłăšăăźăŤăăŚăăăŚ
ăă ăăă大ĺăŽăăăąăźă¸ăŻăłăłăă¤ăŤç¨ăăźăŤăŤăäžĺăăŚăăăŽă§ă
<package>build-essential</package> ăăăąăźă¸ăă¤ăłăšăăźăŤăăŚăăă¨
彚çŤă¤ă§ăăăăăă䝼ĺ¤ăŽăăăąăźă¸ăĺż
čŚă¨ăŞăăăăăăžăăăăăă
芳ăăć
ĺ ąăŻ <ref id="build-dep"> ăĺç
§ăăŚăă ăăă
<p>
To install the package built by the commands above one must use the
package manager directly. Take a look at <ref id="manual-install">. A
useful tool is provided by the <package>devscripts</package> package:
<prgn>debi</prgn>. If you run <prgn>debi</prgn> from
inside the source package directory it will look for the
<tt>.changes</tt> file at the parent directory to discover what are
the binary packages the package produces and will run
<prgn>dpkg</prgn> to install all of them. While this is not very
useful if your source package produces conflicting packages, it might
be in most circumstances. Of course you need root powers in order to
perform this.
ä¸č¨ăŽăłăăłăă§ć§çŻăăăăăăąăźă¸ăă¤ăłăšăăźăŤăăăŤăŻăăăăąăźă¸
ăăăźă¸ăŁăç´ćĽä˝żăăŞăăă°ăŞăăžăăă<ref id="manual-install"> ăĺç
§
ăăŚăă ăăă<prgn>debi</prgn> ă¨ăăäžżĺŠăŞăăźăŤă <package>devscripts</package>
ăăăąăźă¸ă§ćäžăăăŚăăžăăă˝ăźăšăăăąăźă¸ăăŁăŹăŻăăŞĺ
ăăç´ćĽ
<prgn>debi</prgn> ăĺŽčĄăăă¨ă茪ăăŁăŹăŻăăŞăŤăă <tt>.changes</tt>
ăăĄă¤ăŤăć˘ăăăăŽăăăąăźă¸ăăä˝ăăăăă¤ăăŞăăăąăźă¸ăčŚă¤ăăă¨ă
ăăăăăšăŚăă¤ăłăšăăźăŤăăăă㍠<prgn>dpkg</prgn> ăĺŽčĄăăŚăăăžăă
ăăă˝ăźăšăăăąăźă¸ăčĄçŞăăăăăăąăźă¸çž¤ăä˝ăĺ ´ĺăŤăŻăăăťăŠäžżĺŠă¨
ăăăăă§ăŻăăăžăăăă大ĺăŽç°ĺ˘ă§ăŻäžżĺŠă§ăăăăăăĄăăăăăă
ĺŽčĄăăăŤăŻ root 樊éăĺż
čŚă§ăă
<p>
<prgn>apt-get</prgn> ㎠<tt>source</tt> ćĺŽă¨äťăŽćĺŽă¨ă§ăŻéăăăăăžăă
<tt>source</tt> ć示ăŻăä¸čŹăŚăźăśăŤăĺŽčĄĺŻč˝ă§ăçšĺĽăŞ root 樊éăŻ
ĺż
čŚăăăžăăăăăĄă¤ăŤăŻă<tt>apt-get source package</tt> ăĺŽčĄăăă
ăăŁăŹăŻăăŞăŤăăŚăłăăźăăăăžăă
</sect>
<sect id="build-dep">ă˝ăźăšăăăąăźă¸ăŽăłăłăă¤ăŤăŤĺż
čŚăŞăăăąăźă¸
<p>
é常ăă˝ăźăšăăăąăźă¸ăăłăłăă¤ăŤăăăŤăŻăçšĺŽăŽăăăăĺ
ąć
ăŠă¤ăăŠăŞăĺĺ¨ăăăă¨ăĺż
čŚă§ăăĺ
¨ă˝ăźăšăăăąăźă¸ăŤăŻăăăŽ
ăłăłăăăźăŤăăĄă¤ăŤä¸ăŤ 'Build-Depends' ă¨ăăăăŁăźăŤăăăăăžăă
ăăăŻăăăŽăăăąăźă¸ăă˝ăźăšăăć§çŻăăéăŤăĺż
čŚă¨ăŞăčż˝ĺ
ăăăąăźă¸ă示ăăŚăăžăă
Some basic packages are also needed, check <ref id="source">
before continuing.
ăăă¤ăăŽĺşćŹăăăąăźă¸ăĺż
čŚă¨ăŞăă§ăăăăăăĺ
ăŤé˛ăĺăŤ
<ref id="source"> ăăă§ăăŻăăŚăă ăăă
<p>
APT ăŻăăăăŽăăăąăźă¸ăăăŚăłăăźăăăç°ĄĺăŞćšćłăćăĄĺăăăŚăăžăă
ĺ㍠<tt>apt-get build-dep package</tt> ăĺŽčĄăăă ăă§ăă'package' ăŽçŽć
ăŻăć§çŻăăăăăăąăźă¸ăŽĺĺă§ăăăă¨ăă°:
<p>
<example>
# apt-get build-dep gmc
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
comerr-dev e2fslibs-dev gdk-imlib-dev imlib-progs libgnome-dev libgnorba-dev
libgpmg1-dev
0 packages upgraded, 7 newly installed, 0 to remove and 1 not upgraded.
Need to get 1069kB of archives. After unpacking 3514kB will be used.
Do you want to continue? [Y/n]
</example>
<p>
ă¤ăłăšăăźăŤăăăăŽăŻă<package>gmc</package> ăćŁăăć§çŻăăăăăŤ
ĺż
čŚăŞăăăąăźă¸ă§ăăăăŽăłăăłăăŻăć§çŻăăăăăă°ăŠă ăŽă˝ăźăš
ăăăąăźă¸ăć˘ăăŞăăă¨ăŤćł¨ćăăŚăă ăăăăăăăŁăŚăăăăĺ
Ľćăă
ăŽăŤĺĽé <tt>apt-get source</tt> ăĺŽčĄăăĺż
čŚăăăăžăă
<p>
If all you want is checking what packages are needed to build a
given package, there's a <tt>showpkg</tt> method for <prgn>apt-cache</prgn>
command (see <ref id="search">, which will show, among other
informations, the <tt>Build-Depends</tt> line that lists those
packages.
ćĺŽăŽăăăąăźă¸ăć§çŻăăăŽăŤĺż
čŚăŞăăăąăźă¸ă調ăšăăă ăăŞăă
<prgn>apt-cache</prgn> ăłăăłă㎠<tt>showpkg</tt> ăĄă˝ăăăăă
ăžă (<ref id="search"> ăĺç
§)ăăăăŻäťăŽć
ĺ ąăŤĺ ăăć§çŻăŤĺż
čŚăŞ
ăăăąăźă¸ăč¨čźăăăŚăă <tt>Build-Depends</tt> čĄă襨示ăăžăă
<p>
<example>
# apt-cache showsrc <var>package</var>
</example>
</sect>
<sect id="source-debuging">Building a debuging package
<p>
If you want to build a package for debuging purposes to, for
example, report a bug -- or fix one, you can use simple environment
variables that are supported by most Debian packages.
ăă¨ăă°ăă°ĺ ąĺă -- ăăăăŻăăŽäżŽćŁç¨ă¨ăăŚăăăăă°çŽçă§ăăăąăźă¸ă
ć§çŻăăăăă°ă大ĺ㎠Debian ăăăąăźă¸ă寞ĺżăăŚăăăˇăłăăŤăŞç°ĺ˘ĺ¤ć°ă
使ăăă¨ăă§ăăžăă
<p>
To build a package which contains unstriped binaries<footnote>Debian
usually strips all the binaries and libraries it ships. That means
that all the debug symbols are removed.</footnote> all you need to do
is prefix it with <tt>DEB_BUILD_OPTIONS=nostrip</tt>. Optimizations
can also make debuging harder, so you can disable them by adding
the <tt>noopt</tt> string to the DEB_BUILD_OPTIONS variable
too. Example:
ăšăŞă ĺăăăŚăăŞăăă¤ăăŞ<footnote>é常 Debian ăŻăé
ĺ¸ăŤăăăŁăŚ
ĺ
¨ăă¤ăăŞă¨ăŠă¤ăăŠăŞăăšăŞă ĺăăžăăăăăŻăăšăŚăŽăăăă°ç¨ăˇăłăăŤă
ĺé¤ăăăăă¨ăćĺłăăžăă</footnote>ăĺŤăăăăąăźă¸ăć§çŻăăăăă°ă
ăăăăă <tt>DEB_BUILD_OPTIONS=nostrip</tt> ă¨ćĺŽăăă ăă§ăă
ăžăćéŠĺăăăăă°ăĺ°éŁăŤăăžăăăç°ĺ˘ĺ¤ć° DEB_BUILD_OPTIONS ăŤ
<tt>noopt</tt> ă¨ăăćĺĺăčż˝ĺ ăăă°ăăăăçĄĺšăŤă§ăăžăăäžă
揥ăŤç¤şăăžă:
<p>
<example>
$ DEB_BUILD_OPTIONS="nostrip noopt" dpkg-buildpackage -rfakeroot -uc -b
</example>
</sect>
<sect id="changing-source">Customizing package build options
<sect id="changing-source">ăăăąăźă¸ć§çŻăŞăăˇă§ăłăŽăŤăšăżăă¤ăş
<p>
If what you want is to customize the way the package is built
you'll have to go about editing the <file>debian/rules</file> file.
This means: inside the main directory created when the source package
is extracted there will be a <tt>debian</tt> directory, which contains
many files. One of them is special: the <file>rules</file> file.
ăăăąăźă¸ć§çŻăŽćšćłăăŤăšăżăă¤ăşăăăăă°ă<file>debian/rules</file>
ăăĄă¤ăŤăŽçˇ¨éăŤĺăăăăĺż
čŚăăăă§ăăăăă¤ăžăăă˝ăźăšăăăąăźă¸
ĺąéćăŤä˝ćăăăăĄă¤ăłăăŁăŹăŻăăŞĺ
ăŤăŻ <tt>debian</tt> ă¨ăăăăŁăŹăŻăăŞ
ăăăăăăŽä¸ăŤăŻĺ¤ć°ăŽăăĄă¤ăŤăĺŤăžăăŚăăžăăăăŽä¸ăŽ 1 ă¤ăŻçšĺĽăŞ
ăăŽă§ă: ăă㯠<file>rules</file> ă¨ăăăăĄă¤ăŤă§ăă
<p>
This file is usually a Makefile that has targets to configure, build,
install and create the package. For example, if I want to have
the <package>luola</package><footnote>A very nice ship-fighting
game that lacks network play. Any takers? =)</footnote> built without
sound I can, after downloading and extracting its source edit
the <file>debian/rules</file> file that looks like this:
ĺăăĄă¤ăŤăŻ Makefile ăŽăăăŞăăŽă§ăé常ăŻăăăąăźă¸ăŽč¨ĺŽăć§çŻă
ă¤ăłăšăăźăŤăä˝ćăŤé˘ăăăżăźă˛ăăăč¨ăăăŚăăžăăăă¨ăă°
<package>luola</package><footnote>ă¨ăŚă漽ăăéŁčĄčšăŽćŚéă˛ăźă ă§ă
ăăăăŻăźăŻĺŻžćŚćŠč˝ăŻăăăžăăă誰ăćăćăăžăăă? =)</footnote>
ăăľăŚăłăćŠč˝çĄăă§ć§çŻăăăăă°ăă˝ăźăšăăăŚăłăăźăăăŚĺąéăăĺžă
<file>debian/rules</file> ăăĄă¤ăŤă揥ăŽăăăŤçˇ¨éă§ăăžă:
<p>
<example>
[...]
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
./configure $(confflags) \
--prefix=/usr \
--mandir=share/man \
--infodir=share/info \
--datadir=share/games \
--bindir=games \
--enable-sound
# --enable-sdl-gfx
touch configure-stamp
[...]
</example>
<p>
See the <tt>--enable-sound</tt> switch? If I remove it or replace
it with <tt>--disable-sound</tt> and then rebuild the package using
the technique described on <ref id="source"> I'll have a luola package
that is built with no sound.
<tt>--enable-sound</tt> ăŽăšă¤ăăăčŚăŚăă ăăăăăăĺé¤ăăăă
ăăă㯠<tt>--disable-sound</tt> ă¨ĺ¤ć´ăăăăăă <ref id="source">
ă§čż°ăšăćă使ăŁăŚăăăąăźă¸ăĺć§çŻăăă°ăăľăŚăłăçĄăă§ć§çŻăăă
luola ăăăąăźă¸ăćăŤĺ
Ľăăžăă
<p>
If you really want to work with source packages on a daily basis I
would suggest reading the <url
id="http://www.debian.org/doc/maint-guide/" name="Debian New
Maintainers Guide"> and the <url
id="http://www.debian.org/doc/debian-policy/" name="Debian Policy">,
mainly. Other documentation available from the <url
id="http://www.debian.org/devel/" name="Debian Developers Corner"> may
be useful too.
ă˝ăźăšăăăąăźă¸ăćąăä˝ćĽăćŻćĽăăăă¨ĺżăăćăă§ăăăŽăŞăă
<url id="http://www.debian.org/doc/maint-guide/" name="Debian New Maintainers Guide">
㨠<url id="http://www.debian.org/doc/debian-policy/" name="Debian Policy"> ă
丝ăŤčŞăăă¨ăĺ§ăăžăă
<url id="http://www.debian.org/devel/" name="Debian Developers Corner"> ăă
ĺ
Ľćă§ăăäťăŽćć¸ăă彚ăŤçŤă¤ă§ăăăă
</sect>
<sect id="equivs">But hey, I do not want to use the Debian stuff!
<sect id="equivs">ă§ăăăĺ㯠Debian ăŽăăźăŤă使ăăăăŞăăă !
<p>
Sometimes, people want to use a specific version of a program
available only on source code, with no Debian package. But the
packaging system can be a trouble when doing this. Suppose
you want to compile a new version of your email server. All
is fine, but many packages in Debian depend on an MTA (Mail
Transport Agent). Since you installed something you compiled
by yourself, the packaging system doesn't know about it.
ăă°ăă°ăă˝ăźăšăłăźăă§ăŽăżĺ
ĽćĺŻč˝ă§ Debian ăăăąăźă¸ăĺĺ¨ăăŞă
çšĺŽăăźă¸ă§ăłăŽăăă°ăŠă ă使ăăăăŞăăă¨ăăăăžăăăăăăăă
ăăăă¨ăăă¨ăăăăąăźă¸ăłă°ăˇăšăă ăŤăăŠăăŤă辡ăăăăăăăžăăă
éťĺăĄăźăŤăľăźăăŽć°ăăźă¸ă§ăłăăłăłăă¤ăŤăăăăŞăŁăă¨ćłĺăăŚăżăŚ
ăă ăăăăăšăŚăăžăăăăžăăăăDebian ăŽĺ¤ăăŽăăăąăźă¸ăŻ
MTA (ăĄăźăŤčť˘éă¨ăźă¸ă§ăłă) ăŤäžĺăăŚăăžăăăłăłăă¤ăŤăăăăŽă
ĺćăŤă¤ăłăšăăźăŤăăŚăăžăă¨ăăăăąăźă¸ăłă°ăˇăšăă ăŻăăŽăă¨ă
çĽăăă¨ăă§ăăžăăă
<p>
That's where <package>equivs</package> enters the scene. To use it,
install the package with that name. Equivs creates an empty package
that fulfills dependencies, making the package system believe that
the dependencies are satisfied.
ăă㧠<package>equivs</package> ăçťĺ ´ăăĺ ´é˘ă¨ăŞăăžăăăăăă
使ăăŤăŻăĺĺăŽăăăąăźă¸ăă¤ăłăšăăźăŤăăŚăă ăăăequivs ăŻäžĺ
é˘äżă ăăŽçŠşăŽăăăąăźă¸ăä˝ćăăăăăąăźă¸ăˇăšăă ăŤäžĺé˘äżă
ćşăăăăŚăăă¨äżĄăčžźăžăăžăă
<p>
Before we begin, it is good to remind you that there are safer
ways of compiling a program which is already packaged for Debian
with different options, and that one should not use equivs to
replace dependencies if she doesn't know what she is doing.
See <ref id="source"> for more information.
ĺ§ăăăŤăăăŁăŚăăă§ăŤ Debian ăăăąăźă¸ă¨ăŞăŁăŚăăăăă°ăŠă ă
ç°ăŞăăŞăăˇă§ăłă§ăłăłăă¤ăŤăăăŤăŻăăŁă¨ĺŽĺ
¨ăŞćšćłăăăăčŞĺăŽ
ăăŁăŚăăăă¨ăç解ăăŚăăŞăăăăăäžĺé˘äżă罎ăćăăăăăŤ
equivs ă使ăăšăă§ăŞăă¨ăăăă¨ăćăĺşăăŚăă ăăăăă芳ăă
ć
ĺ ąăŻă<ref id="source"> ăĺç
§ăăŚăă ăăă
<p>
Let's continue with the MTA example, you just installed your
new compiled <prgn>postfix</prgn> and goes on for installing
<package>mutt</package>. Suddenly you discover that
<package>mutt</package> wants to install another MTA. But you
already have yours.
MTA ăŽäžăçśăăăă¨ăŤăăžăăăăć°ăăŤăłăłăă¤ăŤăă <prgn>postfix</prgn> ăŽ
ă¤ăłăšăăźăŤăçľăăă揥㍠<package>mutt</package> ăŽă¤ăłăšăăźăŤ
ăŤĺăăăăăă¨ăăŚăăžăăă¨ăăŽçŹéă<package>mutt</package> ă
ĺĽăŽ MTA ăă¤ăłăšăăźăŤăăăăŁăŚăăăă¨ăŤć°ăĽăăžăăăă§ăă
ăă§ăŤăăăŞăĺ°ç¨ăŽ MTA ăŻă¤ăłăšăăźăŤăăăŚăăăŽă§ăă
<p>
Go to some directory (<file>/tmp</file>, for example) and run:
ăŠăăăŽăăŁăŹăŻă㪠(ăă¨ăă° <file>/tmp</file>) ăŤç§ťăŁăŚă揥ăŽ
ăăăŤĺŽčĄăăŚăżăŚăă ăă:
<p>
<example>
# equivs-control <var>name</var>
</example>
<p>
Replace <var>name</var> for the name of the control file you
want to create. The file will be created as the following:
<var>name</var> ăŽçŽćăŻăä˝ćăăă control ăăĄă¤ăŤăŽĺĺă§
罎ăćăăŚăă ăăăĺăăĄă¤ăŤă揥ăŽăăăŤä˝ćăăăă§ăăăă
<p>
<example>
Section: misc
Priority: optional
Standards-Version: 3.5.10
Package: <enter package name; defaults to equivs-dummy>
Version: <enter version here; defaults to 1.0>
Maintainer: Your Name <yourname@xxxxxxx>
Pre-Depends: <packages>
Depends: <packages>
Recommends: <packages>
Suggests: <package>
Provides: <(virtual)package>
Architecture: all
Copyright: <copyright file; defaults to GPL2>
Changelog: <changelog file; defaults to a generic changelog>
Readme: <README.Debian file; defaults to a generic one>
Extra-Files: <additional files for the doc directory, commaseperated>
Description: <short description; defaults to some wise words>
long description and info
.
second paragraph
</example>
<p>
We just need modify this to do what we want. Have a look at
the field's format and at their descriptions, there's no need
to explain each one here, let's look at an example instead:
ăă¨ăŻăăăăćăżăŠăăăŤäżŽćŁăăă ăă§ăăăăŁăźăŤăăŽć¸ĺźă¨ăăŽ
č¨čż°ĺ
厚ăŤçŽăĺăăŚăă ăăăĺă
ă誏ćăăĺż
čŚăŻăŞăă§ăăăă
䝣ăăăŤćŹĄăŽäžăčŚăŚăă ăă:
</p>
<p>
<example>
Section: misc
Priority: optional
Standards-Version: 3.0.1
Package: mta-local
Conflicts: mail-transport-agent
Replaces: mail-transport-agent
Provides: mail-transport-agent
</example>
</p>
<p>
Yes, that's all. <package>mutt</package> depends on
<package>mail-transport-agent</package>, that is a virtual
package provided by all MTAs, mta-local "registers" itself
as an mail-transport-agent using the Provides field.
ăžăŁăăăăăă ăăŞăŽă§ăă<package>mutt</package> ăŻăĺ
¨ MTA ă
ćäžăă <package>mail-transport-agent</package> ă¨ăă䝎ćłăăăąăźă¸
ăŤäžĺăăžăămta-local ăŻăProvides ăăŁăźăŤăă使ăŁăŚčŞăă
mail-transport-agent ă¨ă㌠"çťé˛" ăăŚăăžăă
</p>
<p>
The <tt>Conflicts</tt> and <tt>Replaces</tt> fields are needed, too,
so that <prgn>APT</prgn> and <prgn>dpkg</prgn> will understand they
should remove the currently installed MTA package in favour of the new
one you're installing.
<tt>Conflicts</tt> ăăăł <tt>Replaces</tt> ăăŁăźăŤăăĺż
čŚă§ăă
ăăăăŤăăăăăŞăăă¤ăłăšăăźăŤăăć°ăăăąăźă¸ăĺŞĺ
ăăăăăăŤ
çžĺ¨ă¤ăłăšăăźăŤć¸ăżăŽ MTA ăăăąăźă¸ăĺé¤ăăŞăăă°ăŞăăŞăăă¨ă
<prgn>APT</prgn> ă <prgn>dpkg</prgn> ăç解ăăă§ăăăă
</p>
<p>
Now you only need to build the package:
ăăăăă¨ăŻăăăąăźă¸ăć§çŻăăă ăă§ă:
</p>
<p>
<example>
# equivs-build <var>name</var>
dh_testdir
touch build-stamp
dh_testdir
dh_testroot
dh_clean -k
# Add here commands to install the package into debian/tmp.
touch install-stamp
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package `<var>name</var>' in `../<var>name</var>_1.0_all.deb'.
The package has been created.
Attention, the package has been created in the current directory,
</example>
<p>
And install the resulting <tt>.deb</tt>. See <ref id="manual-install">.
ăăăŚä˝ćăăă <tt>.deb</tt> ăă¤ăłăšăăźăŤăăŚăă ăăă芳細ăŻ
<ref id="manual-install"> ăĺç
§ă
<p>
As one can see, there are several uses for <prgn>equivs</prgn>. One
can even create a <tt>my-favorites</tt> package, which depends on
the programs you usually installs, for example. Just free your imagination,
although being careful.
ăăăăăŤăŞăă¨ăăă<prgn>equivs</prgn> ăŤăŻăăžăăžăŞä˝żăćšăăăăžăă
ăă¨ăă°ăćŽćŽľă¤ăłăšăăźăŤăăăăă°ăŠă ăŤäžĺăă <tt>my-favorites</tt>
ăăăąăźă¸ăăä˝ćă§ăăžăăćłĺăŽçżźăćĄăăŚăă ăăăă§ăăç¨ĺżăăĺżă
ăŞăă
<p>
It is important to note that there are example control files in
<file>/usr/share/doc/equivs/examples</file>. Check them out.
éčŚăŞćł¨ćă§ăăă<file>/usr/share/doc/equivs/examples</file> ăŤăŻ
control ăăĄă¤ăŤăŽčŚćŹăăăăžăăăă˛ăăă調ăšăŚăżăŚăă ăăă
</sect>
</chapt>
<chapt id="search">ăăăąăźă¸ć
ĺ ąăŽĺ
Ľć
<p>
APT ăˇăšăă ăŤăŻăăăăąăźă¸ăĺąăăŚăăăťăŻăˇă§ăłăéčŚĺşŚăăăŽ
ĺ
厚誏ćăŞăŠăčŚăăăăŽăăăłăă¨ăłăăăă°ăŠă ă¨ĺć§ăŤăă¤ăłăšăăźăŤ
ĺŻč˝ăăăăăŻă¤ăłăšăăźăŤć¸ăżăŽăăăąăźă¸ä¸čŚ§ăăăăăŚĺŽšćăŤĺ
Ľćăă
ăăăŽăăăłăă¨ăłăăăă°ăŠă ăăăă¤ăăăăžăă
<p>
ă§ăă... ăăă§ăŽćă
ăŽçŽç㯠APT ćŹä˝ăŽä˝żăćšăĺŚăśăă¨ă§ăăăăŁăŚă
ă¤ăłăšăăźăŤăăăăăăąăźă¸ĺăčŚă¤ăăăŤăŻăŠăăăă°čŻăăŽă§ăăăă?
<p>
ăăăăăăăăŽçŤ ăçăăăă¨ćăŁăŚăăăă¨ă§ăăćă
ăŽé¸ćč˘ăčŚăŚăżăăă¨ăŤăăžăăăă
<sect id="cache">ăăăąăźă¸ĺăŽçşčŚ
<p>
ăă¨ăă°ăć§ăčŻă Atari 2600 ăŽćĽă
ăŤă¤ăăŚĺćłăŤč˝ăăăă¨ăăžăăăă
APT ă使ăŁăŚ Atari ă¨ăăĽăŹăźăżăă¤ăłăšăăźăŤăăăăă¤ăăŽă˛ăźă ă
ăăŚăłăăźăă§ăăžăă揥ăŽăăăŤăăŚăă ăă:
<p>
<example>
$ aptitude search atari
p atari-fdisk-cross - Partition editor for Atari (running on no
p atari800 - Atari emulator for X/curses/SDL
p console-keymaps-atari - Keymaps for Atari keyboards.
</example>
<p>
We find several packages related to what we're looking for, together
with brief descriptions. The <tt>p</tt> letter at the beginning of the
line is similar to the notation used inside the curses UI aptitude
uses. It means, thus, that the package is not installed. Important to
notice that aptitude only searches package names by default. You can
use all the search options provided by aptitude, which you can
discover by reading the aptitude's User Manual. To search the
descriptions, for example, you could use:
ć˘ăăŚăăăăŽăŤé˘éŁăăăăăăŞăăăąăźă¸ăăăă¤ăăăăç°Ąć˝ăŞčŞŹććă
ăăăžăăčĄé ㎠<tt>p</tt> ă¨ăăćĺăŻăaptitude ㎠curses UI ĺ
ă§
使ăăăŚăă襨č¨ćłăŤäźźăŚăăžăăăăŁăŚăăăăŻĺ˝čŠ˛ăăăąăźă¸ăă¤ăłăšăăźăŤ
ăăăŚăăŞăăă¨ăćĺłăăžăăaptitude ăŻăăăăŠăŤăă§ăŻăăăąăźĺă ăă
ć¤ç´˘ăăăă¨ăŤćł¨ćăăŚăă ăăăaptitude ăćäžăăăăšăŚăŽć¤ç´˘ăŞăăˇă§ăłă
使ç¨ă§ăăžăăăăăăŤă¤ăăŚăŻ aptitude ăŽăŚăźăśăăăĽă˘ăŤăčŞăă§ăă ăăă
ăă¨ăă°ă誏ćé¨ăć¤ç´˘ăăăŤăŻćŹĄăŽăăăŤăăžă:
<p>
<example>
$ aptitude search ~datari
p aranym - Atari Running on Any Machine
p atari-fdisk-cross - Partition editor for Atari (running on no
p atari800 - Atari emulator for X/curses/SDL
p circuslinux - The clowns are trying to pop balloons to
p circuslinux-data - Data files for circuslinux
p console-keymaps-atari - Keymaps for Atari keyboards.
[...]
p stella - Atari 2600 Emulator for SDL & X windows
[...]
</example>
<p>
ăăŽăăăŤăăăĺ¤ăăŽăăăąăźă¸ăčżăăăžăăăćă
ăŽĺéĄă解湺ăăŚăăăăăŞ
ăăŽăŽä¸čŚ§ăčŚă¤ăăăăăŽă§ăăăŽä¸ăŤăă桹ăĺ
ĽăŁăŚăżăăă¨ăŤăăžăăă:
<p>
<example>
$ aptitude show stella
Package: atari-fdisk-cross
Version: 0.7.1-5
Priority: extra
Section: otherosfs
Maintainer: Roman Hodek <roman@xxxxxxxxx>
Uncompressed Size: 106k
Description: Partition editor for Atari (running on non-Atari)
Atari-fdisk allows you to create and edit the partition table of a disk
partitioned in Atari format. It supports both the AHDI 5.0 and ICD variations
of the Atari format. It is an interactive tool with a menu similar to PC
fdisk, and also supports most options of PC fdisk.
</example>
<p>
ăăŽĺşĺăăăă¤ăłăšăăźăŤăăă (ăăăăŻăăăăŞă) ăăăąăźă¸ăŽ
芳細ăĺžăăă¨ăă§ăăăăŽăăăąăźă¸ăŽĺŽĺ
¨ăŞčŞŹććăăăăžăă
ăăŽăăăŞć
ĺ ąăĺžăăŽăŤă<prgn>apt-cache</prgn> ăăă°ăŠă ă使ăăă¨ă
ă§ăăžăăăăŽăăźăŤăé¸ăśă¨ăăăăąăźă¸ăŽč¤ć°ăŽĺŠç¨ĺŻč˝ăŞăăźă¸ă§ăłă
襨示ă§ăăžăăăă¨ăă°:
<p>
<example>
$ apt-cache show muine
Package: muine
Version: 0.5.0-1
Priority: optional
Section: gnome
Maintainer: Link Dupont <link@xxxxxxxxxx>
Depends: gstreamer-gconf (>= 0.6.4), libatk1.0-0 (>= 1.4.1), libbonobo2-0 (>= 2.4.3), libc6 (>= 2.3.2.ds1-4), libflac4, libgconf2-4 (>= 2.4.0.1), libgdbm3, libglib2.0-0 (>= 2.2.3), libgnomevfs2-0 (>= 2.4.1), libgnomevfs2-common (>= 2.4.1), libgstreamer0.6-0 (>= 0.6.1-2), libgtk2.0-0 (>= 2.2.1), libid3tag0 (>= 0.15.0b), libogg0 (>= 1.1.0), liborbit2 (>= 1:2.8.0), libpango1.0-0 (>= 1.2.1), libvorbis0a (>= 1.0.1), libvorbisfile3 (>= 1.0.1), libxml2 (>= 2.6.7), zlib1g (>= 1:1.2.1), gconf2 (>= 2.4.0), mono-jit (>= 0.30) | cli-virtual-machine, gtk-sharp (>= 0.17), gconf-sharp (>= 0.17), gnome-sharp (>= 0.17)
Architecture: i386
Filename: ./pool/main/m/muine/muine_0.5.0-1_i386.deb
Size: 164314
Installed-Size: 692
MD5sum: 9885f13e5ef4f76b3bf6fe7bb3ea8634
Description: Simple music player
Muine is an innovative music player. It has a simple interface designed to
allow the user to easily construct playlists from albums and/or single songs.
Its goal is to be simply a music player, not to become a robust music
management application.
Package: muine
Priority: optional
Section: gnome
Installed-Size: 492
Maintainer: Link Dupont <link@xxxxxxxxxx>
Architecture: i386
Version: 0.4.0-8
Depends: gstreamer-gconf (>= 0.6.4), libatk1.0-0 (>= 1.4.1), libbonobo2-0 (>= 2.4.3), libc6 (>= 2.3.2.ds1-4), libflac4, libgconf2-4 (>= 2.4.0.1), libgdbm3, libglib2.0-0 (>= 2.2.3), libgnomevfs2-0 (>= 2.4.1), libgnomevfs2-common (>= 2.4.1), libgstreamer0.6-0 (>= 0.6.1-2), libgtk2.0-0 (>= 2.2.1), libid3tag0 (>= 0.15.0b), libogg0 (>= 1.1.0), liborbit2 (>= 1:2.8.0), libpango1.0-0 (>= 1.2.1), libvorbis0a (>= 1.0.1), libvorbisfile3 (>= 1.0.1), libxml2 (>= 2.6.6), zlib1g (>= 1:1.2.1), gconf2 (>= 2.4.0), mono-jit (>= 0.30) | cli-virtual-machine, gtk-sharp (>= 0.16), gconf-sharp (>= 0.16), gnome-sharp (>= 0.16)
Filename: pool/main/m/muine/muine_0.4.0-8_i386.deb
Size: 139864
MD5sum: e746709ad6a6fcc1e9c46b46b3d6e5b2
Description: Simple music player
Muine is an innovative music player. It has a simple interface designed to
allow the user to easily construct playlists from albums and/or single songs.
Its goal is to be simply a music player, not to become a robust music
management application.
</example>
<p>
ăăăąăźă¸ăŤé˘ăăä¸čŹçăŞć
ĺ ąăĺžăăŤăŻă揥ăŽăăăŤăăžă:
<p>
<example>
# apt-cache showpkg penguin-command
Package: penguin-command
Versions:
1.4.5-1(/var/lib/apt/lists/download.sourceforge.net_debian_dists_unstable_main_binary-i386_Packages)(/var/lib/dpkg/status)
Reverse Depends:
Dependencies:
1.4.5-1 - libc6 (2 2.2.1-2) libpng2 (0 (null)) libsdl-mixer1.1 (2 1.1.0) libsdl1.1 (0 (null)) zlib1g (2 1:1.1.3)
Provides:
1.4.5-1 -
Reverse Provides:
</example>
<p>
ăăăŤăŠăŽăăăąăźă¸ăŤäžĺăăŚăăăŽăăčŚăăŤăŻ:
<p>
<example>
# apt-cache depends penguin-command
penguin-command
Depends: libc6
Depends: libpng2
Depends: libsdl-mixer1.1
Depends: libsdl1.1
Depends: zlib1g
</example>
<p>
ăžă¨ăăă¨ăćă
ăŻćŹ˛ăăăăăąăźă¸ĺăć˘ăăŽăŤä˝żăăĺ¤ć§ăŞćŚĺ¨ăćăŁăŚ
ăăăă¨ăŤăŞăăžăă
</sect>
<sect id="dpkg-search">dpkg ă使ăŁăŚăăăąăźă¸ĺăć˘ă
<p>
ăăăąăźă¸ĺăçšĺŽăăćšćłăŽä¸ă¤ăŤăăăăąăźă¸ä¸ăŽéčŚăŞăăĄă¤ăŤĺă
çĽăŁăŚăăĺ ´ĺăăăăžăăăă¨ăă°ăçšĺŽăŽ <tt>".h"</tt> ăăĄă¤ăŤăăŞăă¨
ăłăłăă¤ăŤă§ăăŞăĺ ´ĺă揥ăŽăăăŤăăžăă
<p>
<example>
# dpkg -S stdio.h
libc6-dev: /usr/include/stdio.h
libc6-dev: /usr/include/bits/stdio.h
perl: /usr/lib/perl/5.6.0/CORE/nostdio.h
</example>
<p>
ăăăăŻ:
<p>
<example>
# dpkg -S /usr/include/stdio.h
libc6-dev: /usr/include/stdio.h
</example>
<p>
Notice that this method only works to find package names of packages
that are installed in your system. You'll have to use
<prgn>auto-apt</prgn> (see <ref id="auto-apt">) or
<prgn>apt-file</prgn> (see <ref id="apt-file">) to search for files on
packages which are not installed. You can also take a look at the <url
id="http://packages.debian.org/" name="http://packages.debian.org/">
website.
ăăŽććłăŻăăˇăšăă ăŤă¤ăłăšăăźăŤăăăŚăăăăăąăźă¸ăŽĺĺăć˘ă
ĺ ´ĺăŤăŽăżĺ˝šçŤă¤ăă¨ăŤćł¨ćăăŚăă ăăăă¤ăłăšăăźăŤăăăŚăăŞă
ăăăąăźă¸ĺ
ăŽăăĄă¤ăŤăć¤ç´˘ăăăŤăŻă
<prgn>auto-apt</prgn> (<ref id="auto-apt"> ăĺç
§) ăăăăăŻ
<prgn>apt-file</prgn> (<ref id="apt-file"> ăĺç
§) ă使ăĺż
čŚăăă
ă§ăăăăăăăŤ
<url id="http://packages.debian.org/" name="http://packages.debian.org/"> ă
ĺç
§ăăăă¨ăă§ăăžăă
ăˇăšăă ăŤă¤ăłăšăăźăŤć¸ăżăŽăăăąăźă¸ĺăć˘ăă¨ăăăäžżĺŠă§ăăăă¨ăă°ă
ăăźăăăŁăšăŻăćé¤ăăăăŞă揥ăŽăăăŤăăžăă
<p>
<example>
$ dpkg -l | grep mozilla
ii mozilla-browse 0.9.6-7 Mozilla Web Browser
</example>
<p>
ăăŽăłăăłăăŽĺéĄçšăŻăăăăąăźă¸ĺă "éĺăăŚ" ăăžăăă¨ă§ăă
ä¸č¨ăŽäžă ă¨ăăăăąăźă¸ăŽćŹĺ˝ăŽĺĺ㯠<tt>mozilla-browser</tt> ă§ăă
ăăăŤĺŻžĺŚăăăŤăŻă揥ăŽăăăŤç°ĺ˘ĺ¤ć° <tt>COLUMNS</tt> ă使ăăă¨ăă§ăăžă:
<p>
<example>
$ COLUMNS=132 dpkg -l | grep mozilla
ii mozilla-browser 0.9.6-7 Mozilla Web Browser - core and browser
</example>
</sect>
<sect id="apt-file">How to discover to which package a file belongs
<sect id="apt-file">ăăăăĄă¤ăŤăĺŤăžăăŚăăăăăąăźă¸ăŽčŚă¤ăćš
<p>
If you want to install a package, and you can't find out what it is
called by searching with <prgn>apt-cache</prgn>, but know the filename
of the program itself, or some other filename that belongs to the package,
then you can use <prgn>apt-file</prgn>, which is included in the package
of same name to find the package name. This is done like this:
ăăăăăąăźă¸ăă¤ăłăšăăźăŤăăăăă<prgn>apt-cache</prgn> ă§ć¤ç´˘
ăăŚăćŁĺźăŞăăăąăźă¸ĺăĺ¤ăăŞăă¨ăăžăăăăăăăă°ăŠă čŞä˝ăŽ
ăăĄă¤ăŤĺăăăăŽăăăąăźă¸ăŤĺŤăžăăäťăŽăăĄă¤ăŤĺăçĽăŁăŚăăăŽăŞăă
<prgn>apt-file</prgn> ă使ăăă¨ăă§ăăžăăăăăŻĺĺăŽăăăąăźă¸ăŤ
ĺŤăžăăŚăăăăăăąăźă¸ĺăć˘ăăăăŽăăŽă§ăă揥ăŽăăăŤä˝żç¨ăăžă:
<p>
<example>
$ apt-file search <var>filename</var>
</example>
<p>
It works just like <tt>dpkg -S</tt>, but will also show you uninstalled
packages that contain the file. It could also be used to find what
packages contain necessary include files that are missing when
compiling programs, although <prgn>auto-apt</prgn> is a much better
method of solving such issues, see <ref id="auto-apt">.
<tt>dpkg -S</tt> ăŤäźźăĺä˝ăăăžăăăçĽăŁăŚăăăăĄă¤ăŤăĺŤă
ćŞă¤ăłăšăăźăŤăŞăăăąăźă¸ă襨示ăăžăăăăă°ăŠă ăŽăłăłăă¤ăŤćăŤ
ćŹ ăăŚăăăĺż
čŚăŞă¤ăłăŻăŤăźăăăĄă¤ăŤăĺŤăăăăąăźă¸ăć˘ăăŽăŤă
使ç¨ă§ăăžăăă§ăăăăŽăăăŞĺéĄăŽč§ŁćąşăŤăŻă<prgn>auto-apt</prgn>
ăŽćšăăŻăăăŤéŠĺă§ăăăă<ref id="auto-apt"> ăĺç
§ăăŚăă ăăă
<p>
You can also list the contents of a package, by running:
揥ăŽăăăŤĺŽčĄăăă°ăăăăąăźă¸ăŽĺ
厚ăä¸čŚ§čĄ¨ç¤şă§ăăžă:
<p>
<example>
$ apt-file list <var>packagename</var>
</example>
<p>
<prgn>apt-file</prgn> keeps a database of which files all packages
contain, just like auto-apt does and it needs to be up-to-date.
This is done by running:
<prgn>apt-file</prgn> ăŻĺ
¨ăăăąăźă¸ăŤĺŤăžăăăăĄă¤ăŤăŽăăźăżăăźăšă
äżćăăŚăăăauto-apt ă¨ĺăăăăŤć´ć°ăăĺż
čŚăăăăžăăăăăŤăŻćŹĄăŽ
ăăăŤĺŽčĄăăžă:
<p>
<example>
# apt-file update
</example>
<p>
By default, <prgn>apt-file</prgn> uses the same database
<prgn>auto-apt</prgn> is using, see <ref id="auto-apt">.
ăăăŠăŤăă§ăŻă<prgn>apt-file</prgn> 㯠<prgn>auto-apt</prgn> ă
使ăŁăŚăăăŽă¨ĺăăăźăżăăźăšă使ç¨ăăžăă<ref id="auto-apt"> ă
ĺç
§ăăŚăă ăăă
</sect>
<sect id="info-web">Information about packages on the Web
<sect id="info-web">ăăăąăźă¸ăŤé˘ăăăŚă§ăä¸ăŽć
ĺ ą
<p>
There are lots of web resources with informations about the packages
available in the Debian distribution, most of them directed mainly
towards Debian Developers, but many of them may be useful for users,
too.
Debian ăăŁăšăăŞăăĽăźăˇă§ăłă§ĺŠç¨ĺŻč˝ăŞăăăąăźă¸é˘ăăć
ĺ ąăĺžă
ăăăŽăăŚă§ăăŞă˝ăźăšăŻć°ĺ¤ăăăăžăăăăŽĺ¤§ĺăŻä¸ťăŤ Debian éçşč
ĺăă§ăăăăŚăźăśăŤă¨ăŁăŚĺ˝šăŤçŤă¤ăăŽăĺ¤ăăăăžăă
<p>
The <url id="http://packages.debian.org/" name="Debian Packages
Pages"> lets you search for packages that are available on the various
architectures Debian supports and, also, search for the contents of
all the Debian packages. There are information regarding dependencies
and other relationships with packages. There are also links to
download the source package and the binary package for all
architectures. You can use a shortcut like
<tt>http://packages.debian.org/<var>packagename</var></tt> to have quick
access links to a package.
<url id="http://packages.debian.org/" name="Debian Packages Pages"> ă§ăŻă
Debian ă寞ĺżăăŚăăĺ税ă˘ăźăăăŻăăŁă§ĺ
ĽćĺŻč˝ăŞăăăąăźă¸ăŽć¤ç´˘ă
ĺŻč˝ă§ăăăăăŤăĺ
¨ Debian ăăăąăźă¸ăŽĺ
厚ăć¤ç´˘ă§ăăžăăäžĺé˘äżăă
ĺĽăăăąăźă¸ă¨ăŽăăŽäťăŽé˘äżăŤă¤ăăŚăŽć
ĺ ąăăăăžăăă˝ăźăšăăăąăźă¸ăă
ĺ
¨ă˘ăźăăăŻăăŁç¨ăŽăă¤ăăŞăăăąăźă¸ăŽăăŚăăźăă¸ăŽăŞăłăŻăăăăžăă
ăăăăăąăźă¸ă¸ă˘ăŻăťăšăăăăăŽăŻă¤ăăŻăŞăłăŻă¨ăăŚă
<tt>http://packages.debian.org/<var>packagename</var></tt> ăŽăăăŞ
ăˇă§ăźăăŤăăă使ăăă¨ăă§ăăžăă
<p>
The <url id="http://packages.qa.debian.org/" name="Package Tracking
System"> provides information about what happened to the package
recently, what are the TODO items, from a Debian maintainers point of
view, provides a summary of bugs reported and some more very useful
information. One of the nice things about the Package Tracking System
is that it lets you "subscribe" to a package to follow all the emails
that the maintainer usually receives about the package. This way you
can follow the development of packages that are crucial for your work
or play. The <tt>http://packages.qa.debian.org/<var>packagename</var></tt>
shortcut works here, as well.
<url id="http://packages.qa.debian.org/" name="Package Tracking System"> ăŻă
ăăăăăąăźă¸ăŤćčżçşçăăĺşćĽäşăŤă¤ăăŚăŽć
ĺ ąăćäžăăžăă
Debian ăĄăłăăăŤăăŚăżăă°ăăă㯠ToDo ă˘ă¤ăă ă§ăăăăă°ĺ ąĺăŽä¸čŚ§ă
ăăŽäťăŽă¨ăŚăćçăŞć
ĺ ąăćäžăăŚăăăžăăăăăąăźă¸čż˝čˇĄăˇăšăă ăŤă¤ăăŚ
ç´ ć´ăăăăă¨ăŽă˛ă¨ă¤ăŤăćĽă
ăĄăłăăăăăăąăźă¸ăŤé˘ăăŚĺăĺăăăšăŚăŽ
éťĺăĄăźăŤăčŞăăăăăăăăąăźă¸ă "čłźčŞ" ă§ăăăă¨ăăăăžăăăăăŤ
ăăăăăŞăăŽäťäşăä˝ćăŤă¨ăŁăŚĺż
čŚä¸ĺŻćŹ ăŞăăăąăźă¸ăŽéçşçśćłăčż˝ăă
ăăăŤăŞăăžăăăăă§ăă<tt>http://packages.qa.debian.org/<var>packagename</var></tt>
ă¨ăăăˇă§ăźăăŤăăă使ăăă¨ăă§ăăžăă
<p>
Finally, the <url id="http://bugs.debian.org/" name="Bug Tracking
System"> provides information about known bugs in the packages
distributed by Debian. This may be useful for you to find out why
something does not work the way you expected and even find solutions
or work-arounds through the bug logs. Also, read these pages and its
documentation to be able to fill good bug reports for Debian. The
<tt>http://bugs.debian.org/<var>packagename</var></tt> shortcut also works
here, as expected, but the BTS (Bug Tracking System) also accepts
other very useful shortcuts like, for example,
<tt>http://bugs.debian.org/src:<var>packagename</var></tt> to show all bug
reports on all binary packages provided by a given source package.
ćĺžăŤ <url id="http://bugs.debian.org/" name="Bug Tracking System"> ăŻă
Debian ă§é
ĺ¸ăăăŚăăăăăąăźă¸ăŽć˘çĽăŽăă°ăŤé˘ăăć
ĺ ąăćäžăăžăă
ăăĺä˝ăćĺž
ăŠăăăŤĺăăŚăăăŞăĺĺ ăčŚă¤ăăăŽăŤäžżĺŠă§ă解湺ćšćłă
ä˝ćĽăŽć§ĺăăăăă°ăă°ăéăăŚčŚăăă¨ăă§ăăžăăDebian ăŤčŻčłŞăŞăă°
ĺ ąĺăéăăăăăŤăŞăăăăŤăăăăăăŽăăźă¸ă¨ăăŽăăăĽăĄăłăăčŞă
ăăăŤăăŚăă ăăăăăă§ă <tt>http://bugs.debian.org/<var>packagename</var></tt>
ă¨ăăăˇă§ăźăăŤăăă使ăăžăăăBTS (ăă°čż˝čˇĄăˇăšăă ) ă§ăŻăăäžżĺŠăŞ
ăˇă§ăźăăŤăăă使ăăă¨ăă§ăăžăăăă¨ăă°
<tt>http://bugs.debian.org/src:<var>packagename</var></tt> ă¨ăăă°ă
ćĺŽăăă˝ăźăšăăăąăźă¸ăăćäžăăăĺ
¨ăă¤ăăŞăăăąăźă¸ăŤé˘ăăăă°
ĺ ąĺăčŚăăă¨ăă§ăăžăă
</sect>
</chapt>
<chapt id="tricks">ăăŞăăŻă¨ăăŻăăăŻ
<sect id="auto-apt">"ĺż
čŚăŤĺżăăŚ" ăăăąăźă¸ăă¤ăłăšăăźăŤăăćšćł
<p>
ăăă°ăŠă ăăłăłăă¤ăŤăăŚăăŚăăžăŁăăçŞçśăŤăăŤăźăłďź ă¨ăŠăźăŽ
ĺĺ ăŻăăă <tt>.h</tt> ăăĄă¤ăŤăăŞăăŁăăăă§ăăăăăŽăăăŞ
ăˇăăŞăŞăŻă<prgn>auto-apt</prgn> ăăă°ăŠă ă使ăăă¨ă§éżăăăăžăă
ăăăăăąăźă¸ăĺż
čŚăŤăŞăŁăćçšă§ă¤ăłăšăăźăŤăăăăŠăăăĺ°ăă
é˘éŁăăăăăťăšăĺć˘ăăŚăă¤ăłăšăăźăŤăĺŽäşăăăĺéăăžăă
<p>
ĺşćŹçăŤăŻă揥ăŽăăăŤĺŽčĄăăžă:
<p>
<example>
# auto-apt run command
</example>
<p>
'command' ăŽĺćăŤăŻăĺŽčĄăăăŽăŤĺż
čŚăŞăăĄă¤ăŤăăŞăăłăăłăă
ćĺŽăăŚăă ăăăăă¨ăă°:
<p>
<example>
# auto-apt run ./configure
</example>
<p>
ĺż
čŚăŞăăăąăźă¸ăă¤ăłăšăăźăŤăăăăŠăăăĺ°ăăŚăăŚăčŞĺçăŤ
apt-get ăĺźăłĺşăăžăăX ăŽĺŽčĄä¸ă§ăăă°ăăăăŠăŤăăŽăăăšă
ă¤ăłăżăźăă§ă¤ăšăŤäťŁăăŁăŚă°ăŠăăŁăŤăŤă¤ăłăżăźăă§ă¤ăšă使ăă
ăžăă
<p>
auto-apt ăŻăăźăżăăźăšăćăŁăŚăăăĺšćçăŤä˝żăăăăŤăŻăăăć´ć°ăă
ĺż
čŚăăăăžăăăăŽăăăŤăŻă<tt>auto-apt update</tt>ă<tt>auto-apt updatedb</tt>ă
<tt>auto-apt update-local</tt> ăŞăŠăŽăłăăłăă使ăăžăă
</sect>
<sect id="apt-proxy">Caching packages
<sect id="apt-proxy">ăăăąăźă¸ăŽăăŁăăˇăĽ
<p>
If you are dealing with several machines in a network it might
be useful to have a package caching system, so that you will not
have to download the packages for each machine. This manual will
focus on the <package>apt-proxy</package> package, which does
exactly that. Other solutions exist, like <package>apt-cacher</package>,
though. You may want to try each one to choose the one that best
fits your needs.
ăăăăŻăźăŻă§č¤ć°ăŽăăˇăłăćąăŁăŚăăăŽăŞăăĺăăˇăłç¨ăŤăăăąăźă¸ă
ăăŚăłăăźăăăŞăăŚăć¸ăăăăŤăăăăąăźă¸ăăŁăăˇăłă°ăˇăšăă ă
ćăŁăŚăăă°äžżĺŠă§ăăăăćŹăăăĽă˘ăŤă§ăŻăăžăăŤăăăčĄăŞăăăăŽ
<package>apt-proxy</package> ăăăąăźă¸ăŤçŚçšăçľăăžăăăăăăŞăăă
<package>apt-cacher</package> ăŽăăăŞäťăŽćšçăĺĺ¨ăăžăăčŞĺăŽ
ĺż
čŚć§ăŤĺăŁăăăŽăé¸ăśăăăŤăĺă
ă芌ăăŚăżăăăŞăă§ăăăă
<p>
First of all, install the <package>apt-proxy</package> package.
It will register itself on <prgn>inetd</prgn> to listen for requests
on port 9999, you may need to restart the <prgn>inetd</prgn> service.
ăŞăŤăăăăžăă<package>apt-proxy</package> ăăăąăźă¸ăă¤ăłăšăăźăŤ
ăăŚăă ăăăĺăăăąăźă¸ăŻăăăźă 9999 ç¨ăŽčŚćąăçŁčŚăăăăăŤčŞăă
<prgn>inetd</prgn> ăŤçťé˛ăăžăăăăŽăă <prgn>inetd</prgn> ăľăźăăšă
ĺ辡ĺăăĺż
čŚăăăă§ăăăă
<p>
Next you'll want to edit the <file>/etc/apt-proxy/apt-proxy.conf</file>
file. It lists the real servers apt-proxy will use to download the
package lists and packages from. You can use http, ftp and rsync
as transfer methods. The file comes with a default "backend" that
looks like this:
揥ăŤă<file>/etc/apt-proxy/apt-proxy.conf</file> ăăĄă¤ăŤă硨éăă
ĺż
čŚăăăă§ăăăăăăăŤăŻăapt-proxy ăăăăąăźă¸ăŞăšăăăăăąăźă¸ă
ăăŚăłăăźăăăăŽăŤä˝żăĺŽéăŽăľăźăăč¨čż°ăăăŚăăžăă蝢éć掾ă¨ăăŚă
http ă ftp, rsync ă使ăăă¨ăă§ăăžăăĺăăĄă¤ăŤăŤăŻăăăŠăŤăăŽ
"ăăăŻă¨ăłă" ă¨ăăŚă䝼ä¸ăŽăăăŞč¨čż°ăăăăžă:
<p>
<example>
add_backend /debian/ \
$APT_PROXY_CACHE/debian/ \
http://ftp.us.debian.org/debian/ \
http://ftp.de.debian.org/debian/ \
http://ftp.uk.debian.org/debian/ \
+ftp.us.debian.org::debian/
</example>
<p>
This means that whenever a client tries to get something
from /debian/ <prgn>apt-proxy</prgn> will use its cache,
the listed Debian http mirrors and one rsync server, which
is preferred for downloading the package lists (the "+" sign
means preferred for control files).
ăăŽćĺłăŻăăŻăŠă¤ă˘ăłăă /debian/ ăăä˝ăăĺĺžăăăă¨ăăăăłăŤă
<prgn>apt-proxy</prgn> ăăăŽăăŁăăˇăĽă使ăă¨ăăăă¨ă§ăă
Debian http ăăŠăźă¨ 1 ă¤ăŽ rsync ăľăźăăč¨čż°ăăăŚăăăĺžč
ă
ăăăąăźă¸ăŞăšăăŽć¨ĺĽ¨ăăŚăłăăźăĺ
ă¨ăŞăŁăŚăăžă ("+" ăŽĺ°ăŻ
ć¨ĺĽ¨ăŽćĺłă§ăďźă
<p>
How, then, a client will use this backend? By adding the
following line at the <file>/etc/apt/sources.list</file>
file at the clients (including the box in which apt-proxy
is installed):
ăăă§ăŻăăŻăŠă¤ă˘ăłăăăăŽăăăŻă¨ăłăă使ăăŤăŻăŠăŽăăăŤăăă°
ăăăă? ăŻăŠă¤ă˘ăłă (apt-proxy ăă¤ăłăšăăźăŤăăăŚăăăăˇăłă
ĺŤă) ㎠<file>/etc/apt/sources.list</file> ăăĄă¤ăŤăŤäťĽä¸ăŽčĄăčż˝ĺ
ăăŚăă ăă :
<p>
<example>
deb http://<var>server</var>:9999/debian/ stable main
</example>
<p>
The line looks much like a normal line. The difference here is you put
your apt-proxy server where you would normally put an http or ftp
mirror, uses a port value (9999) and then select the backend
(/debian/). After having done all this initial setup update the list
of packages at one of the machines and upgrade it first, so that it
will only download a package one time. After the first machine is
up-to-date update the others.
ăăŽčĄăŻé常ăŽăăŽăŤčŚăăžăăç°ăŞăăŽăŻăé常ă§ăăă° http ă ftp
ăăŠăźăč¨čż°ăăĺ ´ć㍠apt-proxy ăľăźăăč¨čż°ăăăŚăăăă¨ă§ăă
ăăźăçŞĺˇ (9999) ă使ăăăăăăăăăŻă¨ăłă (/debian/) ăé¸ćăăŚ
ăă ăăăăăăăăšăŚăĺŽäşăăă¨ăĺćč¨ĺŽăŤăăăŚăă 1 ă¤ăŽăăˇăłă§
ăăăąăźă¸ăŞăšăăć´ć°ăăăăăŽăăˇăłăćĺăŤă˘ăăă°ăŹăźăăăăžăă
ăăăŤăăăăăăăăąăźă¸ăŽăăŚăłăăźăă 1 ĺă ăă§ć¸ăżăžăăćĺăŽ
ăăˇăłăŽć´ć°ĺžăŤăäťăŽăăˇăłăć´ć°ăăăžăă
<p>
You can use the <prgn>apt-proxy-import</prgn> command to import the
packages that are inside your current APT cache
(<file>/var/cache/apt/archives/</file>) by running
<tt>apt-proxy-import /var/cache/apt/archives</tt>. Notice that you
must have run the update process in at least one client to initiate
the <prgn>apt-proxy</prgn>'s cache before using
<prgn>apt-proxy-import</prgn>.
ćć°ăŽ APT ăăŁăăˇăĽ (<file>/var/cache/apt/archives/</file>) ĺ
ăŤ
ăăăăăąăźă¸ăă¤ăłăăźăăăăŽăŤă<prgn>apt-proxy-import</prgn>
ăłăăłăă使ăăă¨ăă§ăăžăăăăŽăăăŤăŻă
<tt>apt-proxy-import /var/cache/apt/archives</tt> ă¨ĺŽčĄăăŚăă ăăă
<prgn>apt-proxy-import</prgn> ă使ăăŽăŤĺ
çŤăĄă<prgn>apt-proxy</prgn> ăŽ
ăăŁăăˇăĽăćć°ĺăăăăăŤăćä˝ 1 ĺ°ăŽăŻăŠă¤ă˘ăłăă§ć´ć°ĺŚçăĺŽčĄ
ăăŞăăă°ăŞăăŞăăă¨ăŤćł¨ćăăŚăă ăăă
<p>
You can learn more about <prgn>apt-proxy</prgn> by reading the
comments that populate the <file>/etc/apt-proxy/apt-proxy.conf</file>
file. To setup http and ftp proxies for <prgn>apt-proxy</prgn> to
use, for example, you will find example configurations at the end
of the file.
<file>/etc/apt-proxy/apt-proxy.conf</file> ăăĄă¤ăŤĺ
ăŤăăăłăĄăłăă
čŞăă°ă<prgn>apt-proxy</prgn> ăŤă¤ăăŚăă桹ăĺŚăśăă¨ăă§ăăžăă
ăă¨ăă° <prgn>apt-proxy</prgn> 㧠http ăăăł ftp ăăăăˇă使ăă
ăăăŤč¨ĺŽăăăŤăŻăĺăăĄă¤ăŤăŽćŤĺ°žăŤč¨ĺŽäžăăăăžăă
</sect>
<sect id="netselect">sources.list ăăĄă¤ăŤăŤč¨čż°ăăšăćéŠăŞăăŠăźăľă¤ăăŽćąşĺŽ: netselect, netselect-apt
<p>
丝ăŤĺ§ăăă°ăăăŽăŚăźăśăééăăŞăćąăçĺăăăăžăââă<tt>sources.list
</tt> ăŤč¨čż°ăăšă Debian ăŽăăŠăźăľă¤ăăŻăŠăă§ăă?ăăăŠăŽăăŠăźăŤăăăŽăă
ćąşăăăŤăŻăĺ¤ăăŽćšćłăăăăžăăăăăăç硴č
ăŞăăăăă¤ăăŽăăŠăźăŤ
ping ăćăŁăŚćéă渏ăăšăŻăŞăăăćăŁăŚăăă§ăăăăă§ăăćă
ăŽăăăŤăă
ĺăăă¨ăăăŚăăăăăă°ăŠă ăăăăžăăăăăă<strong>netselect</strong> ă§ăă
<p>
netselect ăŽă¤ăłăšăăźăŤăŻăăă¤ăăŽăăăŤăăă ăă§ă:
<p>
<example>
# aptitude install netselect
</example>
<p>
ăăŠăĄăźăżăŞăă§ĺŽčĄăăă¨ăăăŤăă襨示ăăăžăăăšăăźăšă§ĺşĺăŁă
ăăšă (ăăŠăź) ăŽăŞăšăăäťăăŚĺŽčĄăăă¨ă1ă¤ăŽăăšăă¨ăăŽăšăłă˘ă
čżăăžăăăăŽăšăłă˘ăŻăć¨ĺŽ ping ćé㨠hops ć° (ćĽçśčŚćąăçŽçĺ°ăŤĺ°é
ăăăžă§ăŤçľçąăăăăšăăŽć°)ăéćŻäžăăć¨ĺŽăăŚăłăăźăé庌 (ăăŁăŚ
ĺ°ăŞăăťăŠĺŻ) ăŞăŠăč¨çŽăăŚçŽĺşăăăžăăăłăăłăăčżăăăšăăŻă
ćĺ°ăŽăšăłă˘ă¨ăŞăŁă1ă¤ă ăă§ă (-vv ăŞăăˇă§ăłăäťăăă°ăĺ
¨ĺčŁăŽ
ăšăłă˘ăĺşĺăăăžă)ă䝼ä¸ăŽäžăĺç
§ăăŚăă ăă:
<p>
<example>
# netselect ftp.debian.org http.us.debian.org ftp.at.debian.org download.unesp.br ftp.debian.org.br
365 ftp.debian.org.br
bash$
</example>
<p>
ä¸č¨ăŽćĺłăŻănetselect ăŽăăŠăĄăźăżă¨ăăŚć¸ĄăăăăŠăźăŽä¸ă§ă
<tt>ftp.debian.org.br</tt> ăćéŠă§ăăăăšăłă˘ăŻ 365 ă§ăăă¨ăăăă¨
ă§ă (注ćăăŚăă ăăďźďź ăăăŻç§ăŽăłăłăăĽăźăżă§ĺŽčĄăăăăŽă§ăăă
ăăăăŻăźăŻăăăă¸ăŻćĽçśăă¤ăłăăŤăăŁăŚĺ¤§ăăç°ăŞăăžăăăăŽăšăłă˘
ăŻăĺż
ăăăäťăŽăłăłăăĽăźăżă§ăŽçľćă¨ä¸č´ăăăăă§ăŻăăăžăă)ă
<p>
ăăănetselect ăčŚă¤ăăćéăŽăăŠăźă <tt>/etc/apt/sources.list</tt>
ăăĄă¤ăŤăŤč¨čż°ă㌠(<ref id="sources.list"> ăĺç
§)ă<ref id="apt-get">
ăŤăă tips ăŤĺžăŁăŚăă ăăă
<p>
<strong>注ć:</strong> ăăŠăźăŽä¸čŚ§ăŻă
<url id="http://www.debian.org/mirror/mirrors_full"
name="http://www.debian.org/mirror/mirrors_full"> ă¨ăăăăĄă¤ăŤă
čŚăă°ăăă¤ă§ăăăăăžăă
<p>
ăăźă¸ă§ăł 0.3 ăăănetselect ăăăąăźă¸ăŤăŻ <strong>netselect-apt
</strong> ă¨ăăăšăŻăŞăăăĺŤăžăăăăăŤăŞăăžăăăăăăŻä¸č¨ăŽ
ăăăťăšăčŞĺçăŤčĄăŞăŁăŚăăăăăŽă§ăăăăŁăšăăŞăăĽăźăˇă§ăłăŽ
ç¨ŽéĄ (ăăăŠăŤă㯠stable) ăăăŠăĄăźăżă¨ăăŚĺŽčĄăăă ăă§ăćéŠăŞ
main ăŽăăŠăźăč¨čż°ăăă <tt>sources.list</tt> ăçćăăă
äťăăăăŁăŹăŻăăŞĺ
ăŤé
罎ăăăžăă䝼ä¸ăŻăstable ăăŁăšăăŞ
ăăĽăźăˇă§ăłç¨ăŽ sources.list ăçćăăäžă§ăă
<p>
<example>
# ls sources.list
ls: sources.list: File or directory not found
# netselect-apt stable
(...)
# ls -l sources.list
sources.list
#
</example>
<p>
<strong>注č¨:</strong> <tt>sources.list</tt> ăăĄă¤ăŤăŻăăłăăłăă
ĺŽčĄăăăăŁăŹăŻăăŞĺ
ăŤçćăăăžăăăăŽĺžă<tt>/etc/apt</tt>
ăăŁăŹăŻăăŞăŤç§ťĺăăŞăăă°ăŞăăžăăă
</sect>
<sect id="apt-listchanges">ăăăąăźă¸ăŽĺ¤ć´çšă常ăŤçĽăăăćšćł
<p>
ăŠăŽăăăąăźă¸ăăĺĺĽăŽćć¸ç¨ăăŁăŹăŻăăŞ
(<tt>/usr/share/doc/packagename</tt>) ăŤă<tt>changelog.Debian.gz</tt> ă¨ăă
ăăĄă¤ăŤăă¤ăłăšăăźăŤăăžăăăăŽăăĄă¤ăŤăŻăĺĺăŽăăźă¸ă§ăłăăăŽĺ¤ć´çšä¸čŚ§ă
ĺŤăă§ăăžăăăăăăŁăăăĄă¤ăŤăŻă'<tt>zless</tt>' ăŞăŠăŽĺŠăăĺăăŚčŞăăă¨
ăă§ăăžăăăĺ
¨ăˇăšăă ăă˘ăăă°ăŹăźăăăĺžăŞăŠăŻăă˘ăăă°ăŹăźăăăă
ĺăăăąăźă¸ăŽ changelog ăć˘ăăŽăŤéިăćăăžăă
<p>
<prgn>apt-listchanges</prgn> ă¨ăăăăźăŤă使ăŁăŚăăăŽä˝ćĽăčŞĺĺă§ăăžăă
ăžă㯠<package>apt-listchanges</package> ăăăąăźă¸ăă¤ăłăšăăźăŤăăĺż
čŚă
ăăăžăăă¤ăłăšăăźăŤä¸ăŤăDebconf ăč¨ĺŽăčĄăŞăăžăă質ĺăŤĺŻžăăŚă
ăăŞăăŽĺ¸ćăăăăăŤçăăŚăă ăăă
<p>
"Should apt-listchanges be automatically run by apt?" ă¨ăăăŞăăˇă§ăłăŻă
ă˘ăăă°ăŹăźăéä¸ă§ apt ăŤăăŁăŚă¤ăłăšăăźăŤăăăăă¨ăăŚăăĺăăăąăźă¸ăŽ
ĺ¤ć´çšä¸čŚ§ă襨示ăăä˝ćĽăçśăăĺăŤăăŽĺ
厚ă確čŞă§ăăăŽă§ă彚ăŤçŤăĄăžăă
"Should apt-listchanges prompt for confirmation after displaying changes?" ă¨
ăăăŞăăˇă§ăłăŻăĺ¤ć´çšä¸čŚ§ăčŞăă ĺžă§ăă¤ăłăšăăźăŤăçśăăăăŠăăă
ĺăĺăăăŚăăăăŽă§ĺ˝šăŤçŤăĄăžăăçśçśăćăžăŞăă¨çăăă°ăapt-listchanges ăŻ
ă¨ăŠăźăčżăăapt ăŻă¤ăłăšăăźăŤăĺăć˘ăăžăă
<p>
apt-listchanges ăă¤ăłăšăăźăŤăăăă°ăăăŤăăăŽĺžăăŚăłăăźăăăă (ăăă
㯠CD ăăăŚăłăăăăăăŁăšăŻăăĺ
Ľćăă) ăăăąăźă¸ăŻă¤ăłăšăăźăŤăăăĺăŤ
ĺ¤ć´çšä¸čŚ§ă襨示ăăăăăŤăŞăăžăă
</sect>
</chapt>
<chapt id="repositories">Being at the other side: creating a repository
<chapt id="repositories">ăăä¸ćšăŽĺ´é˘: ăŞăă¸ăăŞăŽä˝ć
<p>
To create a repository you mainly need a set of packages (source
and/or binary) to generate <tt>Packages.gz</tt> and
<tt>Sources.gz</tt> files from them. You may have binary-only packages
in some cases, but be careful not to violate licenses. A GPL'ed
software, for example, needs to have its source distributed along with
the binaries.
ăŞăă¸ăăŞăä˝ćăăăŤăŻă<tt>Packages.gz</tt> ăăăł <tt>Sources.gz</tt>
ăăĄă¤ăŤăçćăăăăăŽăăăąăźă¸ (ă˝ăźăšăăăłăă¤ăăŞ) ä¸ĺźăĺż
čŚă¨
ăŞăăžăăăăăăŽĺ ´ĺă§ăŻăă¤ăăŞăŽăżăŽăăăąăźă¸ăćă¤ăă¨ăă§ăăžăăă
ăŠă¤ăťăłăšéĺă¨ăŞăăŞăăă注ćăăŚăă ăăăăă¨ăă° GPL éŠç¨ăŽă˝ăă
ăŚă§ă˘ă§ăŻăăă¤ăăŞăŤĺ ăăŚăăŽă˝ăźăšăé
ĺ¸ăăăă¨ăćąăăăăžăă
</p>
<p>
To do that you need to use the <prgn>apt-ftparchive</prgn> program
which is installed by the <package>apt-utils</package> package. First
of all you collect all your packages in a directory. Let's say, for
example, <file>~/public_html/debian</file>; using that we're going to
be exposing the repository through our http server, already!
ăŞăă¸ăăŞä˝ćăŤăŻă<package>apt-utils</package> ăăăąăźă¸ăŤăăŁăŚ
ă¤ăłăšăăźăŤăăă <prgn>apt-ftparchive</prgn> ăăă°ăŠă ă使ăĺż
čŚă
ăăăžăăăžăćĺăŤăăăŞăăŽĺ
¨ăăăąăźă¸ă 1 ă¤ăŽăăŁăŹăŻăăŞĺ
ăŤ
éăăŚăă ăăăăăă§ăŻă<file>~/public_html/debian</file> ă¨ăă
ăăŁăŹăŻăăŞă使ăŁăŚăăăăă§ăŤ http ăľăźăçľçąă§ăŞăă¸ăăŞăĺ
Źé
ăăäşĺŽă§ăăă¨ăăăă¨ăŤăăžă!
</p>
<p>
I can go to that directory and do the following:
ä¸č¨ăăŁăŹăŻăăŞăŤç§ťĺăăŚă揥ăŽăăăŤĺŽčĄăăžă:
</p>
<p>
<example>
$ apt-ftparchive sources . > Sources
$ apt-ftparchive packages . > Packages
$ gzip -c Packages > Packages.gz
$ gzip -c Sources > Sources.gz
</example>
</p>
<p>
The first two commands scan the directory and its subdirectories of
the directory you specified (<tt>.</tt>, in this case) and prints the
resulting packages list to the standard output, which we're
redirecting to the <tt>Sources</tt> and <tt>Packages</tt> files.
ćĺ㎠2 ă¤ăŽăłăăłăăŻăĺ˝čŠ˛ăăŁăŹăŻăăŞăăăłćĺŽ (ăăŽĺ ´ĺ㯠<tt>.</tt>)
ăăăăŁăŹăŻăăŞăŽăľăăăŁăŹăŻăăŞă調ăšăçľćă¨ăăŚĺžăăăăăăąăźă¸
ä¸čŚ§ăć¨ćşĺşĺăŤĺşĺăăžăăä¸č¨ăŽäžă§ăŻăăăă <tt>Sources</tt> ăăăł
<tt>Packages</tt> ă¨ăăăăĄă¤ăŤăŤăŞăă¤ăŹăŻăăăŚăăžăă
</p>
<p>
If you're using the <tt>file</tt> method to access this repository
the first two lines are enough. If you're using a remote method like
<tt>ftp</tt> or <tt>http</tt>, then you need the compressed versions,
as they're what APT will look for when updating the packages lists.
ăŞăă¸ăăŞă¸ăŽă˘ăŻăťăšăŤ <tt>file</tt> ăĄă˝ăăă使ăŁăŚăăăŽăŞăă
ä¸č¨ 2 ă¤ăŽăłăăłăă ăă§ĺ
ĺă§ăă<tt>ftp</tt> ă <tt>http</tt> ă¨
ăăŁăăŞă˘ăźăăĄă˝ăăă使ăŁăŚăăăŽăŞăăĺ§ç¸Žçăĺż
čŚă¨ăŞăăžăă
ăă㯠APT ăăăăąăźă¸ä¸čŚ§ăŽć´ć°ç¨ăŤć˘ăăŽă¨ĺăăăŽă§ăă
</p>
<p>
Here are the source lines you could add to your
<file>/etc/apt/sources.list</file> to make APT aware of your
repository now:
ăăă§ăAPT ăŤăăŞăăŽăŞăă¸ăăŞăčŞčăăăăăăŤ
<file>/etc/apt/sources.list</file> ă¸ă˝ăźăščĄăčż˝ĺ ăăćşĺăă§ăăžăă:
</p>
<p>
<example>
# This will only work with local access to the filesystem
deb file:/home/<var>user</var>/public_html/debian/ ./
# This will be useable by people that can access your machine
# with a network connection if you have your http server properly
# configured
deb http://<var>host</var>/~<var>user</var>/debian/ ./
</example>
</p>
<p>
You get the idea. As we called apt-ftparchive at the same directory
the packages were on we can simply provide the full path to where the
packages are and add a <tt>./</tt> at the end. You can do things
differently, by calling apt-ftparchive with different relative paths
instead of calling it on the same directory in which the packages
are. You can also separate groups of packages as sections like Debian
does. Read the <tt>apt-ftparchive(1)</tt> manpage for more information
and play with the possibilities.
ăăŞăăŻăăłă¨ćĽăă§ăăăăăăăąăźă¸ăăăĺä¸ăăŁăŹăŻăăŞă§ apt-ftparchive ă
ĺźăłĺşăăăăăŤăăăăąăźă¸ăĺĺ¨ăăăăŤăăšăćĺŽăăŚăćŤĺ°žăŤ <tt>./</tt> ă
čż˝ĺ ă§ăăžăăăžăăăăăąăźă¸ăĺĺ¨ăăĺä¸ăăŁăŹăŻăăŞä¸ă§ apt-ftparchive ă
ĺźăłĺşă䝣ăăăŤăç°ăŞăç¸ĺŻžăăšăäťăăŚĺźăłĺşăăă¨ăă§ăăžăăăă㍠Debian ăŽ
ăăăŤăăťăŻăˇă§ăłăă¨ăŤăăăąăźă¸ăă°ăŤăźăĺăăăă¨ăĺŻč˝ă§ăăăă芳ăăć
ĺ ąăŻ
<tt>apt-ftparchive(1)</tt> ăĺç
§ăăŚăăăăăă¨éăă§ăżăŚăă ăăă
</p>
</chapt>
<!-- <chapt id="otheruis">Alternative User Interfaces for managing packages -->
<!-- <chapt id="otheruis">ăăăąăźă¸ă玥çăăĺĽăŽăŚăźăśă¤ăłăżăźăă§ă¤ăš -->
<!-- <p>
Aptitude is what this howto recommends as the main user interface for
managing packages for your Debian system. This is because, as we
stated through the document, aptitude has a set of features that makes
the administrator's life easier. -->
<!-- <p>
aptitude ăŻăă㎠HOWTO ăŤăăăŚăăŞă㎠Debian ăˇăšăă ăŽăăăąăźă¸ă
玥çăăăĄă¤ăłăŚăźăśă¤ăłăżăźăă§ă¤ăšă¨ăăŚć¨ĺĽ¨ăăăŚăăžăăă¨ăăăŽăă
ćŹćć¸ăéăăŚčż°ăšăŚăăăăăŤăaptitude ăŻçŽĄçč
ăŽćĽĺ¸¸ăăă漽ăŤ
ăăŚăăăăăăăăŞćŠč˝ăćăĄĺăăăŚăăăăă§ăă-->
<!-- <p>
There are, though, other user interfaces, even graphical ones, like
Synaptic or GNOME-APT. In this chapter we're going to go through them. -->
<!-- <p>
ăăăăŞăăăăăŽäťăŽă¤ăłăżăźăă§ă¤ăšââ Synaptic ă GNOME-APT ăŽăăăŞ
ă°ăŠăăŁăŤăŤăŞăăŽăăăăăăžăăăăŽçŤ ă§ăŻăăăăă俯ç°ăăŚăăăžăă-->
<sect id="synaptic">Synaptic
<p>
Synaptic was originally written by Alfredo Kojima for Conectiva. Today
it's maintained by people from both Conectiva and Debian. It was
originally written in wing, Window Maker's graphical toolkit, but was
rewritten in GTK+.
Synaptic ăŻĺ
ă
ăConectiva ç¨ă¨ă㌠Alfredo Kojima ăăăŤăăć¸ăăă
ăăŽă§ăăçžĺ¨ă§ăŻăConectiva ăăăł Debian 严ćšăŽäşşă
ăäżĺŽăăŚăăžăă
ĺ
㯠Window Maker ç¨ă°ăŠăăŁăŤăŤăăźăŤăăăă§ăă wing ă§ć¸ăăăŚăăžăăăă
GTK+ ă§ć¸ăç´ăăăžăăă
<p>
To use Synaptic you have to install the <package>synaptic</package>
package.
Synaptic ă使ăăŤăŻă<package>synaptic</package> ăăăąăźă¸ăă¤ăłăšăăźăŤ
ăăŚăă ăăă
<p>
Synaptic is probably the most usable of all the graphical user
interfaces for APT, the one the end users will most likely have less
problems with.
ăăăă Synaptic ăŻăAPT ç¨ăŽĺ
¨ă°ăŠăăŁăŤăŤăŚăźăśă¤ăłăżăźăă§ă¤ăšăŽä¸ă§
ăăŁă¨ăäžżĺŠăŞăăŽă§ăăăă¨ăłăăŚăźăśăĺéĄăŤç´é˘ăăăă¨ăŻăťă¨ăăŠăŞă
ă§ăăăă
</sect>
<sect id="gnome-apt">GNOME-APT
<p>
GNOME-APT ăŻăDebian ăˇăšăă ĺă㍠Havoc Pennington 㨠Diego Lages ăŤ
ăăŁăŚćĺăŤć¸ăăăžăăăăă¤ăŚăŻăĄăłăăăłăšăăăŚăăžăăă§ăăăă
Woody ă§ăŻçśćăăăŚăăžăăăSarge ă§ăăăŽăăăąăźă¸ăŻć°ăăăĄăłăăă
ĺžăžăăăSynaptic ăŤĺŻžă㌠GNOME-APT ăŻăčŚć ăăŽăă GTK+ ă¤ăłăżăź
ăă§ă¤ăšă漽ăăă§ăăăăŚăźăśăăŞăăŁăăăćčťć§ă弽ăäşşă
ĺăă§ăă
<p>
<package>gnome-apt</package> ăă¤ăłăšăăźăŤăăă°ăGNOME-APT ăĺŠç¨ă§ăăžăă
</sect>
</chapt>
<chapt id="erros">ă¨ăŠăźă¸ăŽĺŻžĺŚćšćł
<sect id="erros-comuns">ăăăăă¨ăŠăź
<p>
ă¨ăŠăźăŻĺ¸¸ăŤčľˇăăĺ¤ăăŻăŚăźăśăŽä¸ćł¨ćăĺĺ ă§ăă䝼ä¸ăŻăă¨ăŚăé ťçšăŤ
ĺ ąĺăăăă¨ăŠăźă¨ăăăŽĺŻžĺŚćšćłă§ăă
<p>
<tt>apt-get install package</tt> ăĺŽčĄăăéăŤă䝼ä¸ăŽăăăŞ
ăĄăăťăźă¸ăĺăĺăŁăă...
<p>
<example>
Reading Package Lists... Done
Building Dependency Tree... Done
W: Couldn't stat source package list 'http://people.debian.org unstable/ Packages' (/var/state/apt/lists/people.debian.org_%7ekov_debian_unstable_Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these missing files
E: Couldn't find package penguineyes
</example>
<p>
ćĺžăŤ <tt>/etc/apt/sources.list</tt> ăăĄă¤ăŤă俎ćŁăăĺžă§ă
<tt>apt-get update</tt> ăĺŽčĄăăăŽăĺżăăŚăăăŽă§ăăăă
<p>
䝼ä¸ăŽă¨ăŠăźăŽĺ ´ĺăŻ:
<p>
<example>
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
</example>
<p>
<tt>source</tt> 䝼ĺ¤ăŽ <prgn>apt-get</prgn> ć示ăčĄăĺ ´ĺăŻă
root 樊éăăŞăăă°ăŞăăžăăăă¤ăžăăä¸čŹăŚăźăśă¨ăăŚĺŽčĄăăŚ
ăăžăŁăăŽă§ăă
<p>
ä¸č¨ăŤäźźăă¨ăŠăźăĺşăăŽăŻă<prgn>apt-get</prgn> ăĺć㍠2 ă¤ĺŽčĄ
ăăăă¨ăăĺ ´ĺăă<prgn>dpkg</prgn> ăŽăăăťăšăçăăŚăăéăŤă
<prgn>apt-get</prgn> ăĺŽčĄăăăă¨ăăĺ ´ĺăăăăžăă
ĺćăŤä¸ŚčĄăăŚĺŽčĄă§ăăăŽăŻă<tt>source</tt> ć示ă ăă§ăă
<p>
ă¤ăłăšăăźăŤćăĺŚçéä¸ă§ć˘ăžăŁăŚăăžăăăăŽăăăąăźă¸ăă¤ăłăšăăźăŤ
ăăăă¨ăĺé¤ăă§ăăŞăăŞăŁăĺ ´ĺă揥㎠2 ă¤ăŽăłăăłăăĺŽčĄăăŚăżăŚ
ăă ăăă
<p>
<example>
# apt-get -f install
# dpkg --configure -a
</example>
<p>
ăăŽĺžă§ăăăä¸ĺşŚčŠŚăăŚăă ăăăä¸č¨ăŽäžä¸ăŽ 2 çŞçŽăŽăłăăłăăŻă
çš°ăčżăĺŽčĄăăĺż
čŚăăăăăăăăžăăăăă㯠'unstable' ă使ă
ĺéşĺŽśăŤă¨ăŁăŚăéčŚăŞćăă§ăă
<!-- p>
If you receive the error "E: Dynamic MMap ran out of room" when running
<tt>apt-get update</tt>, add the following line to
<file>/etc/apt/apt.conf</file>: -->
<!-- <p>
<tt>apt-get update</tt> ăŽĺŽčĄć㍠"E: Dynamic MMap ran out of room" ă¨ăăă¨ăŠăźăĺşăŚăăžăŁăăă䝼ä¸ăŽčĄă
<file>/etc/apt/apt.conf</file> ăŤčż˝ĺ ăăžă: -->
<example>
APT::Cache-Limit 10000000;
</example>
</sect>
<sect id="help">ăăŤăăŻăŠăăŤăăăžăă?
<p>
çăăćąăăăŞăăDebian ăăăąăźă¸ăłă°ăˇăšăă ç¨ăŤĺŠç¨ĺŻč˝ăŞ
č¨ĺ¤§ăŞćć¸ă調ăšăŚăżăŚăă ăăă<tt>/usr/share/doc/apt</tt> ăŽ
ăă㪠<tt>/usr/share/doc</tt> ĺ
ăŤăăćć¸ă¨ĺć§ă
<tt>--help</tt> ăŞăăˇă§ăłă man ăăźă¸ă大ăăŞĺŠăă¨ăŞăă§ăăăă
<p>
䝼ä¸ăŽćć¸ă§ăććăćăĺťăăă¨ăă§ăăŞăăă°ăDebian ăŽ
ăĄăźăŞăłă°ăŞăšăä¸ă§ĺçăć˘ăăŚăżăŚăă ăăăçšĺŽăŽăŞăšăăŤé˘ăă
ć
ĺ ąăŻ Debian ăŽăŚă§ăăľă¤ăă§čŚă¤ăăăžă:
<url id="http://www.debian.org" name="http://www.debian.org">ă
<p>
ăăăăŽăŞăšăăăŞă˝ăźăšăŻăDebian ăŚăźăśă ăă使ç¨ăăšăă§ăăăă¨ăŤ
注ćăăŚăă ăăăäťăŽăˇăšăă ăŽăŚăźăśăŤăŻăĺăăŁăšăăŞăăĽăźăˇă§ăłăŽ
ăłăăĽăăăŁăŞă˝ăźăšăćăăăăčŻăăľăăźăăăăă§ăăăă
</sect>
</chapt>
<chapt id="distros">APT ăŤĺŻžĺżăăŚăăăăŁăšăăŞăăĽăźăˇă§ăłăŻ?
<p>
䝼ä¸ăŤăAPT ă使ç¨ăăŚăăăăă¤ăăŽăăŁăšăăŞăăĽăźăˇă§ăłĺă示ăăžăă
<p>
Debian GNU/Linux (<url id="http://www.debian.org" name="http://www.debian.org">)
- APT ăéçşăăăăŽăŻăăăŽăăŁăšăăŞăăĽăźăˇă§ăłăŽăăăŤă§ăă
<p>
Conectiva (<url id="http://www.conectiva.com.br" name="http://www.conectiva.com.br">)
- APT 㧠rpm ă使ăăăăăŤç§ťć¤ăăăćĺăŽăăŁăšăăŞăăĽăźăˇă§ăłă§ăă
<p>
Libranet (<url id="http://www.libranet.com" name="http://www.libranet.com">)
<p>
Mandrake (<url id="http://www.mandrake.com" name="http://www.mandrake.com">)
<p>
PLD (<url id="http://www.pld.org.pl" name="http://pld.org.pl">)
<p>
Vine (<url id="http://www.vinelinux.org" name="http://www.vinelinux.org">)
<p>
APT4RPM (<url id="http://apt4rpm.sf.net" name="http://apt4rpm.sf.net">)
<p>
Alt Linux (<url id="http://www.altlinux.ru/" name="http://www.altlinux.ru/">)
<p>
Red Hat (<url id="http://www.redhat.com/" name="http://www.redhat.com/">)
<p>
Sun Solaris (<url id="http://www.sun.com/" name="http://www.sun.com/">)
<p>
SuSE (<url id="http://www.suse.de/" name="http://www.suse.de/">)
</p>
<p>
Ubuntu (<url id="http://www.ubuntulinux.com/" name="http://www.ubuntulinux.com/">)
<p>
Yellow Dog Linux (<url id="http://www.yellowdoglinux.com/"
name="http://www.yellowdoglinux.com/">)
</chapt>
<chapt id="agradecimentos">ăŻăŹă¸ăă
<p>
Debian-BR ăăă¸ă§ăŻăă¨ăDebian ćŹä˝ăŽĺ大ăŞăĺäşşăăĄăŤćˇąăćčŹăăžăă
çľśăéăŽăŞăćĺŠăă¨ăä¸çăćăă¨ăăç§ăŽçŽçăćäźăŁăŚăăăă°ăăă§
ăŞăăäşşéĄăŽĺŠçăŽăăăŤä˝ćĽăçśăăĺăç§ăŤä¸ăăŚăăăžăă :)ă
<p>
CIPSGA ăŤĺŻžăăŚćă
ăŽăăă¸ă§ăŻăă¸ăŽĺ¤ĺ¤§ăŞăĺŠĺăŤăăžăĺ大ăŞă˘ă¤ăă˘
ăŽĺźžăżă¨ăŞăŁăăăăăăăŞăźăăă¸ă§ăŻăăŤăăćčŹăăăă¨ćăăžăă
<p>
䝼ä¸ăŽćšăŤăŻçšăŤčŹćă襨ăăžăă
<p>
Yooseong Yang <yooseong@debian.org>
<p>
Michael Bramer <grisu@debian.org>
<p>
Bryan <Stillwell bryan@xxxxxxxxxx>
<p>
Pawel Tecza <pawel.tecza@xxxxxxxxxx>
<p>
<p>
Hugo Mora <h.mora@xxxxxxxxxxxx>
<p>
Luca Monducci <luca.mo@xxxxxxxxxx>
<p>
Tomohiro KUBOTA <kubota@debian.org>
<p>
Pablo Lorenzzoni <spectra@debian.org>
<p>
Steve Langasek <vorlon@xxxxxxxxxxxxxx>
<p>
Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
<p>
Erik Rossen <rossen@xxxxxxxxxxx>
<p>
Ross Boylan <RossBoylan@xxxxxxxxxxxxxxxxxx>
<p>
Matt Kraai <kraai@debian.org>
<p>
Aaron M. Ucko <ucko@debian.org>
<p>
Jon Åslund <d98-jas@xxxxxxxxxxx>
<p>
Isaac Jones <ijones@xxxxxxxxxxxxxxxx>
</p>
</chapt>
<chapt id="novas">ăăŽăăĽăźăăŞă˘ăŤăŽć°ăăźă¸ă§ăł
<p>
ćŹăăăĽă˘ăŤăŻăDebian ă使ăăăăăäşşăŽĺŠăă¨ăŞăăă¨ăéĄăŁăŚă
<url id="http://debian-br.cipsga.org.br"name="Debian-BR"> ăăă¸ă§ăŻăăŤ
ăăŁăŚä˝ćăăăžăăă
<p>
ćć°ăăźă¸ă§ăłăŻăDebian ăăăĽăĄăłăăźăˇă§ăłăăă¸ă§ăŻăăŽăăźă¸ăăĺ
ĽćĺŻč˝ă§ă:
<url id="http://www.debian.org/doc/ddp"
name="http://www.debian.org/doc/ddp">.
<p>
ăłăĄăłăăćšĺ¤ăŻăç§ <email>kov@debian.org</email> ĺŽăŚăŤç´ćĽăĄăźăŤ
ăăăăDebian BTS ăŽăăăąăźă¸ <package>apt-howto</package> ăŤăă°ă¨ăăŚĺ ąĺăăŚăă ăăă
</chapt>
</book>
</debiandoc>