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
==================
Suppose you miss 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
Ximent-x - x binaries for Multi-Emulator Super System
We found several related packages and related brief 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
Architecture: i386
Version: 1.1-2
Depends: libc6 (> = 2.1), libstdc 2.10, XLIB6G (> = 3.3.5-1)
Filename: dists / Potato / Non-Free / Binary-i386 / OtherOSFS / Stella_1.1-2.deb
Size: 483430
MD5SUM: 11B3E86A41A60FA1C4B334DD96C1D4B5
Description: Atari 2600 emulator for x windows
Stella is a portable emulator of the old atari 2600 video-game console
Written In C . You can Play Most Atari 2600 Games with it. The Latest
News, Code and Binaries for Stella Can Be Found AT:
http://www4.ncsu.edu/~bwmott/2600
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
Architecture: i386
Version: 1: 21.7-3
Depends: libc6 (> = 2.2.1-2), debconf (> = 0.26), logrotate
Suggests: LILO-DOC
Conflicts: MANPAGES (<< 1.29-3)
Filename: pool / main / l / lilo / lilo_21.7-3_i386.deb
SIZE: 143052
MD5SUM: 63FE29B5317FE34ED8EC3AE955F8270E
Description: Linux Loader - The Classic OS Loader Can Load Linux and Others
THIS PACKAGE CONTAINS LILO (THE Installer) and boot-record-images
Install Linux, OS / 2, Dos and Generic Boot Sectors of Other OSES.
.
You can use lilo to manage your master boot record (with a simple text screen)
OR CALL LILO from other boot-loaders to jump-start the linux kernel.
Package: lilo
Status: Install Ok Installed
PRIORITY: IMPORTANT
Section: Base
Installed-Size: 190
Maintainer: vincent renardias
Version: 1: 21.4.3-2
Depends: libc6 (> = 2.1.2)
Recommends: MBR
Suggests: LILO-DOC
Description: Linux Loader - The Classic OS Loader Can Load Linux and Others
THIS PACKAGE CONTAINS LILO (THE Installer) and boot-record-images
Install Linux, OS / 2, Dos and Generic Boot Sectors of Other OSES.
.
You can use lilo to manage your master boot record (with a simple text screen)
OR CALL LILO from other boot-loaders to jump-start the linux kernel.
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_pagment (/ var / lib / dpkg / status) Revere 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:
If you only 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 Using DPKG Find Sackage Name
==========================
Another way to locate the package is to know the name of a key file in the package. 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 certain program, suddenly, stop! 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
After a while, it will tell you to install the required package and automatically go to the 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?
===============================
If you want to install a package, but you can't find its name with APT-Cache, but you know the file name of this program, or file name of some files in this package, then you can use Apt-File. 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 Packages
============================
After each package is installed, a Changelog.debian.gz file will be generated in the document directory (/ usr / share / packagename). This file records which modifications do to the system last update, You can read this information with Zless. However, after you upgrade the entire system, the update information that views the package one by one can not be 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).