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?

More than 1 year has passed since last update.

[Linux 初期設定] パッケージ自動更新

Posted at

Linux 初期設定シリーズ

変更内容:パッケージ自動更新
確認OS:Red Hat Enterprise Linux release 9.2 (Plow)
対象ファイル:/etc/dnf/automatic.conf
反映:サービスの再起動

1.自動アップデートツールのインストール

test.sh
sudo dnf install -y dnf-automatic dnf-utils

2.設定ファイルのバックアップ

test.sh
sudo ls -alF /etc/dnf/automatic.conf*
sudo cp -an /etc/dnf/automatic.conf{,.$(date +%Y%m%d)}
sudo ls -alF /etc/dnf/automatic.conf*

3.パッケージの自動更新の有効化

test.sh
sudo sed -i -e 's/^apply_updates = no/apply_updates = yes/' /etc/dnf/automatic.conf

4.設定の確認

test.sh
sudo grep ^apply_updates /etc/dnf/automatic.conf
sudo diff /etc/dnf/automatic.conf{,.$(date +%Y%m%d)}

5.サービスの登録、サービスの開始および確認

test.sh
sudo systemctl start dnf-automatic.timer
sudo systemctl enable dnf-automatic.timer
sudo systemctl status dnf-automatic.timer
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?