LoginSignup
0
0

常に最新NVIDIAドライバをダウンロードするスクリプト

Last updated at Posted at 2023-09-19

最新ドライバを知る

NVIDIAが下記のページで常に最新バージョンをアナウンスしてくれている。
ここを利用させてもらいます。
https://download.nvidia.com/XFree86/Linux-x86_64/latest.txt

最新ドライバの場所

https://download.nvidia.com/XFree86/Linux-x86_64/
ここからダウンロードできる。

上記を踏まえて

#!/bin/bash

#wgetをinstall 
#apt,dnf,yumのパッケージ管理には対応
#それ以外は手動でwgetインストールしてください。
apt install -y wget||dnf install -y wget ||yum install wget -y

#最新版情報の取得
ver=$(wget  -O - https://download.nvidia.com/XFree86/Linux-x86_64/latest.txt -q |awk -F " " '{print $1}')
echo $ver

mkdir -p /root/install
#ファイルパスなど指定
URL="https://download.nvidia.com/XFree86/"$(uname -s)"-"$(uname -p)"/"$ver"/"
FILENAME="NVIDIA-"$(uname -s)"-"$(uname -m)"-"$ver".run"
FILEPATH="/root/install/"

#wgetで落とす
wget $URL$FILENAME -O $FILEPATH$FILENAME

#実行権限つけておく
chmod +x $FILEPATH$FILENAME

Pre or Post download

この作業の前後にblacklistやinitramfs updateの実行など必要な操作をしてrebootかけておくと良いです。自分はblacklist登録->initramfs update->ダウンロード->再起動をスクリプトで実行しています。

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