个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/SoftwarePackagingFormats}}
 
{{From|https://help.ubuntu.com/community/SoftwarePackagingFormats}}
 
{{Languages|UbuntuHelp:SoftwarePackagingFormats}}
 
{{Languages|UbuntuHelp:SoftwarePackagingFormats}}
 
 
=== Introduction ===
 
=== Introduction ===
 
This document summarizes major Linux package formats. Windows users may be aided by comparing them to the Windows formats they are familiar with.
 
This document summarizes major Linux package formats. Windows users may be aided by comparing them to the Windows formats they are familiar with.
 
 
=== Objective ===
 
=== Objective ===
 
This guide is directed towards new Linux users who would like to learn more about common Linux packaging formats.
 
This guide is directed towards new Linux users who would like to learn more about common Linux packaging formats.
 
 
=== Formats ===
 
=== Formats ===
 
In Windows, software come usually in .zip, .rar, or .exe file formats. For Linux, the following are common:
 
In Windows, software come usually in .zip, .rar, or .exe file formats. For Linux, the following are common:
 
 
* Source files
 
* Source files
 
 
* Binary files
 
* Binary files
 
 
* Tarballs
 
* Tarballs
 
 
* Redhat packages (.RPM)
 
* Redhat packages (.RPM)
 
 
* Debian Packages (.deb)
 
* 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.
 
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 ===
 
 
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 WinZip file on Windows or an HQX file on Macs.
 
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 WinZip file on Windows or an HQX 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>
 
 
=== gzip ===
 
=== gzip ===
 
 
The most common method of file compression in Linux is the gzip utility. Gzip will compress any kind of file, although it works best on text files (such as source code files).
 
The most common method of file compression in Linux is the gzip utility. Gzip will compress any kind of file, although it works best on text files (such as source code files).
 
 
You can use these command line options.
 
You can use these command line options.
 
 
To compress an individual file using gzip:
 
To compress an individual file using gzip:
 
<pre><nowiki>
 
<pre><nowiki>
 
gzip filename
 
gzip filename
 
</nowiki></pre>
 
</nowiki></pre>
 
 
To uncompress an individual gzipped file:  
 
To uncompress an individual gzipped file:  
 
<pre><nowiki>
 
<pre><nowiki>
 
gunzip filename
 
gunzip filename
 
</nowiki></pre>
 
</nowiki></pre>
 
 
To create a gzipped tar file:
 
To create a gzipped tar file:
 
<pre><nowiki>
 
<pre><nowiki>
 
tar cvzf archivename.tar filename
 
tar cvzf archivename.tar filename
 
</nowiki></pre>  
 
</nowiki></pre>  
 
 
To extract specific files from a gzipped tar file:
 
To extract specific files from a gzipped tar file:
 
<pre><nowiki>
 
<pre><nowiki>
 
tar xvzf archivename.tar filenames
 
tar xvzf archivename.tar filenames
 
</nowiki></pre>
 
</nowiki></pre>
 
 
'''A warning for novice users: don't attempt to directly install tarballs; if there are .deb packages available you should use them, as compiling from source might inadvertently damage or destabilize your system.'''
 
'''A warning for novice users: don't attempt to directly install tarballs; if there are .deb packages available you should use them, as compiling from source might inadvertently damage or destabilize your system.'''
 
 
=== RPMs ===
 
=== 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.
 
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'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.'''
 
 
=== deb packages ===
 
=== deb packages ===
 
 
Debian, along with its derivative distributions, uses packages in a file format called deb. Debian packages are managed using a command line program called "dpkg" and "apt", or with graphical front ends for dpkg like synaptic, adept, etc. Deb packages are known for their adaptability and robustness.
 
Debian, along with its derivative distributions, uses packages in a file format called deb. Debian packages are managed using a command line program called "dpkg" and "apt", or with graphical front ends for dpkg like synaptic, adept, etc. Deb packages are known for their adaptability and robustness.
 
 
Since Ubuntu is based off and derived from Debian, it uses the Debian packaging system. The software technology for downloading and automatically installing a package is known as "apt". You will find these commands helpful for .deb files:
 
Since Ubuntu is based off and derived from Debian, it uses the Debian packaging system. The software technology for downloading and automatically installing a package is known as "apt". You will find these commands helpful for .deb files:
 
 
To install a downloaded .deb package:
 
To install a downloaded .deb package:
 
<pre><nowiki>
 
<pre><nowiki>
第78行: 第51行:
 
sudo apt-get install packagename
 
sudo apt-get install packagename
 
</nowiki></pre>
 
</nowiki></pre>
 
 
To list installed packages:  
 
To list installed packages:  
 
<pre><nowiki>
 
<pre><nowiki>
 
dpkg -l
 
dpkg -l
 
</nowiki></pre>
 
</nowiki></pre>
 
 
To remove/uninstall a package :  
 
To remove/uninstall a package :  
 
<pre><nowiki>
 
<pre><nowiki>
第92行: 第63行:
 
sudo apt-get remove packagename
 
sudo apt-get remove packagename
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If you are not a command line user, you may wish to use Synaptic or Adept to perform these functions.
 
If you are not a command line user, you may wish to use Synaptic or Adept to perform these functions.
 
''All of these commands requires root privileges.''
 
''All of these commands requires root privileges.''
 
 
==== Programs, packages, help resources ====
 
==== 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.
 
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.
 
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 21:32的版本

Introduction

This document summarizes major Linux package formats. Windows users may be aided by comparing them to the Windows formats they are familiar with.

Objective

This guide is directed towards new Linux users who would like to learn more about common Linux packaging formats.

Formats

In Windows, software come usually in .zip, .rar, or .exe file formats. For Linux, the following are common:

  • Source files
  • 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 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 WinZip file on Windows or an HQX 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

gzip

The most common method of file compression in Linux is the gzip utility. Gzip will compress any kind of file, although it works best on text files (such as source code files). You can use these command line options. To compress an individual file using gzip:

gzip filename

To uncompress an individual gzipped file:

gunzip filename

To create a gzipped tar file:

tar cvzf archivename.tar filename

To extract specific files from a gzipped tar file:

tar xvzf archivename.tar filenames

A warning for novice users: don't attempt to directly install tarballs; if there are .deb packages available you should use them, as compiling from source might inadvertently damage or destabilize your system.

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.

deb packages

Debian, along with its derivative distributions, uses packages in a file format called deb. Debian packages are managed using a command line program called "dpkg" and "apt", or with graphical front ends for dpkg like synaptic, adept, etc. Deb packages are known for their adaptability and robustness. Since Ubuntu is based off and derived from Debian, it uses the Debian packaging system. The software technology for downloading and automatically installing a package is known as "apt". You will find these commands helpful for .deb files: To install a downloaded .deb package:

dpkg -i packagename

or

sudo apt-get install packagename

To list installed packages:

dpkg -l

To remove/uninstall a package :

dpkg -r packagename

or

sudo apt-get remove packagename

If you are not a command line user, you may wish to use Synaptic or Adept to perform these functions. All of 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.