package-management.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2018 01:49:07 +0200
changeset 2230 9e6ad6607a9e
parent 2228 837f1337c59b
permissions -rw-r--r--
Fixed formatting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1894
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
     1
.. -*- coding: utf-8; -*-
42
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
1894
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
     3
====================
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
     4
 Package management
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
     5
====================
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
     6
.. contents::
1905
fba288d59662 Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1894
diff changeset
     7
   :local:
42
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
1894
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
     9
Local install without root permission
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    10
=====================================
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    11
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    12
Лучшим решением, если у Вас нету прав root, будет установить ее в домашнем
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    13
каталоге. Тут дело личных предпочтений. У меня это ~/usr.
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    14
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    15
Если программа в бинарном виде - просто распаковываем::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    16
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    17
  $ cd /your/temp/dir
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    18
  $ gzip -d -c prog.tar.gz | tar xf -
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    19
  $ mv prog/* ~/usr
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    20
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    21
Если программу придестя собирать из исходников, почти всегда можно указать ключ
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    22
``--prefix``::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    23
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    24
  $ configure --prefix=$HOME/usr
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    25
  $ make
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    26
  $ make install
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    27
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    28
Обычно run-инсталляторы разархивируют содержимое в ``$PWD/$pkg``. В любом
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    29
случае::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    30
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    31
  $ ./nvidia-driver-1.2.9.run --help
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    32
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    33
Show all installed packages
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    34
===========================
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    35
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    36
RPM based package manager::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    37
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    38
  $ rpm -qa
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    39
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    40
DEB based package manager::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    41
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    42
  $ dpkg -l
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    43
1977
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    44
Find packages a file belong to
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    45
==============================
1989
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    46
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    47
Find what package hold file among installed packages::
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    48
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    49
  $ rpm -qf /usr/bin/free
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    50
  $ zypper search -f stdlib.h
1977
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    51
1989
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    52
Find what package hold file among all packages from enabled repositories::
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    53
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    54
  $ yum whatprovides '*/stdlib.h'
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    55
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    56
  $ sudo yum install yum-utils           # old alternative
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    57
  $ repoquery --whatprovides '*bin/grep'
1977
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    58
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    59
For ``pacman`` package system from ``pkgtools`` package::
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    60
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    61
  $ pkgfile -si stdlib.h
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    62
2144
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    63
Show package content
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    64
====================
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    65
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    66
CentOS from repository::
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    67
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    68
  $ repoquery -l bash
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    69
  $ repoquery --list bash
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    70
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    71
Debian from reposiroty::
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    72
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    73
  $ sudo apt-file update
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    74
  $ apt-file list bash
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    75