If we spend some time in the Linux community, we will learn a lot for the class as many Linux distributions which is the best (and other issues) view. These focused on the discussion of these things like, say, the most beautiful desktop background (some people do not use Ubuntu, Ubuntu default theme just because the color is brown!) And other trivial things, often very boring.
The most important Linux distributions quality determinant is the persistence of the package management system and its supporting community. As we spend more time on Linux, we will find that its software garden is very dynamic. Software is constantly changing. Most Linux distributions line release a new version every six months, and a number of independent programs are updated daily. To these and more generally as a blizzard of software to keep in touch, we need some good tools to manage the package.
Package management is a kind of system to install and maintain software. Today, through the installation package from the Linux distribution, it has been able to meet many people of all software needed. This differs from the earlier Linux, people need to download and edit the source code to install the software. Edit the source code without any problems, in fact, have access to the source code of Linux is a great miracle. It gives us (each additional person) ability to detect and improve system performance. If there is only a pre-compiled packages is relatively easy to deal with them more quickly. This chapter, we will look at some of the command-line tools for package management. While all major Linux distributions offer a powerful and sophisticated graphical management procedures to maintain the system, but to learn the command-line program is also very important. Because they can do a lot to make graphical management procedures to deal with them difficult (or impossible) task.
Different Linux distributions use different packaging system, in general, most of the releases were part of two package management technology camps: Debian of ".deb", and Red Hat's ".rpm". There are some important exceptions, for example, Gentoo, Slackware, and Foresight, but most of them will use both a basic system.
Table 15-1: Main package management system family
Package management system release (partial list)
Debian Style (.deb) Debian, Ubuntu, Xandros, Linspire
Red Hat Style (.rpm) Fedora, CentOS, Red Hat Enterprise Linux, OpenSUSE, Mandriva, PCLinuxOS
Package management system is how it works
Software distribution method found in the proprietary software industry generally need to buy an installation media, say "setup disk", and then run the "Setup Wizard" to install new applications in the system.
Linux is not the case. Linux system, almost all of the software can be found on the Internet. Most software packages in the form of documents provided by the publisher, and the remaining places in the form of source code, you can install it manually. In later chapters, we will talk about how to install the software by compiling the source code.
In the package management system software is the basic unit package file. Constitute a package file is compressed file package collection. Packages may be provided by a large number of programs and data to support these program files. In addition to the installation file, package file also includes metadata about the package, such as a text description of the package and its contents. In addition, the package also includes a number of pre-installation and post-installation scripts for before and after the software installation configuration tasks.
Package file is created by the package maintainers, who is usually (but not always) a software publisher's employees. Software maintainers from the upstream provider (Author) get software source code, and then edit the source code, and create a package metadata required installation script. Typically, the package maintainers should modify the application made to the original source of them, to improve the integration of this software with Linux distributions other portions.
While some choose to perform their own software projects package and release strategy, but now most of the packages by a third-party publishers and interested created. System releases users can get in a central repository of these packages, the repository could contain tens of thousands of packages, are specifically release the establishment and maintenance of each package for this system.
A distribution may maintain several different repositories for different stages of the software development life cycle. For example, there will usually be a "testing" repository that contains packages that have just been built and are intended for use by brave souls who are looking for bugs before they are released for general distribution. A distribution will often have a "development" repository where work-in-progress packages destined for inclusion in the distribution's next major release are kept.
Due to the needs of different phases of the software development life cycle, a system may release maintains several different repositories. For example, there is usually a "test" repository that contains the package you just created, they want to brave the user to use these packages before the official release, allowing users to find the error. System release there is often a "development" repository, the repository holds destined to be included in the next major release of the semi-finished package.
A release system may also have the third party repository. These resources need to support some of the libraries for legal reasons, such as patents or DRM anti-circumvention issues, which can not be included in the distribution of software. Probably the most famous case is that encrypted DVD support, in the United States which is not legal. Third-party libraries play a role in these countries and the anti-circumvention software patent bill is not in effect. These repositories are usually completely independent of them supported by the repository, in order to use them, you have to understand them, you put them manually to the configuration file that contains the package management system.
Programs rarely "isolated", but depend on other software components to complete their work. Activities common to the input / output, for example, is shared by the routine to deal with. These routines are stored in the shared library, shared library not only provides basic services for a program. If a package needs to share resources, such as shared libraries, it is said there is a dependency. Modern package management system provides some dependency analysis method, in order to ensure that when the package is installed, also installed all of its dependent programs.
Top and bottom package tools
Package management system usually consists of two types of tools: the underlying instrument to handle these tasks, for example, install and remove package files, and the upper tool, complete meta data search and dependency resolution. In this chapter, we will look at the tools provided by the Debian-style system (for example Ubuntu, there are many other systems), as well as the tools used by the Red Hat products. While all Red Hat-style release rely on the same underlying program (rpm), but they use different upper tools. We will study the upper yum program for our discussion, Fedora, Red Hat Enterprise Edition, and CentOs are using yum. Other distributions based on Red Hat-style upper tools provided with comparable characteristics.
Table 15-2: package management tools
Release the upper level tools tools
Debian-Style dpkg apt-get, aptitude
Fedora, Red Hat Enterprise Linux, CentOS rpm yum
Common package management tasks
Command line package management tools can do a lot. We will look at the most commonly used tools. Note that the underlying tool also supports the creation of a package of documents, this topic is beyond the scope of this book narration. In the following discussion, "package_name" This term refers to the actual name of the package, rather than a "package_file", which is included in the package file name.
Find a repository of packages
Use the upper tool to search the repository metadata, according to the name and description of the package to locate it.
Table 15-3: Package Finder
Debian apt-get update; apt-cache search search_string
Red Hat yum search search_string
For example: search for a yum repository to find the emacs text editor, use the following command:
yum search emacs
Install a package from the repository
Allow the upper tool from one repository to download a package, and fully dependent on resolution to install it.
Table 15-4: package installation command
Debian apt-get update; apt-get install package_name
Red Hat yum install package_name
For example: From a apt repository to install the emacs text editor:
apt-get update; apt-get install emacs
To install the software package file
If somewhere instead of downloading a file from a package repository, you can use the underlying instrument directly (without dependency resolution) to install it.
Table 15-5: underlying package installation command
Debian dpkg --install package_file
Red Hat rpm -i package_file
For example: If you have not downloaded from a repository site for the package file emacs-22.1-7.fc7-i386.rpm, you can install it this way:
rpm -i emacs-22.1-7.fc7-i386.rpm
Note: Because this technology uses the underlying rpm program to perform installation tasks, so there is no operational dependency resolution. If the rpm program discovered a missing dependency, it will exit with an error.
You can use the top or bottom tool to uninstall the software. Here are the top tools available.
Table 15-6: Delete command package
Debian apt-get remove package_name
Red Hat yum erase package_name
For example: Uninstall packages from Debian emacs-style system:
apt-get remove emacs
After the update package to the repository
The most common task is to keep the system management software package package are up to date. Upper tool only one step to complete this vital task.
Table 15-7: Package update command
Debian apt-get update; apt-get upgrade
Red Hat yum update
For example: In the Debian-style system update installation package:
apt-get update; apt-get upgrade
After the package file to upgrade software
If you have downloaded the latest version of a package from a non-repository site, you can install this version, use it to replace the previous version:
Table 15-8: Commands underlying package upgrades
Debian dpkg --install package_file
Red Hat rpm -U package_file
For example: the Red Hat system installed emacs version updated to version emacs package emacs-22.1-7.fc7-i386.rpmz file contains.
rpm -U emacs-22.1-7.fc7-i386.rpm
Note: rpm program to install a package and upgrade options with a software package is different, and the options dpkg procedure used is the same.
Lists installed packages
The following table shows the installation command can be used to list all packages in the system:
Table 15-9: List installed packages command
Debian dpkg --list
Red Hat rpm -qa
Determine whether to install a package
The bottom of the tool can be used to show whether a specific package is installed:
Table 15-10: packages status command
Debian dpkg --status package_name
Red Hat rpm -q package_name
For example: to determine whether the Debian package emacs-style system installed:
dpkg --status emacs
Displays information packages installed
If you know the name of the installation package, use the following command to display the information described in this package:
Table 15-11: View package information command
Debian apt-cache show package_name
Red Hat yum info package_name
For example: See the Debian-style system described emacs package information:
apt-cache show emacs
Find package installed a file
To determine which package a particular file installed responsible use commands in the following table:
Table 15-12: File identification command packet
Debian dpkg --search file_name
Red Hat rpm -qf file_name
For example: In the Red Hat system, to see which packages are installed / usr / bin / vim this document
rpm -qf / usr / bin / vim
Inside the subsequent chapters, we will explore a number of different programs that cover a wide field of application. While most programs are generally installed by default, but if the desired program is not installed on the system, then we may need to install additional packages. Through our newly learned (and understanding) package management knowledge, we should have no problem to install and manage the required procedures.
Linux software installation rumors
Migrating from other platforms over users sometimes become victims of rumors, saying that the Linux system, install the software some difficulties, and a wide variety of different system releases packaged solution used is an obstacle. Alas, it is a barrier, but only for those who want to put their secret software release only a binary version of proprietary software vendors.
Linux software ecosystem is based on open source philosophy. If a program developer has released the source code of a product, the system releases associated with the developer might put this product package and include it in their repository. This approach ensures that this product can be well integrated with the system releases together, as well as users "one-stop shopping" software provides easy, so users do not have to search for each product site.
Device drivers are almost in the same way to deal with, but they are not the repository system release in a separate project, which itself is part of the Linux kernel. In general, none of the Linux "disk drive" something similar. Or a device kernel support, or not support, anyway, the Linux kernel supports many devices, in fact, more than the number of devices supported by Windows. Of course, if you need a particular device is not supported, there is no comfort. When that happens, you need to find the reasons. Lack of driver support is usually caused by one of three things lead to:
1. The device is too new. Because many hardware vendors did not actively support the development of Linux, the kernel driver code to write the task be undertaken by some of the Linux community, and this takes time.
2. The device is too bizarre. Not all distributions include every possible device driver. Each release will build their own kernel, because the kernel can be configured (which makes running Linux on each device from watches to host possible), so that they may ignore a particular device. By locating and downloading the driver source code, you may need your own (yes, to you) to compile and install the driver. The process is not difficult, but to take part. We will in subsequent chapters discuss compile software.
3. hardware vendor to hide information. They are neither publishing system used in Linux driver code is not released technical documentation to allow someone to create it. This means that the hardware vendor try to keep the program interface for this device. Because we do not want to use the secret device in the computer, so I propose to delete this nasty software, combine it with other useless projects are still to trash.
.. Spend some time getting to know the package management system for your distribution Each distribution provides documentation for its package management tools In addition, here are some more generic sources:
Take the time to understand you use release package management system. Each release is available on the documentation that comes with the package management tools.