Difference between revisions of "Pacman (Português)"

From ArchWiki
Jump to: navigation, search
Line 27: Line 27:
 
Para realmente aprender o que o '''Pacman''' consegue fazer, leia <code>man pacman</code>. O que se segue é apenas uma pequena demonstração das operações que podem ser feitas.
 
Para realmente aprender o que o '''Pacman''' consegue fazer, leia <code>man pacman</code>. O que se segue é apenas uma pequena demonstração das operações que podem ser feitas.
  
===Installing and Removing Packages===
+
===Instalar e Remover Pacotes===
Before installing and upgrading packages, it is a good idea to synchronize the local package database with the remote repositories.
+
Antes de instalar e actualizar pacotes, é bom sincronizar a lista local de pacotes com a dos repositórios.
  
 
  pacman -Sy
 
  pacman -Sy
or
+
 
 +
ou
 +
 
 
  pacman --sync --refresh
 
  pacman --sync --refresh
  
To install or upgrade a single package or list of packages (including dependencies), issue the following command:
+
Para instalar ou actualizar apenas um pacote ou uma lista de pacotes (incluindo dependencias) siga o seguinte comando:
  
 
  pacman -S package_name1 package_name2
 
  pacman -S package_name1 package_name2
  
Sometimes there are more versions of a package in different repositories (e.g. extra and testing). You can specify which one to install:
+
Por vezes há mais versões de um pacote em diferentes repositórios (ex:  extra e testing). Pode especificar qual deles instalar:
  
 
  pacman -S extra/package_name
 
  pacman -S extra/package_name
 
  pacman -S testing/package_name
 
  pacman -S testing/package_name
  
You can also refresh the package database before installing a package in one command:
+
Pode também actualizar a lista de pacotes quando for instalar um pacote:
  
 
  pacman -Sy package_name
 
  pacman -Sy package_name

Revision as of 00:44, 23 October 2007

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

Descrição

O gestor de pacotes Pacman é uma das grandes vantagens do Arch Linux. Combina um simples pacote no formato binário com um facil sistema de compilação fácil de usar (ver makepkg e ABS). Com o Pacman é fácil gerir pacotes, sendo os oficiais dos repositórios do Arch ou os que são feitos pelo utilizador. O Pacman pode manter um sistema actualizado através da sincronização de listas de pacotes com o servidor "mestre". Este modelo de servidor/cliente permite o utilizador fazer o download/instalar pacotes com um simples comando, sendo resolvidas todas as dependencias. (semelhante ao apt-get do Debian).

Utilização

Para realmente aprender o que o Pacman consegue fazer, leia man pacman. O que se segue é apenas uma pequena demonstração das operações que podem ser feitas.

Instalar e Remover Pacotes

Antes de instalar e actualizar pacotes, é bom sincronizar a lista local de pacotes com a dos repositórios.

pacman -Sy

ou

pacman --sync --refresh

Para instalar ou actualizar apenas um pacote ou uma lista de pacotes (incluindo dependencias) siga o seguinte comando:

pacman -S package_name1 package_name2

Por vezes há mais versões de um pacote em diferentes repositórios (ex: extra e testing). Pode especificar qual deles instalar:

pacman -S extra/package_name
pacman -S testing/package_name

Pode também actualizar a lista de pacotes quando for instalar um pacote:

pacman -Sy package_name

To remove a single package, leaving all of its dependencies installed:

pacman -R package_name

To remove all of the packages dependencies which aren't used by any other installed package:

pacman -Rs package_name

To remove a package without checking dependencies:

pacman -Rd package_name

Upgrading the System

Pacman can update all packages on the system with just one command. This could take quite a while depending on how up-to-date your system is.

pacman -Su

However, the best option is to synchronize the repository databases AND update your system in one go with the following:

pacman -Syu

Querying the Package Database

Pacman can search the package database for a list of packages, you can enter part of the package name to search for all packages matching the string:

pacman -Ss package

To search installed packages only:

pacman -Qs package

Once you know the name of the package you are looking for, you can display some information on the package. Note that query info (-Qi) will show more info than sync info (-Si), as long as the package is installed.

pacman -Si package  
pacman -Qi package

For a list of files contained in a package:

pacman -Ql package

For a list of files no longer in use by any currently installed packages:

pacman -Qe 

You can also query what package a file on your system belongs to.

pacman -Qo /path/to/file

Other Usage

Pacman is quite an extensive package management tool, here is just a brief collection of other features.

  • Download a package without installing it:
pacman -Sw package_name
  • Install a local package (not from a repository):
pacman -U /path/to/package/package_name-version.pkg.tar.gz
  • Fully clean the package cache (/var/cache/pacman/pkg):
pacman -Scc

For a more detailed list of switches please refer to pacman --help or man pacman.


Configuration

Pacman configuration is located in /etc/pacman.conf. In depth information about the configuration file can be found in man pacman.conf.

General options

General options are in [options] section. Read the man page or look in the default pacman.conf for information on what can be done here.

Repositories

In this section you define which repositories to use, as referred to in /etc/pacman.conf, and then listed in /etc/pacman.d/. They can be defined directly there or you can include them from another file. The files found in this directory include, community, core, extra, release, testing and unstable. It is important to edit each one to include the repositories you require. The following is an example for the official repositories which have a lot of mirrors. Avoid using ftp.archlinux.org as it is throttled.

[repository-name]
Server = ftp://server.net/repo
[core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/core

n.b. Care should be taken when using testing and unstable repositories

Errors

If you receive the following error not found in sync db this likely due to the package not being located because the repositry has not been set correctly.

Related links

Improve Pacman Performance
Colored Pacman output
Downgrade packages
Redownloading all installed packages
Server configuration in pacman.conf
ArchLinux User-community Repository (AUR)
Local repository HOW-TO
Custom local repository with ABS and gensync
Howto Upgrade via Home Network (Network Shared Pacman Cache)
rucksack
Pacman GUI Frontends
Pacman Aliases (for bash)