0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

`dnf`でパッケージの更新をダウンロードだけしてあとからインストールしてみる

0
Last updated at Posted at 2026-10-04

理由

やりたかったから
最悪,dnfのロールバック機能が使えそう。それはそれで試したい。

クソ忙しいときに息抜きを称して実機をぶっ壊すと大変なことになります。仮想環境でやりましょう。

叩くど

ソフトウェアに更新が通知されたので,ダウンロードを実行したら失敗する。
なんでかはわからんけど,とりあえずCUIから叩いてみよう。

$ dnf check-upgrade
Updating and loading repositories:
 Fedora 44 - x86_64 - Updates                                                                                                      100% |   1.9 KiB/s |   6.4 KiB |  00m03s
 Unity Hub                                                                                                                         100% |   1.1 KiB/s |   2.1 KiB |  00m02s
 RPM Fusion for Fedora 44 - Nonfree - Updates                                                                                      100% |   4.6 KiB/s |  15.2 KiB |  00m03s
(略)
Repositories loaded.
Upgrades (available for reinstall, available for upgrade)
chatgpt.x86_64                 26.930.41038-1 openai-chatgpt
cifs-utils.x86_64              7.8-2.fc44     updates
cifs-utils-info.x86_64         7.8-2.fc44     updates
enchant2.x86_64                2.8.21-1.fc44  updates
firefox.x86_64                 157.0-1.fc44   updates
firefox-langpacks.x86_64       157.0-1.fc44   updates
flatpak.x86_64                 1.18.4-1.fc44  updates
flatpak-libs.x86_64            1.18.4-1.fc44  updates
flatpak-selinux.noarch         1.18.4-1.fc44  updates
flatpak-session-helper.x86_64  1.18.4-1.fc44  updates
fuse-common.x86_64             3.18.3-1.fc44  updates
fuse3.x86_64                   3.18.3-1.fc44  updates
fuse3-libs.x86_64              3.18.3-1.fc44  updates
google-chrome-canary.x86_64    157.0.8084.0-1 google-chrome
(略)

普通の更新に見えますね。

$ dnf upgrade
The requested operation requires superuser privileges. Please log in as a user with elevated rights, or use the "--assumeno" or "--downloadonly" options to run the command without modifying the system state.

痛恨のミス!管理者権限をつけていません。いつもなら脳死でsudoするんですが,今回は--downloadonlyをつけてみます。

$ dnf upgrade -h
--downloadonly   Only download packages for a transaction

うん,予想通りの機能です。

$ dnf upgrade --downloadonly

んー,普通に正常終了です。設置はどうやるんでしょうか。

dnf install -h
Usage:
  dnf5 [GLOBAL OPTIONS] install [OPTIONS] [ARGUMENTS]

dnf instlal,普通はパッケージを指定してインストールですが,引数は任意ですね。ワンちゃんこれじゃないですか?

$ dnf install
Missing positional argument "specs" for command "install". Add "--help" for more information about the arguments.

あー,違うっぽいです。


落ちてきているのはおそらくrpmパッケージです。が,どこに落ちたのかわかりません…
出力に「ここに保存したよ」的な記述があったかもしれないのですが,誤ってセッションを落としてしまい,見れずじまいです。

が,光明!見つかりました。

image.png

ではfindでより詳しく見ます。

$ find .cache/libdnf5 -name "*.rpm"
.cache/libdnf5/google-chrome-6ed7e4f336f6863c/packages/google-chrome-canary-157.0.8084.0-1.x86_64.rpm
.cache/libdnf5/updates-3cc07c89a20302f2/packages/cifs-utils-7.8-2.fc44.x86_64.rpm
.cache/libdnf5/updates-3cc07c89a20302f2/packages/cifs-utils-info-7.8-2.fc44.x86_64.rpm
.cache/libdnf5/updates-3cc07c89a20302f2/packages/enchant2-2.8.21-1.fc44.x86_64.rpm
.cache/libdnf5/updates-3cc07c89a20302f2/packages/firefox-157.0-1.fc44.x86_64.rpm
(略)

管理者権限をつけてダウンロードすれば/var/cache/dnfなどに保存される,といった情報はあったのですが,今回は一般人なので,どこに落ちたのかわかりませんでした。気合で見つけました。

こいつをすべてインストールするだけです!

$ find .cache/libdnf5 -name "*.rpm" | xargs sudo dnf install -y
Updating and loading repositories:
Repositories loaded.
Package                                                Arch       Version                                                Repository                                    Size
Upgrading:
 chatgpt                                               x86_64     0:26.930.41038-1                                       @commandline                               1.5 GiB
   replacing chatgpt                                   x86_64     0:26.928.31416-1                                       openai-chatgpt                             1.5 GiB
 cifs-utils                                            x86_64     0:7.8-2.fc44                                           @commandline                             278.7 KiB
(略)

dnf installの引数に別個に渡されてるんですかね?まとめて?出力見る限りまとめてっぽいですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?