両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン |
linux:commands:package_management [2023/03/12 07:45] – [パッケージ管理 [snap]] ともやん | linux:commands:package_management [2024/04/22 05:53] (現在) – [パッケージ管理] ともやん |
---|
| ~~CLOSETOC~~ |
| ====== パッケージ管理関連 ====== |
| {{INLINETOC wide 1-2}} |
| |
| ====== パッケージ管理 [dnf/apt] ====== |
| |
| ===== パッケージ管理 ===== |
<html> | <html> |
<style> | <style> |
#pkg_manage table { | .wrap_mintbl_code table .wrap_color_term { |
font-size: 10px; | margin: 0; |
| padding: .5em; |
} | } |
#pkg_manage table pre { | .wrap_mintbl_code table .wrap_color_command pre { |
font-size: 12px; | |
padding: 0; | padding: 0; |
margin: 0 0 2px 0; | margin: 0 0 2px 0; |
width: 270px; | width: 270px; |
| min-width: unset; |
word-wrap: inherit; | word-wrap: inherit; |
| line-height: 14px; |
} | } |
</style> | </style> |
jQuery(function() { | jQuery(function() { |
// toc をパッケージ管理一覧の上に重ねて、パッケージ管理一覧の幅が縮まない様にする | // toc をパッケージ管理一覧の上に重ねて、パッケージ管理一覧の幅が縮まない様にする |
jQuery("#dw__toc > div").css({"position": "absolute", "background-color": "white"}); | //jQuery("#dw__toc > div").css({"position": "absolute", "background-color": "white"}); |
}); | }); |
</script> | </script> |
</html> | </html> |
~~CLOSETOC~~ | <WRAP mintbl_code> |
====== パッケージ管理関連 ====== | |
{{INLINETOC wide 1-2}} | |
| |
====== パッケージ管理 [dnf/apt] ====== | |
| |
===== パッケージ管理 ===== | |
<WRAP prewrap 100% #pkg_manage> | |
^ 操作 ^ Fedora ^ Ubuntu ^ | ^ 操作 ^ Fedora ^ Ubuntu ^ |
| インストール | <code>$ sudo dnf install package_name</code> | <code>$ sudo apt-get update | | インストール | <WRAP color_term><WRAP color_command><html><pre><font color="#0087FF"><b>$</b></font> <font color="#26A269"><u style="text-decoration-style:single">sudo</u></font> <font color="#26A269">dnf</font> install package_name</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo apt</b> update |
$ sudo apt-get install package_name</code> | | <b class=GRN>$</b> <b class=HIY>sudo apt</b> install package_name</pre></html></WRAP></WRAP> | |
| アップデート | <code>$ sudo dnf update package_name</code> | <code>$ sudo apt-get install package_name</code> | | | アップデート | <WRAP color_term><WRAP color_command><html><pre><font color="#0087FF"><b>$</b></font> <font color="#26A269"><u style="text-decoration-style:single">sudo</u></font> <font color="#26A269">dnf</font> update</pre></html></WRAP></WRAP> <WRAP color_term><WRAP color_command><html><pre><font color="#0087FF"><b>$</b></font> <font color="#26A269"><u style="text-decoration-style:single">sudo</u></font> <font color="#26A269">dnf</font> update package_name</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo apt</b> update |
| アンインストール | <code>$ sudo dnf remove package_name</code> | <code>$ sudo apt-get remove package_name</code> | | <b class=GRN>$</b> <b class=HIY>sudo apt</b> upgrade package_name</pre></html></WRAP></WRAP> | |
| インストール済\\ パッケージの一覧表示 | <code>$ dnf list installed</code> <code>$ dnf list *package_name*</code> <code>$ rpm -qa</code> <code>$ rpm -qa | grep package_name</code> | <code>$ dpkg -l</code> <code>$ dpkg -l | grep package_name</code>\\ | | | アンインストール | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo dnf</b> remove package_name</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo apt</b> remove package_name</pre></html></WRAP></WRAP> | |
| パッケージの検索 | <code>$ dnf search package_name</code> | <code>$ apt-cache search package_name</code> | | | インストール済\\ パッケージの一覧表示 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> list installed</pre></html></WRAP></WRAP> <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> list *package_name*</pre></html></WRAP></WRAP> <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> <b class=HIK>-qa</b></pre></html></WRAP></WRAP> <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> -qa | <b class=HIY>grep</b> package_name</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dpkg</b> <b class=HIK>-l</b></pre></html></WRAP></WRAP> <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dpkg</b> <b class=HIK>-l</b> | <b class=HIY>grep</b> package_name</pre></html></WRAP></WRAP>\\ | |
| パッケージ内\\ ファイル一覧 | <code>$ dnf repoquery -l package_name</code> <code>$ rpm -ql package_name</code>|<code>$ dpkg -L package_name</code> | | | パッケージの検索 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> search package_name</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>apt-cache</b> search package_name</pre></html></WRAP></WRAP> | |
| コマンドが含まれている\\ パッケージを調べる | <code>$ dnf provides command_name</code> | <code>$ sudo apt-get install apt-file | | パッケージ内\\ ファイル一覧 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> repoquery <b class=HIK>-l</b> package_name</pre></html></WRAP></WRAP> <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> <b class=HIK>-ql</b> package_name</pre></html></WRAP></WRAP>|<WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dpkg</b> <b class=HIK>-L</b> package_name</pre></html></WRAP></WRAP> | |
$ sudo apt-file update | | コマンドが含まれている\\ パッケージを調べる | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> provides command_name</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo apt</b> install apt-file |
$ sudo apt-file search command_name</code> | | <b class=GRN>$</b> <b class=HIY>sudo apt-file</b> update |
| パッケージ依存関係の表示 | <code>$ dnf deplist package_name</code> | - | | <b class=GRN>$</b> <b class=HIY>sudo apt-file</b> search command_name</pre></html></WRAP></WRAP> | |
| パッケージに依存している\\ パッケージを表示 | <code>$ rpm -q --whatrequires package_name</code> | - | | | パッケージ依存関係の表示 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> deplist package_name</pre></html></WRAP></WRAP> | - | |
| 一時的に\\ リポジトリを有効化 | <code>$ sudo dnf --enablerepo=remi install package_name</code> | - | | | パッケージに依存している\\ パッケージを表示 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> <b class=HIK>-q --whatrequires</b> package_name</pre></html></WRAP></WRAP> | - | |
| 一時的に\\ リポジトリを無効化 | <code>$ sudo dnf --disablerepo=remi install package_name</code> | - | | | 一時的に\\ リポジトリを有効化 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo dnf</b> <b class=HIK>--enablerepo</b>=remi install package_name</pre></html></WRAP></WRAP> | - | |
| グループリスト表示 | <code>$ dnf grouplist</code>インストール可能なグループ一覧を英語で取得する<code>$ bash -c 'LANG=C;dnf grouplist'</code>\\ <code>$ dnf grouplist hidden</code>インストール可能なグループ一覧を英語で取得する<code>$ bash -c 'LANG=C;dnf grouplist hidden'</code> | - | | | 一時的に\\ リポジトリを無効化 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo dnf</b> <b class=HIK>--disablerepo</b>=remi install package_name</pre></html></WRAP></WRAP> | - | |
| グループ\\ インストール | <code>$ sudo dnf groupinstall "X Window System"</code> | - | | | グループリスト表示 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> grouplist</pre></html></WRAP></WRAP>インストール可能なグループ一覧を英語で取得する<WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>bash</b> <b class=HIK>-c</b> 'LANG=C;dnf grouplist'</pre></html></WRAP></WRAP>\\ <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> grouplist hidden</pre></html></WRAP></WRAP>インストール可能なグループ一覧を英語で取得する<WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>bash</b> <b class=HIK>-c</b> 'LANG=C;dnf grouplist hidden'</pre></html></WRAP></WRAP> | - | |
| GUI パッケージ管理(旧) | <code>$ yumex</code> | <code>$ software-center</code> | | | グループ\\ インストール | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo dnf</b> groupinstall "X Window System"</pre></html></WRAP></WRAP> | - | |
| GUI パッケージ管理(新) | <code>$ dnfdragora</code> | <code>$ software-center</code> | | | GUI パッケージ管理(旧) | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>yumex</b></pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>software-center</b></pre></html></WRAP></WRAP> | |
| キャッシュクリア | <code>$ sudo dnf clean all</code> | | | | GUI パッケージ管理(新) | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnfdragora</b></pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>software-center</b></pre></html></WRAP></WRAP> | |
| | キャッシュクリア | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo dnf</b> clean all</pre></html></WRAP></WRAP> | | |
</WRAP> | </WRAP> |
| |
===== dnf / yum 比較 ===== | ===== dnf / yum 比較 ===== |
<WRAP prewrap 100% #pkg_manage> | <WRAP mintbl_code> |
^ 操作 ^ dnf ^ yum ^ | ^ 操作 ^ dnf ^ yum ^ |
| ソースのダウンロード | <code>$ dnf download --source samba</code> | <code>$ yumdownloader --source samba</code> | | | ソースのダウンロード | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> download <b class=HIK>--source</b> samba</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>yumdownloader</b> <b class=HIK>--source</b> samba</pre></html></WRAP></WRAP> | |
| リポジトリ同期 | <code>$ dnf reposync</code> | <code>$ reposync</code> | | | リポジトリ同期 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>dnf</b> <b class=HIY>reposync</b></pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>reposync</b></pre></html></WRAP></WRAP> | |
| ビルドに必要なパッケージの\\ インストール | <code>$ sudo dnf builddep samba.spec</code> | <code>$ sudo yum-builddep samba.spec</code> | | | ビルドに必要なパッケージの\\ インストール | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo dnf</b> builddep samba.spec</pre></html></WRAP></WRAP> | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>sudo yum-builddep</b> samba.spec</pre></html></WRAP></WRAP> | |
</WRAP> | </WRAP> |
| |
</WRAP> | </WRAP> |
| |
| ====== パッケージ管理 [pacman] ====== |
| [[arc>Pacman|pacman - ArchWiki]]\\ |
| [[arc>Pacman/比較表|Pacman/比較表 - ArchWiki]]\\ |
| |
| <WRAP mintbl_code> |
| ^ 操作 ^ コマンド ^ |
| | インストール\\ (--overwrite 衝突ファイルの上書き) | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-S</b> package_name</pre></html></WRAP><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-S --overwrite</b> '*' package_name</pre></html></WRAP></WRAP> | |
| | アップデート | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-Syu</b> package_name</pre></html></WRAP></WRAP> | |
| | アンインストール | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-Rs</b> package_name</pre></html></WRAP></WRAP> | |
| | インストール済\\ パッケージの一覧表示 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-Q</b></pre></html></WRAP></WRAP> | |
| | パッケージの検索 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-Ss</b> package_name</pre></html></WRAP></WRAP> | |
| | パッケージ内\\ ファイル一覧 | <WRAP color_term><WRAP color_command><html><pre><b class=GRN>$</b> <b class=HIY>pacman</b> <b class=HIK>-Q</b> package_name</pre></html></WRAP></WRAP> | |
| </WRAP> |
| |
| ===== warning: database file for 'core'|'extra' does not exist (use '-Sy' to download) が表示される🤔 ===== |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| # pacman -Ss zsh |
| </pre></html></WRAP> |
| <WRAP color_command><html><pre> |
| warning: database file for 'core' does not exist (use '-Sy' to download) |
| warning: database file for 'extra' does not exist (use '-Sy' to download) |
| </pre></html></WRAP> |
| </WRAP> |
| |
| <html><code>pacman -Sy</code></html> でパッケージデータベースを同期する🤔\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| # pacman -Sy |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| :: Synchronizing package databases... |
| core downloading... |
| extra downloading... |
| </pre></html></WRAP> |
| <WRAP color_command><html><pre> |
| # pacman -Ss zsh |
| </pre></html></WRAP> |
| <WRAP color_result_hlong><html><pre> |
| extra/bash-preexec 0.5.0-2 |
| preexec and precmd functions for Bash just like Zsh |
| extra/grml-zsh-config 0.19.7-1 |
| grml's zsh setup |
| extra/powerline 2.8.3-3 |
| Statusline plugin for vim, and provides statuslines and prompts for several other applications, including |
| zsh, bash, tmux, IPython, Awesome, i3 and Qtile |
| extra/python-click-completion 0.5.2-7 |
| Add or enhance bash, fish, zsh and powershell completion in Click |
| extra/zsh 5.9-5 |
| A very advanced and programmable command interpreter (shell) for UNIX |
| extra/zsh-autosuggestions 0.7.0-2 |
| Fish-like autosuggestions for zsh |
| extra/zsh-completions 0.35.0-1 |
| Additional completion definitions for Zsh |
| extra/zsh-doc 5.9-5 |
| Info, HTML and PDF format of the ZSH documentation |
| extra/zsh-history-substring-search 1.1.0-1 |
| ZSH port of Fish history search (up arrow) |
| extra/zsh-lovers 0.10.1-1 |
| A collection of tips, tricks and examples for the Z shell. |
| extra/zsh-syntax-highlighting 0.8.0-1 |
| Fish shell like syntax highlighting for Zsh |
| extra/zshdb 1.1.4-1 |
| A debugger for zsh scripts |
| </pre></html></WRAP> |
| </WRAP> |
====== 参考文献 ====== | ====== 参考文献 ====== |
[[https://rheb.hatenablog.com/entry/201812-modularity|RHEL 8/Fedora 28で導入されたModularity - 赤帽エンジニアブログ]]\\ | [[https://rheb.hatenablog.com/entry/201812-modularity|RHEL 8/Fedora 28で導入されたModularity - 赤帽エンジニアブログ]]\\ |