package-management.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2018 01:28:53 +0200
changeset 2227 1e9323e7ec88
parent 2144 f8891b4321f5
child 2228 837f1337c59b
permissions -rw-r--r--
Removed files: I don't longer have interest on topic.
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 with root permission
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    10
==================================
42
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
Если вы root то по Linux FHS ставим в /opt.
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
Смотри:
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
  http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
2146aa2221c0 prog install
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
Не забываем обновить переменную окружения PATH!
1894
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    19
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    20
Local install without root permission
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
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    23
Лучшим решением, если у Вас нету прав root, будет установить ее в домашнем
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    24
каталоге. Тут дело личных предпочтений. У меня это ~/usr.
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    25
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    26
Если программа в бинарном виде - просто распаковываем::
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
  $ cd /your/temp/dir
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    29
  $ 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
    30
  $ mv prog/* ~/usr
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    31
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
``--prefix``::
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
  $ configure --prefix=$HOME/usr
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    36
  $ make
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    37
  $ make install
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    38
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    39
Обычно run-инсталляторы разархивируют содержимое в ``$PWD/$pkg``. В любом
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    40
случае::
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
  $ ./nvidia-driver-1.2.9.run --help
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    43
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    44
Show all installed packages
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    45
===========================
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    46
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    47
RPM based package manager::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    48
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    49
  $ rpm -qa
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    50
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    51
DEB based package manager::
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    52
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    53
  $ dpkg -l
2e3bc2435d68 Convert all files from TXT to RST.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    54
1977
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    55
Find packages a file belong to
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    56
==============================
1989
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    57
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    58
Find what package hold file among installed packages::
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    59
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    60
  $ rpm -qf /usr/bin/free
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    61
  $ zypper search -f stdlib.h
1977
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    62
1989
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    63
Find what package hold file among all packages from enabled repositories::
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    64
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    65
  $ yum whatprovides '*/stdlib.h'
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    66
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    67
  $ sudo yum install yum-utils           # old alternative
20198cc725e6 yum whatprovides.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1977
diff changeset
    68
  $ repoquery --whatprovides '*bin/grep'
1977
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    69
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    70
For ``pacman`` package system from ``pkgtools`` package::
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    71
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    72
  $ pkgfile -si stdlib.h
2704ec7205a7 Find packages a file belong to.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    73
2144
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    74
Show package content
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    75
====================
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    76
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    77
CentOS from repository::
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    78
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    79
  $ repoquery -l bash
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    80
  $ repoquery --list bash
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    81
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    82
Debian from reposiroty::
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    83
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    84
  $ sudo apt-file update
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    85
  $ apt-file list bash
f8891b4321f5 Show package content.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1989
diff changeset
    86