Debian apt howto
Lyoo translation into www.linuxsir.com
SUMMARY This document is to help users understand the Working principle of Debian Package Management Tools - APT, our goal is to simplify the life of DEBIAN's new users and help those who wish to understand system management. It is also for the Debian project group to help improve its quality of work for technical support for the release.
Copyright Notice Copyright? 2001, 2002 Gustavo Noronha Silva
This Manual is licensed Under The Terms of The GNU FDL (Free Documentation License). IT Has Been Written In The Hope That It Will Be Useful To The Community But it comes with no warranty; Use it at your OWN RISK.
table of Contents
1. Introduction 2.1 /etc/apt/sources.list file 2.2 How to use the APT 2.3 to select the best mirror publishing site to join the Source.list file: NetSelect, NetSelect-Apt 2.4 Add CD-ROM to Source.list Document 3. Package management 3.1 Update available package list 3.2 Installation package 3.3 Removal package 3.4 Update package 3.5 Upgrade to new version 3.6 Removing Useless Package file: APT-GET CLEAN AND AutoClean 3.7 Operation APT in DSELECT APT 3.8 How Keep A Mixed System 3.9 How to upgrade the package from Debian's dedicated version 3.10 How to maintain multiple versions of the installed package (complex) 4. Very useful Assistant 4.1 How to install local compilation package: Equivs 4.2 removal Useless Locale Files file: LocalePurge 4.3 How to know which packages can be upgraded 5. Get package information 5.1 Get package name 5.2 Using DPKG Find Package Name 5.3 How to "on-demand" installation package 5.4 How to know which package belong to which package belongs to 5.5 How to Master the Change of Packages 6. Operation Source Pack 6.1 Download Source Pack 6.2 Compile Source Packages required 7. How to handle Error 7.1 General Error 7.2 Where is it gets helpful? 8. Which versions support APT? 9. Thank 10. New version of this guide
Debian Apt HOWTO Chapter 1 Introduction Apt Howto Chapter 1 Introduction
Initially only .tar.gz package file, the user must compile each of the software he wants to run on GNU / Linux. Users generally believe that the system is necessary to provide a way to manage software packages on the machine. When Debian is born, such a management tool will be born, it is named DPKG. Thus, the famous "package" concept appeared in the GNU / Linux system, and later decided to develop its own "RPM" package management system later.
Soon a new problem is difficult to fill the GNU / Linux producer, they need a quick, practical, efficient way to install the package. When the package is updated, this tool should automatically manage associated files and maintenance existing configuration files. , Again, DEBIAN is the first to solve this problem, and the APT (Advanced Packaging Tool) was born. The APT is later retrofitted by Conectiva to manage RPM and is used by other Linux distributions to use their packages management tools.
This document does not intend to explain APT-RPM-related knowledge because the CONECTIVA Port of APT is very famous, but the supplementary documentation about this part is also welcome.
This document is based on the next release of Debian, the chief. Debian Apt HOWTO Chapter 2 Foundation Settings Apt Howto Chapter 2 Basics
2.1 /etc/apt/sources.list file ============================== as part of the operation, the APT uses a file list The mirror site address of the package can be obtained, this file is /etc/apt/sources.list.
The information in the file is usually listed in the format:
Deb http://site.http.org/debian distribution section section section section3 deb-src http://site.http.org/debian distribution section section section section3
Of course, the address items listed above are unavailable. The first word DEB or DEB-SRC of each row describes the file type, which contains binary packages (DEB), which is the compiled package we usually use; or contain source package (DEB) -src), source package contains source program encoding, debian management file (.dsc), and "Debian" record file Diff.gz.
It usually shows the following Debian default Sources.list:
# See Sources.list (5) for more information, especial # remetr That You can online uris # cdroms area management through the apt-cdrom Tool. Deb http://http.us.debian.org/ Debian Stable Main Contrib Non-Free Deb http://non-us.debian.org/debian-non-us stable / non-us main control non-free deb http://security.debian.org Stable / Updates Main Contrib Non-free
# UNCOMMENT if you want the apt-get source function to work # deb-src http://http.us.debian.org/debian stable main control Non-free # deb-src http: //non-us.debian. ORG / Debian-Non-US Stable Non-US
These are the Source address required for the DEBIAN basic installation, the first DEB line points to the official official package source, the second DEB line points to the Non-US software package source, the third DEB line points to the DEBIAN security patch update package source.
The last two lines were annotated (in the sentence first plus #), so the APT-GET will ignore them. These are the DEB-SRC line points to the Debian source package source, if you often download the program source code to test or recompile, you can cancel the comments to them.
The /etc/apt/sources.list file can contain multiple types of addresses, APT knows how to handle these different address types: HTTP, FTP, File (local files, for example: a directory loaded with ISO9600 file system) and SSH.
Don't forget to run the APT-GET after modifying the /etc/apt/sources.list file to make changes. You have to complete this step in order to get the APT to get a new list of packages from your designated place. 2.2 How to use the local APT ===================== sometimes there are many software packages on your hard disk, you will want to install them by APT, in order to deal with it Complex dependencies between software packages.
If you want to do this, build a directory and put all the .deb files you want to install in. E.g:
MKDIR / ROOT / DEBS
You can use an override file directly to modify the definitions in the managed file in the package, so that you meet your software storage management rules, you may want to define some options in this overloaded file. To override the definitions of those packages, as shown below:
Package Priority Section
Package is the name of the package, and Priority has three levels of Low, Medium, or High. Section is the section belonging to the package, and the redboard file can be arbitrarily named. The file name will be passed as a parameter in the next step to DPKG-Scanpackages. If you don't want to write overload files, just use / dev / null when calling DPKG-ScanPackages.
Still executing in / root directory:
DPKG-Scanpackages Debs File | Gzip> Debs / Packages.gz
In the above command line, the file is an overloaded file, the command generates a packages.gz file, which contains the various package information required for the APT, and uses these packages, plus: plus:
Deb file: / root debs /
To complete the above work, you can use the APT command to operate these packages. You can use the same way to generate a source code base, but remember that you need to be. ORIG.TAR.GZ file, .dsc file, and .diff.gz files are included in the directory, to generate a source.gz file instead of packages. GZ file. The command used is also different. To use dpkg-scansources, the command is as follows:
DPKG-Scansources Debs | Gzip> Debs / Sources.gz
Note DPKG-ScanSource does not require overload files, the reference to Sources.List is:
DEB-SRC File: / Root Debs /
2.3 Select the best mirror publishing site to join the Source.list file: NetSelect, NetSelect-Apt ================================ =============================================================================================================================================================================================================================== DEBIAN Mirror Publishing Site Add to Source.list file? ". There are many ways to choose the mirror release site, experts may write a script to test the ping time of different sites, but there is a ready-made program to help you: NetSelect. Install NetSelect
Apt-Get Install NetSelect
It will display its help when running it without parameters. When running it, add a mirror host list with space separation, which will return a host name in a score and a list. This score is derived by evaluating ping time and hops number (a number of forwarding hosts through the forwarding host through the target host), which is expected to be counter-specific than the mirror site (the smaller the value). The returned host name is the lowest score in the list (see the list of the host score). See the example:
Bash $ 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 $
It indicates that in all hosts listed after NetSelect, ftp.debian.org.br is the fastest hosting host, which scores 365. (Note !! This is the test result on my computer, the different network node network speed will be large, so this score does not necessarily apply to other computers)
Add the NetSelect found to join the speed of connection to the /etc/apt/sources.list file (see the /etc/apt/sources.list file, section 2.) And Follow The Tips In Managing Packages, Chapter 3.
Note: The mirror site list is usually included in the file http://www.debian.org/mirror/mirrors_full.
From version 0.3, the NetSelect package contains a NetSelect-Apt script that automatically completes the above operation. Simply use the publisher tree as a parameter (default as a stable), the Sources.list file generates the fastest MAIN and NON-US mirror site list and saves in the current directory. The following example generates a sourceS.List containing a list of stable issued a mirror site.
Bash $ LS SOURCES.LIST LS: SOURCES.List: File or Directory Not Found Bash $ NetSelect-Apt Stable (...) Bash $ ls -l sources.list Sources.list Bash $ Remember: Sources.list is generated in the current In the directory, you must move it to the / etc / APT directory.
THEN, FOLLOW the TIPS in Managing Packages, Chapter 3.
2.4 Join the CD-ROM to the Source.list file ============================================= Install and upgrade the package, you can add it to the Sources.list file. Complete this operation, you can use the APT-CDROM program:
Apt-CDROM Add
Put the Debian disc into the CD-ROM drive, which will load the disc directory and find the package information on the CD. If your optical drive requires additional settings, you can use the following options:
-H - Program Help -d Directory - CD-ROM MOUNT POINT-ROM-RENAME A Recognized CD-ROM -M - NO MOUNTING - FAST MODE, DON 'CHECK PACKAGES -A - Thorough Scan Mode
E.g:
Apt-cdrom -d / home / kov / mycdrom add
You can also scan a disc, but don't add it to the list:
Apt-CDROM IDENT
Note that the program will only work if you have properly set the optical drive correctly in the system / etc / fstab.
Debian Apt HOWTO Chapter 3 Sackage Management Apt Howto Chapter 3 Package Management
3.1 Update the available package list ================================================================================================================================ Or can be installed. The APT-GET uses this database to determine how the software package you want to use and other associated packs that must be in the normal running package.
You can use the APT-GET Update to update the database list. This command will scan the list of software package in the path to the /etc/apt/sources.list file. For more information on this list file, please check the /etc/apt/source.list file.
Timing this program is a good idea, which will make you and your system get the latest package update and security update.
3.2 Installing the package ============== Now, finally arrived at the stage you have been looking forward to! Prepare Sources.List and the latest version of the available packages, what you need to do is to run the APT-GET to install your long-awaited software. For example, you can do this:
Apt-get install xchat
The APT scans its database to find the latest version of the package and download it from the area referred to in Sources.List to the local. If the package requires other packages to run normally - as this example -APT will do the associated package and automatically install the associated package. As follows:
[Root] @ [/] # apt-get install nautilus Reading Package Lists ... Done Building Dependency Tree ... Done The following extra packages will be installed: bonobo libmedusa0 libnautilus0 The following NEW packages will be installed: bonobo libmedusa0 libnautilus0 nautilus 0 Packages Upgraded, 4 Newly Installed, 0 To Remove and 1 Not Upgraded. Need to get 8329kb of archives. After unpacking 17.2MB Will be used. Do you want to continue? [Y / N] Nautilus package require reference sharing log library Therefore, the APT downloads the associated shared function library from the mirror source. If you manually specify the name of these shared functions libraries in the Apt-Get command line, the APT will default to all of these packages.
That is to say, the APT will only be confirmed when installing the packages not specified in the command line.
The following APT-GET options may be useful to you
-h This help text -d Download only -.. do NOT install or unpack archives -f Attempt to continue if the integrity check fails -s No-act Perform ordering simulation -y Assume Yes to all queries and do not prompt -u Show a list of upgraded packages as well
Multiple packages can be installed with a command. The package file is downloaded from the network to the local / var / cache / Apt / Archives directory, and then install later.
You can use the same command line to delete the specified package, just follow one "-" after the package name, as follows:
[Root] @ [/] # apt-get install nautilus gnome-panel- Reading Package Lists ... Done Building Dependency Tree ... Done The following extra packages will be installed: bonobo libmedusa0 libnautilus0 The following packages will be REMOVED: gnome -applets gnome-panel gnome-panel-data gnome-session The following NEW packages will be installed: bonobo libmedusa0 libnautilus0 nautilus 0 packages upgraded, 4 newly installed, 4 to remove and 1 not upgraded Need to get 8329kB of archives After unpacking.. 2594KB Will Be used. Do you want to continche? [Y / n]
See 3.3 Removing Packages for more details on deleting packages.
If you accidentally damage the installed package and want to fix it, or just want to install the latest version of some files in the package, this is what you can do, you can use - Reinstall options:
[root] @ [/] # Apt-get - Reinstall Install GDM Reading Package Lists ... Done Building Dependency Tree ... Done 0 Packages Upgraded, 0 Newly Installed, 1 Reinstalled, 0 To Remove and 1 Not Upgraded. NEED TO GET 0B / 182KB of Archives. After Unpacking 0b Will Be Used. Do you want to continche? [Y / N] The APT version referred to when writing is 0.5.3, which is also "unsTable" (SID) stage. If you installed this version, you can use new features in the system configuration: You can use the APT-GET Install Package / Distribution to install the package in the specified release, or use the APT-GET Install Package = Version, as follows Down:
Apt-get install nautilus / unsteable
It will install the Nautilus package in the "Unstable" release, even if you are currently running the "stable" version. The available parameter values for the "Distribution" option in the command are: Stable, Testing, Unstable.
When dealing with the association problem, you may be more happy to use the -T switch to select the target release, let the APT-GET help you consider which release.
Important: The latest version of the debian package first uploaded to the "Unstable" release, this release contains all the changes in the package, whether it is minor modification that is small repair, which affects numerous packages and even the entire system. So, users who emphasize system stability will not use this release.
The "Testing" release is more than the "unsteable" release, with some system stability, but the officially running system should use the "Stable" release.
3.3 Removing the package ============== If you no longer use some packages, you can use the APT to remove it from the system. To delete a package simply enter: APT-GET Remove Package. As follows:
[root] @ [/] # APT-GET Remove Gnome-Panel Reading Package Lists ... DONE BUILDING Dependency Tree ... DONE The Following Packages Will Be Removed: GNOME-Applets Gnome-Panel GNOME-PANEL-DATA GNOME-Session 0 newly installed, 4 to remove and 1 not upgraded. Need to get 0b of archives. Inster unpane 14.6MB Will Be Freed. Do you want to continue? [Y / n]
From the above example, the APT will pay attention to the package that has dependencies with the deleted package. Deleting a package using the APT will be connected to a package that is dependent on the package.
In the above example, run the APT-GET will delete the specified package and the software package with dependencies, but their configuration files, if any, will keep it in the system in intact. If you want to completely remove these packages and their configuration files, run:
[root] @ [/] # Apt-get --purge remove gnome-panel ready package list ... DONE BUILDING DEPENDENCY Tree ... DONE THE FOLLOWING PACKAGES WILL BE Removed: GNOME-Applets * Gnome-Panel * Gnome-Panel -Data * gnome-session * 0 packages Upgraded, 0 Newly Installed, 4 to remove and 1 not upgraded. NEED TO GET 0B OF Archives. After Unparain 14.6MB Will Be Freed. Do you want to continue? [y / n] : The package name later * indicates that all profiles of the package will also be deleted.
Like the installation software, you can specify a package with a symbol in the delete command. When you delete a package, if you follow a " " behind the package name, the package will be installed instead of deletion.
[Root] @ [/] # apt-get --purge remove gnome-panel nautilus Reading Package Lists ... Done Building Dependency Tree ... Done The following extra packages will be installed: bonobo libmedusa0 libnautilus0 nautilus The following packages will be REMOVED: gnome-applets * gnome-panel * gnome-panel-data * gnome-session * The following NEW packages will be installed: bonobo libmedusa0 libnautilus0 nautilus 0 packages upgraded, 4 newly installed, 4 to remove and 1 not upgraded Need to. Get 8329kb of archives. After unpacking 2594kb Will be used. Do you want to continue? [y / n]
Note that the APT-GET lists those associated packages that will be installed (that is, other packages that ensure the normal running of the package) and will be deleted the associated package, then listen to the package that will be installed.
3.4 Update Software Pack ============== The package update is the most successful feature of the APT. You can complete the update with a command: APT-GET UPGRADE. You can use this command to update the package from the same version number, or update the package from the new version number publishing, although the latter update is implemented as an Apt-Get Dist-Upgrade; 3.5 Upgrade to the new version.
Plus -u option is useful when running this command. This option allows the APT to display a full updateable package list. Without this option, you can only update blindly. The APT downloads the latest update versions of each package, and then install them in a reasonable order. Note You should run the APT-GET Update update the database before running the command. See 3.1 Update Software Package List for details. Take a look at this example:
[Root] @ [/] # apt-get -u upgrade Reading Package Lists ... Done Building Dependency Tree ... Done The following packages have been kept back cpp gcc lilo The following packages will be upgraded adduser ae apt autoconf debhelper dpkg -dev esound esound-common ftp indent ipchains isapnptools libaudiofile-dev libaudiofile0 libesd0 libesd0-dev libgtk1.2 libgtk1.2-dev liblockfile1 libnewt0 liborbit-dev liborbit0 libstdc 2.10-glibc2.2 libtiff3g libtiff3g-dev modconf orbit procps psmisc 29 packages Upgraded, 0 newly installed, 0 to remove and 3 not upgraded. need to get 5055b / 5055kb of archives. After unpacking 1161kb Will be used. Do you want to contactue? [Y / N] The entire update process is very simple. Note that in this case, the APT-GET reports some packages of some packages are blocked (Kept Back), which indicates that the update version of these packages cannot be installed, and there may be associated asgens (currently not available for download) New version association package) or association extension (need to install a new associated package to match the new version of the package).
There is no good solution for the first reason. For the second reason, the new associative package required to run the APT-GET Intall installation can be. Another better solution is to use Dist-Upgrade. See 3.5 Upgrade to the new version for details.
3.5 Upgrade to the new version ================ APT is to let you complete the entire system update, whether through the Internet or through the disc file (purchased disc or download ISO mirror file).
It can also be used to update some software packages that have changed relationships. That is, the software package of the Kept Back is blocked when using APT-GET UPGRADE as previously described.
For example, suppose you currently use Debian as Stable Revision 0 (such as Woody 3.0 R0, Translator Note), and you bought a new version of Revision 3 (such as Woody 3.0 R3, Translator Note), you can use APT from the new CD Upgrade your system. Using APT-CDROM (see 2.4 Add a CD-ROM to the Source.list file) Load the disc to the /etc/apt/sources.list and run the APT-GET DIT-UPGRADE.
Note that the APT is always searching for the latest version of the package, so if a package is new in your /etc/apt/sources.list, the APT will follow Sources The address referred to by .List file Download this package instead of using a package on the CD.
In the 3.4 update package, we got an example. We see some packets that are blocked by the key, now we use the dist-upgrade method to solve this problem: [root] @ [/] # Apt-get - u dist-upgrade Reading Package Lists ... Done Building Dependency Tree ... Done Calculating upgrade ... Done The following NEW packages will be installed: cpp-2.95 cron exim gcc-2.95 libident libopenldap-runtime libopenldap1 libpcre2 logrotate mailx The following packages have been kept back lilo The following packages will be upgraded adduser ae apt autoconf cpp debhelper dpkg-dev esound esound-common ftp gcc indent ipchains isapnptools libaudiofile-dev libaudiofile0 libesd0 libesd0-dev libgtk1.2 libgtk1.2-dev liblockfile1 libnewt0 liborbit- dev liborbit0 libstdc 2.10-glibc2.2 libtiff3g libtiff3g-dev modconf orbit procps psmisc 31 packages upgraded, 10 newly installed, 0 to remove and 1 not upgraded. Need to get 0B / 7098kB of archives. After unpacking 3118kB will be used. Do you want to continche? [Y / n]
Note that those packages will be updated, and those new associated packages are also installed. But LILO is still prevented, there may be some more difficult issues than the establishment of a new association, we determine the problem by the following methods:
[Root] @ [/] # apt-get -u install lilo Reading Package Lists ... Done Building Dependency Tree ... Done The following extra packages will be installed: cron debconf exim libident libopenldap-runtime libopenldap1 libpcre2 logrotate mailx The following packages will be REMOVED: debconf-tiny The following NEW packages will be installed: cron debconf exim libident libopenldap-runtime libopenldap1 libpcre2 logrotate mailx The following packages will be upgraded lilo 1 packages upgraded, 9 newly installed, 1 to remove and 31 not upgraded. NEED TO GET 225KB / 1179KB of Archives. After unpacking 2659kb Will be used. Do you want to continue? [Y / n]
To view the above prompt information, LILO has a new conflict with the debconf-tiny package, which indicates that LILO will not be updated unless DebConf-Tiny is deleted. Want to know which packages should be reserved or deleted, you can use:
# Apt-get -o Debug :: pkgProblemResolver = yes dist-upgrade Reading Package Lists ... Done Building Dependency Tree ... Done Calculating Upgrade ... Starting Starting 2 Investigating python1.5 Package python1.5 has broken dep on python1 .5-base considering python1.5-base 0 AS A Solution To Python1.5 0 Holding Back Python1.5 Rather Than Change Python1.5-Base Investigating Python1.5-Dev Package Python1.5-Dev Has Broken Dep On Python1. 5 Considering python1.5 0 as a solution to python1.5-dev 0 Holding Back python1.5-dev rather than change python1.5 Try to Re-instate python1.5-dev Done Done The following packages have been kept back gs python1 .5-dev 0 Packages Upgraded, 0 Newly Installed, 0 To Remove and 2 Not Upgraded.
Now, you can easily know that you can't install the Python1.5-DEV package because you can't meet the association requirements of another package Python1.5.
3.6 Remove the useless package file: Apt-get clean and autoclean ==================================== =============== When you need to install a package, the APT downloads the required files from the host listed in the /etc/apt/sources.list, saving them to This machine software library (/ var / cache / APT / Archives), then start installation, see 3.2 Installing the package.
The local software library will constantly expand a large number of hard disk space, fortunately, the APT provides tools to manage local software libraries: APT-GET Clean methods and Autoclean methods.
Apt-Get Clean will delete / var / cache / apt / archives directory and / var / cache / apt / archives / partial directory, except for the locked file. Since this, the APT will re-download it when you need to install a package again.
Apt-get AutoClean only deletes files that do not need to download again.
The following example shows how Apt-Get AutoClean works:
# ls / var / cache / Apt / Archives / logrotate * / var / cache / APT / Archives / GPM * logrotate_3.5.9-7_i386.deb logrotate_3.5.9-8_i386.deb gpm_1.19.6-11_i386.deb in / var / cache / APT / Archives directory has two different versions of Logrotate package files and a GPM package file.
# apt-show-versions --p logrotate logrotate / stable uptodate 3.5.9-8 # apt-show-versions -p GPM GPM / Stable Upgradeable from 1.19.6-11 to 1.19.6-12
Apt-show-version is displayed logrotate_3.5.9-8_i386.deb provides the upgrade version of Logrotate, so logrotate_3.5.9-7_i386.deb is useless. The same GPM_1.19.6-11_i386.deb is also useless because the updated version of the package can be downloaded.
# APT-GET AutoClean Reading Package Lists ... DONE BUILDING Dependency Tree ... DONE DEL GPM 1.19.6-11 [145KB] Del Logrotate 3.5.9-7 [26.5kb]
In summary, Apt-Get AutoClean only deletes those outdated files. See 3.9 How to upgrade the package from Debian's private version to get more APT-Show-Versions related information.
3.7 Operation in DSELECT APT ====================== DSELECT Tool helps users choose the Debian package you want to install. It is a bit complicated and even boring, but after practicing you can master the horrible terminal interface.
One of the advanced features of DSELECT is that it knows "recommendation" and "recommended" capabilities that use Debian packages. (Debian software package has a capability: recommendation or suggesting that the system installs yourself, installing other packages to cooperate with its own work, of course, these recommended software packs are not necessarily necessary; and DSELECT tools can identify and use this capability When you use DSELECT, you can experience. Translator Note) Run DSELECT as root, select APT as a connection method after entering the program. This step is not necessary, but if you don't have a drive and want to download and install the package via the Internet, this is the best way to use DSELECT.
For more than learning DSELECT, please go to the DSELECT document page at the Debian website http://www.debian.org/doc/ddp
After the package is selected in DSELEC, run:
Apt-get -u dselect-upgrade
As shown in the following example:
[Root] @ [/] # apt-get -u dselect-upgrade Reading Package Lists ... Done Building Dependency Tree ... Done The following packages will be REMOVED: lbxproxy The following NEW packages will be installed: bonobo console-tools -libs cpp-3.0 enscript expat fingerd gcc-3.0 gcc-3.0-base icepref klogd libdigest-md5-perl libfnlib0 libft-perl libgc5-dev libgcc300 libhtml-clean-perl libltdl0-dev libsasl-modules libstdc 3.0 metamail nethack proftpd- doc psfontmgr python-newt talk tidy util-linux-locales vacation xbill xplanet-images The following packages will be upgraded debian-policy 1 packages upgraded, 30 newly installed, 1 to remove and 0 not upgraded. Need to get 7140kB of archives. After Unpacking 16.3MB Will BE Used. do you want to contact? [Y / N] Compare us when we run apt-get dist-upgrade on the same system:
[Root] @ [/] # apt-get -u dist-upgrade Reading Package Lists ... Done Building Dependency Tree ... Done Calculating Upgrade ... Done The following packages will be upgraded debian-policy 1 packages upgraded, 0 NEWLY INSTALLED, 0 TO Remove and 0 Not Upgraded. NEED TO GET 421KB OF Archives. After unpacking 25.6kb Will Be Freed. Do you want to continue? [y / n]
We see that many packages in the precedent are installed are the results of other packages "recommended" or "suggestions". Other packages are installed or deleted (eg, the LBXProxy package) is the decision we made through the DSELECT tool. This shows that DSELECT combines with the APT will be a powerful tool.
3.8 How to build a hybrid system ======================== People often use the Testing release, because it is stable than the unsteable. However, there is another option for those who want to run certain packages, and don't want to migrate the entire system to the unsteable release version: Run a Testing / UnStable hybrid system. For another part of the conservative user, they may want to run the Stable / Testing hybrid system.
To implement a hybrid system, add the following statement in /etc/apt/apt.conf:
Apt :: Default-release "testing";
In the future, use the -T switch when installing the package from the unsteable release version: # apt-get -t unsteable install packagename
Don't forget, when using a package of Debian, you should add the mirror source to the /etc/apt/sources.list file. In this example, in addition to joining the Testing publishing mirroring source, we also need to join the unsteable publishing mirror source.
3.9 How to upgrade the package from Debian's special version ============================================ -Show-Versions provides a safe way to secure users who use hybrid systems to upgrade their systems. Don't worry that the upgrade will upgrade the package that is the Stable package into a unsteable package. For example, this command will only upgrade your unsteable package:
# APT-GET Install `Apt-show-versions-u -b | grep unsteable`
3.10 How to maintain multiple versions of the installed package (complex) ==================================== ====== You may encounter this situation, change some files in a package, but you don't want to introduce these changes in the new version without time or at all. Or, you upgrade the system to 3.0, but still want to continue using a package under Debian 2.2. You can "pin" (pin) this version so that it will not be updated.
It is very simple to operate, you only need to edit the / etc / apt / preferences file.
The file format is simple:
Package:
For example, I have made some modifications to the sylpheed package, and the version is 0.4.99, I want to keep these modifications are not updated, can be added:
Package: Sylpheed PIN: VERSION 0.4.99 *
Note I used a * (asterisk). This is a "wildcard"; it indicates that I want "pin" all the version of the 0.4.99 head (to prevent them to be downloaded and installed on my machine. PIN control is the server-side update software package rather than the local Install the package. Translator's note). Because Debian uses the "Debian version number" to set the version for its software, I don't want to upgrade all of these versions. If you don't have tolerate, then 0.4.99-1 or 0.4.99-10 version is only available, you will install them. . If you modify the package, you must do this.
Priority is an optional domain; if it is not specified, its default is 989.
Let's take a look at how PIN reflects the priority difference. A priority of less than 0 indicates that the package is disabled; priority is between 0 and 100: The package is not installed and there is no available version, which does not appear in the list of selected versions; The priority is 100 indicates that the package has been installed - for this installed package, if there is a different version to replace it, then the replacement must be greater than 100. The priority is more than 100 indicates that the package should be installed. Typical examples, such as the upgrade patch package of a package, any priority between 100 and 1000 (including 1000) means the above situation. However, if a package is set to this priority, it does not degrade the installed version. For example, if I have installed Sylpheed 0.5.3 and specified a PIN of 999 for Sylpheed 0.4.99, the 0.4.99 package will not be installed because the PIN is required to meet the priority of the PIN. If you want to implement the package "Down", you need to set the priority of the PIN to be greater than 1000. (100
PIN can be used to control the revision of the package (Version), a release version, or version source (Origin).
In the front we have seen, use wildcards when nailing a revision, replacing the version number, which specifies multiple versions at a time.
The Release option is based on the release file, this file is on the local APT software library or on the disc. If you install a software package from your local software library and there is no file in the software library, then this option will be invalid. To see the contents of the / var / lib / Apt / LISTS / directory, the publishing includes these parameters: A (Archive), C (Version), O (Origin), L (Lable) .
Let's take an example:
Package: * PIN: Release V = 2.2 *, a = stable, c = main, o = debian, l = debian priority: 1001
In this example, we chose the version of the version of 2.2 * (it can be 2.2R2, 2.2R3 - these versions contain "Point Releases", security updates, and other very elevated updates), Stable Software Library, Main Class software package (non-Contrib or Non-Free), version sources and tags are Debian. Version Source (o =) Description Who makes this release file, the label (l =) indicates the name of the release: Debian means debian himself, Progeny is a descendener, the following is a release file. example:
$ Cat /var/lib/apt/lists/ftp.debian.org.br_debian_dists_potato_main_binary-i386_Release Archive: stable Version: 2.2r3 Component: main Origin: Debian Label: Debian Architecture: i386Debian APT HOWTO Chapter IV of several very useful tool Apt Howto Chapter 4 A few very useful tools
4.1 How to install local compilation package: Equivs =========================================================================================== Use certain software special versions, they only exist in the form of source code, no ready-made Debian package. Package management systems may have problems when processing such transactions. Suppose you want to compile new version of the mail server, compile, install everything, but the package management system does not know what you compile yourself in the system, in the Debian, MTA (Mail Transport Agent Mail Transfer Agent) The package doesn't know this.
It is time for Equivs. Use it to install the package, what it does is to create a new empty package to achieve the association, so that the package management system believes that the association is implemented.
Before we started, I must remind you that compiling a software is the safest way is to recompile the existing Debian package for this software. If you don't know what you are doing, please don't use the Equivs replacement association package. See Chapter 6 Source Package for more information.
Continue the above example, you have installed the newly compiled postfix, then plan to install MUTT, suddenly you find that Mutt wants to associate with another MTA, and you want to use the new MTA you just installed.
Go to a directory (such as / tmp) execute:
# Equivs-Control Name
Replace Name to create the management file you created, the management file is created as follows:
Section: Misc Priority: Optional Standards-Version: 3.0.1
Package:
Section: Misc Priority: Optional Standards-Version: 3.0.1
Package: MTA-LOCAL Provides: Mail-Transport-Agent
This is the case. MUTT is to be associated with Mail-Transport-Agent, which is a virtual package for all MTA shared (Virtual package), I can simply name this package Mil-Transport-Agent, but I am more willing to use the virtual package program of the system. Use the Provides option.
Now you can start creating a package:
# Equivs-build name 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 `name 'in `../name_1.0_all.deb'.
The Package Has Been Created. Attention, The Package Has Been Created in The Current Directory,
Then install this newly created .deb.
As we all know, there is a lot of use of Equivs, and it can even create personalized versions for the underlying association package of common software. Let's play your imagination, but be careful.
Important: The sample file of the Control Files is in the / usr / share / doc / equivs / examples directory. 4.2 Removing Useless Locale Files File: LocalePurge =========================================== === Many Debian users use Debian only in the fixed area. For example, in Brazilian Debian users, usually use the PT_BR region profile (Locale File) without care for the ES area profile.
For such users, LocalePurge is a very useful tool that you can only keep the area profile you are using, delete other useless files, and release a large number of hard disk space. Run the Apt-Get Install LocalePurge.
It is very easy to configure, DebConf's question will boot user step by step to complete the setting. Be careful when answering the first question, if you answer, the system may delete all regional profiles, including this you are using. The only way to restore their is to reload those packages.
4.3 How to know which packages can be upgraded ======================================= Apt-show-version tool can tell you what Packages can be updated and other useful information. -u options can display available software package lists:
$ APT-Show-Versions -u Libeel0 / UnStable Upgradeable from 1.0.2-5 to 1.0.2-7 Libeel-Data / UnStable Upgradeable from 1.0.2-5 to 1.0.2-7
Debian Apt HOWTO Chapter 5 Getting Package Information Apt Howto Chapter 5 Getting Package Information
Some APT systems-based front-end programs can be easily accessible, and the list includes installable or installed packages, which can also display which domain belonging to a package, its priority is How much, its description document, and so on.
But ... here we think about how to use the APT itself. How do you find the name of the package you want to install?
We have a lot of ways to complete this task. We started from the APT-Cache, the APT system uses this program to maintain its database. Below we make an overview of it through some practical operations.
5.1 Get the name of the package ================== assume you very much missing the good days of playing Atari 2600, you decide to install an Atari Emulator with the APT, then download a few games, You can do this:
[root] @ [/] # APT-Cache Search ATARI ATARI-FDISK-Cross - Partition Editor for Atari (Running On Non-Atari) Circuslinux - The Clowns Are Trying to Pop Balloons To Score Points! Madbomber - a kaboom! Clone TCS - Character Set Translator. Atari800 - Atari Emulator for Svgalib / X / Curses Stella - Atari 2600 Emulator for x Windows Xmess-x - x binaries for multi-emulator super system We found several related packages, as well as simple description . I want to further get the details of a package, you can run:
[root] @ [/] # APT-Cache Show Stella Package: Stella Priority: Extra section: Non-Free / OtherOSFS Installed-Size: 830 Maintainer: Tom Lear
The detailed information of this package is displayed on the screen and the full description of its use. If a package has been installed in your system, the system also searches for its new version, and the system will be listed together. Such examples:
[root] @ [/] # APT-CACHE SHOW LILO PACKAGE: LILO Priority: Important Section: Base Installed-Size: 271 Maintainer: Russell Coker
Note that the first list is the available package, then listed is the installed package. Gets regular information for a package to run:
[Root] @ [/] # 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: 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: If you just want to know which packages are associated with a package, you can run:
[root] @ [/] # APT-CACHE Depends Penguin-Command Penguin-Command Depends: libc6 depends: libpng2 depends: libsdl-mixer1.1 depends: libsdl1.1 depends: zlib1g
In short, there is a series of tools to help us find the package we want.
5.2 Find the software package name using the DPKG ============================================================= name. For example, you need a header file when you compile, find a package that provides the file, you can run:
[root] @ [/] # 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
or:
[root] @ [/] # DPKG -S /USR/include/stdio.h libc6-dev:/usr/include/stdio.h
When cleaning hard disk space, understand the software package name of the installed software installed in the system is very useful, you can run:
[root] @ [/] # DPKG -L | GREP Mozilla II Mozilla-Browse 0.9.6-7 Mozilla Web Browser
The disadvantage of this command is that it will "truncate" the name of the package. In the above example, the full name of the package is Mozilla-Browser, solving this problem can use the columns environment variable:
[KOV] @ [couve] $ columns = 132 DPKG -L | Grep Mozilla II Mozilla-Browser 0.9.6-7 Mozilla Web Browser - Core and Browser
Or show this:
[root] @ [/] # APT-Cache Search "Mozilla Web Browser" Mozilla-Browser - Mozilla Web Browser
5.3 How to "on-demand" installation package ========================== You are compiling a segment, suddenly, stopped! A error message report says that you don't have the header it needs. Let Auto-Apt to save you, it asks if you want to install the needed package, then hang up the compile process, and then restore the compilation process after installing the package.
All you have to do is:
Auto-Apt Run Command
Here "Command" refers to a command that may have a "demand file does not exist" during operation. E.g:
Auto-apt run ./configure, it will tell you to install the required packages and automatically go to APT-GET processing. If you are running X, you will a graphical interface prompt window.
In order to improve the database used by the efficiency Auto-APT needs to be updated in real time. You can call Auto-Apt Update, Auto-Apt UpdateDB, and Auto-Apt Update-Local to complete the update.
5.4 How do I know which package belongs to which package ============================================= -cache can't detect its name, but you know the file name of this program, or file name of some files in this package, then you can use the APT-File to find the package name.
$ APT-FILE Search FileName
It uses very much like DPKG -S, but it will also list the deleted package containing the file. It can also be used to find which package contains files lacking time, of course, the AUTO-APT may be better solutions, see 5.3 How to "on demand" installation package.
With this command, you can list the contents of the package:
$ APT-File List packageName
Apt-file uses a database to store the content information of all packages, like Auto-Apt, this database also needs real-time updates, complete updates can be run:
# APT-FILE UPDATE
By default, the APT-File and Auto-Apt use the same database, see 5.3 How to "on demand" installation package.
5.5 How to master the change of the package ============================ After each package is installed, it will be in the document directory ( / usr / share / doc / packagename Generates a file of changelog.debian.gz, which records the last update of the package to the system, and you can read this information with Zless. However, after you upgrade the entire system, the update information that views the package one by one is not easy.
There is a tool to help you complete this task, it is APT-LISTCHANGES. First you have to install the APT-LISTCHANGES package. During the installation process, DebConf will ask you some questions and answer them according to your request.
"Should Apt-ListChanges Be Automatically Run By Apt" This option is very useful because you use the APT update package, it will tell you that this package update will What modifications have been made by the original system, you analyzed this information, and then decide whether to perform this update. "SHOULD APTCHANGES PROMPT for Confirmation After Displaying Changes?" After the update information is displayed, is you needed to confirm your confirmation?) The option is also very useful, because after you read the updated information, it will ask you if you Continue to install the process, if you don't want to continue, Apt-ListChanges returns an error message to tell the APT to stop the installation process. After the Apt-ListChange is installed, the system update information of these packages will be displayed whenever the APT downloads the package (regardless of the Internet, CD or hard drive).
Debian Apt HOWTO Chapter 6 Source Pack Operation Apt Howto Chapter 6 Source Package
6.1 Download the source package ============== In the world of free software, you often need to learn the source or deactivate the program, so you need to download them. The APT provides a simple way to help you get the source code for many programs in the release, and all files you need to create .deBS.
Another universal purpose of the Debian source code is to rewrite the new version of the unsteable release to use, for example, introducing a new package from the Stable release version, need to be regenerated. DEBS will be in the original release Association relationship migrates to a new release.
Complete these work, the / etc / apt / sources.list file should be a mirror source to be unsteable, don't forget to remove the annotation of the head. See the 2.1 / etc / APT / SOURFES.LIST file for details.
Download the source package with the following command:
Apt-Get Source PackageName
Three files are usually downloaded: a .orig.tar.gz, a .dsc and a .diff.gz. For DEBIAN-specific packages, the last file will not download, there is no "orig" item in the file name of the first file.
DPKG-SOURCE reads the .dsc file information, unpack the source package to the package-version directory, there is a debian / directory in the Source package downloaded, which is the file required to create a .deb package.
The source package you want to download is automatically compiled into a package, just add -b in the command line, as follows:
Apt-get -b source packagename
If you are not intended to create a .deb package now, you can run the following command, then create it.
DPKG-buildpackage -rfakeroot -UC -B
Run the above command in the directory where the download package is downloaded.
The Source command of the apt-get is different from its other commands. The normal user privileges can run the source command, and the specified file is downloaded to the user to call the apt-source package command.
6.2 Compiling the package required for the source package ====================================================================================================== The library has a domain "build-depends:" in the management file of all source package, which points out which additional packages need to compile the source package. APT provides a simple way to download these additional packages, you only need to run the APT-Get Build-Dep Package, where package is the source package name you intend to compile. See here:
[root] @ [/] # 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 ]
These additional packages for GMC to correctly compile specifying the source package will be installed. Note that this command cannot be used to search for a source of software, you have to run an additional APT-GET SOURCE download source package.
Debian Apt HOWTO Seventh chapter How to Handle Error Apt Howto Chapter 7 How to Handle
7.1 General error ============ Error always occurs, mostly because of the carelessness of the user, list some common errors and processing methods.
If you run the Apt-Get Install Package ..., your system reports the following information:
Reading package lists ... DONE BUILDING Dependency Tree ... DONE W: COULDN ''TP: //people.debian.org unsteable / packages' (/VAR/State/apt/LISTS/PEOPLE.DEBIAN .org_% 7ekov_debian_unstable_pages) - Stat (2 No Such File or Directory) W: You Want To Run Apt-Get Update To Correct There Missing Files E: COULDN '' FIND Package Penguineyes
After you modify /etc/apt/sources.list last time, I forgot to run the APT-GET Update update.
If such information appears:
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?
If you don't have root permissions, when you run other APT-GET commands in Source, if you have the above error message. When you run two APT-GET processes, or when you try to run the APT-GET, there is an activation state, and the system will also report the error message similar to the above. The only source command that can run simultaneously with other commands.
If an interrupt occurs during the installation process, then you find that the package can neither reload and delete it, try the following two commands:
# apt-get -f install # DPKG --CONFIGURE -A
Try to install the package, if you don't run the above command again, try again. These two orders are very useful for players who use unsterable.
7.2 Where did you get help? =================== If you find that you have too much questions, it doesn't matter, there are a lot of debian package management system documents for your reference. --Help and Help documents provide you with huge help, such documents are located in / usr / share / doc directory, such as / usr / share / doc / apt.
If this document can't help you solve problems, you can go to the debian mailing list to find the answer, you will get more information in the relevant column. Debian's URL is: http://www.debian.org.
Remember that only Debian users can get these mailing lists and resources, users of other operating systems, please get more resources in the communities established by the relevant system publisher.
DEBIAN APT HOWTO Chapter 8, which release supports APT? APT HOWTO Chapter 8, which release supports APT?
Below is a part of the publishing community using the APT system:
Debian gnu / linux (http://www.debian.org) - APT developer
CONECTIVA (http://www.conectiva.com.br) - The first release group for RPM is transplanted in RPM
Mandrake (http://www.mandrake.com)
PLD (http://www.pld.org.pl)
Vine (http://www.vinelinux.org)
APT4RPM (http://apt4rpm.sf.net)
Alt Linux (http://www.altlinux.ru/)
Red Hat (http://www.redhat.com/)
Sun Solaris (http://www.sun.com/)
SUSE (http://www.suse.de/)
Yellow Dog Linux (http://www.yellowdoglinux.com/)
Debian Apt HOWTO Chapter 9 Acknowledgments APT HOWTO Chapter 9 Acknowledgment
Thank you very much, my debian-br project team! And you debian, always help me around me, give me the strength of the work to contribute to all mankind, helping me establish the ideal of saving the world. :)
I would also like to thank CIPSGA, they gave our project group and even the entire free software project huge help, it is our inspiration.
Special thanks to:
Yooseong yang
Michael Bramer
Bryan Stillwell
Pawel Tecza
Hugo Mora
Tomohiro Kubota
Pablo lorenzzoni
Steve langasek
Arnaldo Carvalho de Melo
Erik Rossen
Ross Boylan
Matt Kraai
Aaron M. ucko
Jon? Slund
DEBIAN APT HOWTO Chapter 10 This guide This guide Apt HOWTO Chapter 10 This guide has a new version of this guide
This operating manual is written by the Debian-BR project team, and we hope that it can provide effective help for Debian users.
You can get the new version of this document from the Debian document project page: http://www.debian.org/doc/ddp
Any opinions or suggestions for this document can be sent to me directly: kov@debian.org
Debian Apt HOWTO is very grateful to the version, which will be included in the essence, thank you!
Learning Debian has gone a lot of bending roads, and the experience is debian started three axes: DSELECT, APT, kernel compilation, mastering these three, even if you get started, you will easily learn more. There is no polite: Debian is Packages.
I wanted to watch the DSELECT head, I didn't find a complete Chinese document for a long time. I didn't have a good time to read E text. I spent a lot of time. After reading, there was a lot of skill, and now I actually feel DSELECT. Is the most pleasant package management software.
I have recently had a leisure time, so I have a few documents, I hope that I can save everyone a time. At this time, I have suffered a lot of Chinese documents. Every time a big translator is not responsible, I only know the hardships when I have translated myself. In the first thing I have to understand the principle, I only hope that the future is less reader. However, due to the professional and technical level, it is very limited. If you debian master read the translation of the translation, it is found that there is a mistake or not understand, please send me an email, so as to avoid misunderstanding, I will upgrade the document.
In the translation process, I do my best to maintain the style of the original text, but Chinese and English expressions have a small difference, so there are some places to translate and read weird, not understand, these places I have (translator " Note) Ways have been used. "Introduction" in the entire document, "What release supports APT? "," Acknowledgments "," New Version of this Guide "There are no technical information, but considering the integrity of the document, it is also translated, hoping to enter the essence area.
Next, try to translate DSELECT's official document, I hope it is what you are looking forward to. :)