个人工具

“UbuntuHelp:SoftwarePackagingFormats”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/SoftwarePackagingFormats}} {{Languages|php5}} === Introduction === In this document we summarise major Linux package formats. Windows users may be...)
 
 
(未显示3个用户的9个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SoftwarePackagingFormats}}
 
{{From|https://help.ubuntu.com/community/SoftwarePackagingFormats}}
{{Languages|php5}}
+
{{Languages|UbuntuHelp:SoftwarePackagingFormats}}
 
+
<<Include(Tag/Duplicate)>>
 +
''This page duplicates material in [[UbuntuHelp:InstallingSoftware|InstallingSoftware]] and [[UbuntuHelp:CompilingEasyHowTo|CompilingEasyHowTo]], other material should be integrated elsewhere and the page marked for deletion.''
 +
== Software packaging formats in Linux ==
 +
This document summarizes major Linux software packaging formats.
 
=== Introduction ===
 
=== Introduction ===
In this document we summarise major Linux package formats. Windows users may be aided by comparing them to the Windows formats they are familiar with.
+
This guide is written for Ubuntu users that would like to learn more about common Linux packaging formats. This guide is not all-inclusive, it merely covers common formats likely to be encountered by average users. For information on installing software see the additional resources at the end of the article.
 
+
=== Objective ===
+
This document is made for users who are new to Linux and want to know about the Linux package formats. This guide will cover some known package formats, compressions, and methods of packaging.
+
 
+
 
=== Formats ===
 
=== Formats ===
In Windows, software come usually in .zip, .rar, or .exe format. For Linux you have options like:
+
Linux uses some common formats to distribute software. The most common formats for the average Ubuntu user are:
 
+
<ol><li>Debian Packages (.deb)
* Source files
+
</li><li>Tarballs
 
+
</li><li>Red Hat packages (.RPM)</li></ol>
* Binary files
+
 
+
* Tarballs
+
 
+
* Redhat packages (.RPM)
+
 
+
* Debian Packages (.deb)
+
 
+
Source files are nothing but raw code which requires compilation to work, while binary files are like .exe files which are ready to install.
+
 
+
=== Tarballs ===
+
 
+
Tarballs are  a large collection of files compatted into a single archive file. The "tar" command is used to combine many files into a single file for archiving or easy distribution. The "gzip" command is used to compress the size of a file so that it takes up less space. A tarball is very similar to a WinZip file on Windows or an HQX file on Macs.
+
  
 +
==== Debian packages (.deb) ====
 +
Debian Packages are the most common format you will encounter when installing software in Ubuntu. This is the standard software packaging format used by Debian and Debian derivatives. All of the software in the Ubuntu repositories is packaged in this format. Synaptic Package Manager, Add/Remove  Applications, Aptitude, and apt-get handle the transaction with the repository behind the scenes.
 +
==== Tarballs ====
 +
Tarballs are  a large collection of files assembled into a single archive file. The "tar" command is used to combine many files into a single file for archiving or easy distribution. The "gzip" command is used to compress the size of a file so that it takes up less space. A tarball is very similar to a ''.zip'' file on Windows, or a ''.hqx'', ''.sit'', or ''.dmg'' file on Macs.
 
Tarballs have extensions like ".tar.gz", ".tar.bz2" or "TGZ". Most of the time, a tarball contains source files and/or binary files. In the open source community, they are used to distribute source code. If you find any software with a .tar.gz appendix, you will need to uncompress it by double clicking on it before installing the software it contains. To do the same thing from a terminal window, you can also use the tar command like this:
 
Tarballs have extensions like ".tar.gz", ".tar.bz2" or "TGZ". Most of the time, a tarball contains source files and/or binary files. In the open source community, they are used to distribute source code. If you find any software with a .tar.gz appendix, you will need to uncompress it by double clicking on it before installing the software it contains. To do the same thing from a terminal window, you can also use the tar command like this:
 
<code><nowiki>tar xzf name_of_file</nowiki></code>
 
<code><nowiki>tar xzf name_of_file</nowiki></code>
 
+
===== Source files =====
=== gzip ===
+
Source files are nothing but raw code which requires compilation to work, while binary files are like .exe files which are ready to install.
 
+
See also [[UbuntuHelp:FileCompression|FileCompression]].
The most common method of file compression in linux is to use the gzip program. Gzip will compress any kind of file, but works best on text files (such as source code files).
+
===== Binary files =====
 
+
==== RPMs ====
You can use these command line options.
+
 
+
To compress an individual file using gzip:
+
<pre><nowiki>
+
gzip filename
+
</nowiki></code>
+
                                   
+
To uncompress an individual gzipped file:
+
<pre><nowiki>
+
gunzip filename.gz
+
</nowiki></code>
+
                               
+
To create a gzipped tar file:
+
<pre><nowiki>
+
tar cvzf archivename.tar filename
+
</nowiki></code>
+
 
+
To extract specific files from a gzipped tar file:
+
<pre><nowiki>
+
tar xvzf archivename.tar filenames
+
</nowiki></code>
+
 
+
'''A warning for novice users: don't use directly tarballs; if there are .deb packages available you should use them as you might damage or destabilise your installation.'''
+
 
+
=== RPM's ===
+
 
+
 
The Red hat Package Manager or .RPM format is specifically designed for easy installation and management of software packages. The format allows you to automatically install, upgrade and remove software packages. It tracks dependencies -- situations where one package requires another package in order to work correctly -- and will not install software if it depends on another package which is not installed.
 
The Red hat Package Manager or .RPM format is specifically designed for easy installation and management of software packages. The format allows you to automatically install, upgrade and remove software packages. It tracks dependencies -- situations where one package requires another package in order to work correctly -- and will not install software if it depends on another package which is not installed.
 
+
To convert RPM packages to Debian's package format you can use the ''alien'' command. '''A warning for novice users: don't use the alien method; if there are .deb packages available you should use them, since using a package designed for another distribution might inadvertently damage or destabilize your system.'''
To convert RPM packages to debian package format you can use the ''alien'' command. '''A warning for novice users: don't use the alien method; if there are .deb packages available you should use them as you might damage or destabilise your installation.'''
+
==== Additional resources ====
 
+
* [[UbuntuHelp:InstallingSoftware|Installing software]]
=== deb packages ===
+
* [[UbuntuHelp:AptGet/Howto|Apt-get]]
 
+
* [[UbuntuHelp:SynapticHowto| Using Synaptic]]
Debian, along with its derivative distributions, uses packages in a file format called deb. Deb packages are managed using a command line program called "dpkg", or with graphical front ends for dpkg like synaptic, adept, etc. Deb packages are known for their adaptability and robustness.
+
 
+
As Ubuntu is based on Debian, it uses the .deb packages system. The software technology for the download and automatic installation of packages is known as "apt". You will find these commands helpful for .deb files:
+
 
+
To install a package:
+
<pre><nowiki>
+
dpkg -i packagename
+
</nowiki></code>
+
 
+
To list installed packages:
+
<pre><nowiki>
+
apt-cache show packagename
+
</nowiki></code>
+
 
+
To remove/uninstall a package :
+
<pre><nowiki>
+
dpkg -r packagename
+
</nowiki></code>
+
 
+
If you are not a command line user, you may wish to use Synaptic to perform these functions.
+
''All these commands requires root privileges.''
+
 
+
==== Programs, packages, help resources ====
+
 
+
Software installation programs available for Ubuntu/Kubuntu are Synaptic Package Manager and Adept. You can even use Add-Remove applications link from applications menu to add or remove softwares. Besides the Ubuntu repositories you can obtain software from various sources. Some of the sources/links are mentioned below.
+
 
+
* http://www.linuxapps.com
+
* http://www.icewalkers.com
+
* http://packages.debian.org/
+
* http://www.apt-get.org/
+
 
+
CategoryDocumentation CategoryCleanup
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:15的最新版本

<<Include(Tag/Duplicate)>> This page duplicates material in InstallingSoftware and CompilingEasyHowTo, other material should be integrated elsewhere and the page marked for deletion.

Software packaging formats in Linux

This document summarizes major Linux software packaging formats.

Introduction

This guide is written for Ubuntu users that would like to learn more about common Linux packaging formats. This guide is not all-inclusive, it merely covers common formats likely to be encountered by average users. For information on installing software see the additional resources at the end of the article.

Formats

Linux uses some common formats to distribute software. The most common formats for the average Ubuntu user are:

  1. Debian Packages (.deb)
  2. Tarballs
  3. Red Hat packages (.RPM)

Debian packages (.deb)

Debian Packages are the most common format you will encounter when installing software in Ubuntu. This is the standard software packaging format used by Debian and Debian derivatives. All of the software in the Ubuntu repositories is packaged in this format. Synaptic Package Manager, Add/Remove Applications, Aptitude, and apt-get handle the transaction with the repository behind the scenes.

Tarballs

Tarballs are a large collection of files assembled into a single archive file. The "tar" command is used to combine many files into a single file for archiving or easy distribution. The "gzip" command is used to compress the size of a file so that it takes up less space. A tarball is very similar to a .zip file on Windows, or a .hqx, .sit, or .dmg file on Macs. Tarballs have extensions like ".tar.gz", ".tar.bz2" or "TGZ". Most of the time, a tarball contains source files and/or binary files. In the open source community, they are used to distribute source code. If you find any software with a .tar.gz appendix, you will need to uncompress it by double clicking on it before installing the software it contains. To do the same thing from a terminal window, you can also use the tar command like this: tar xzf name_of_file

Source files

Source files are nothing but raw code which requires compilation to work, while binary files are like .exe files which are ready to install. See also FileCompression.

Binary files

RPMs

The Red hat Package Manager or .RPM format is specifically designed for easy installation and management of software packages. The format allows you to automatically install, upgrade and remove software packages. It tracks dependencies -- situations where one package requires another package in order to work correctly -- and will not install software if it depends on another package which is not installed. To convert RPM packages to Debian's package format you can use the alien command. A warning for novice users: don't use the alien method; if there are .deb packages available you should use them, since using a package designed for another distribution might inadvertently damage or destabilize your system.

Additional resources