CentOS6.8 から CentOS7 へのアップグレード

そろそろCentOS7にしてみようかなと思った。
(注:結果としてはアップグレードは失敗し、クリーンインストールすることにしました。
★追記:この記事へのコメントで「openscapをバージョンダウンさせたらエラーがなくなりました」と教えてもらえました。自分でも後で試そうと思います。)
「Pre-Upgradeツール」てのが必要なんでしたっけ、と見に行ったら--

TipsAndTricks - CentOS Wiki

  1. In Place Upgrade of CentOS 6 to CentOS 7

Upgrade CentOS 6 to CentOS 7 Note: This is not the most highly recommended method to move from CentOS 6 to CentOS 7 ... but it can be performed, at your own risk, if the tool says the risk is Slight or None. We would NEVER recommend using this method with any Medium, High or Extreme issues present.

「ここで説明する方法でアップグレードするのはお奨めしない。自己責任でやるならどうぞ。大事なシステムではやめとくように」とな。そして

DO NOT USE this tool. Warning: use of this tool is currently BROKEN as several system-critical packages are of a higher version number in CentOS 6.7 than they are in CentOS 7 so those do not get upgraded correctly. This renders yum and several other system tools non-functional.

「このツールは現在壊れています。幾つかのシステムクリティカルなパッケージにおいて、CentOS7よりCentOS6.7の方がバージョンが高いものがあり、そのためアップグレードはうまくいきません。Yumとかが機能しないよってことです」という感じのことが書かれてるようです。

確かに6.5→7へのアップデートしてる人は見つかるけど、「How to upgrade "CentOS6.8" to CentOS7」「Centos 7 from 6.8」とかで検索しても出てこない。クリーンインストールしろってことかな。

とは言ったってやってみればできるんじゃないの。と無理やりやってみた。

https://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool

Create a Repo file in /etc/yum.repos.d/, named something like upgradetool.repo

Add the following lines to the repo file:

$ vi /etc/yum.repos.d/upgradetool.repo

[upg]
name=CentOS-$releasever - Upgrade Tool
baseurl=http://dev.centos.org/centos/6/upg/x86_64/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

This command will then get the RPMs installed to run an upgrade:

$ yum install redhat-upgrade-tool preupgrade-assistant-contents
完了しました!

ここまでOK。続けて

  1. Preupgrade Assistant Usage

At the moment, only a CLI interface and limited functionality is available.

Usage is simple. Just follow these steps:

Run "preupg -l" command - it lists all available contents for preupgrade-assistant (as the system is based on a plugin, there may be modules from different sources in the future). If nothing is shown, install the preupgrade-assistant-contents package. If you have CentOS6_7 content available, run the command preupg -s CentOS6_7

"preupg -l"コマンドでプリアップグレードアシスタントが利用可能なコンテンツ一覧が表示されます。その後あなたがCentOS6.7を使っているなら"preupg -s CentOS6_7"と実行しましょう。

$ preupg -l
CentOS6_7

当たり前だけど6.8は出てこないね。"preupg -s CentOS6_8"と無理やりやってみましょうか。

$ preupg -s CentOS6_8
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n

y

Specify correct upgrade path parameter like -s RHEL6_7
Upgrade path is provided by command preupg --list
$ preupg --list
CentOS6_7

だめ。じゃ6_7で。

$ preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:10s)
All changed files      : 02/11 ...finished (time 10:42s)
Changed config files   : 03/11 ...finished (time 00:00s)
All users              : 04/11 ...finished (time 00:00s)
All groups             : 05/11 ...finished (time 00:00s)
Service statuses       : 06/11 ...finished (time 00:00s)
All installed files    : 07/11 ...finished (time 00:07s)
All local files        : 08/11 ...finished (time 00:24s)
All executable files   : 09/11 ...finished (time 00:08s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/096 ...done    (Configuration Files to Review)
002/096 ...done    (File Lists for Manual Migration)
003/096 ...done    (Bacula Backup Software)
004/096 ...done    (MySQL configuration)
 ~
094/096 ...done    (NIS server maps check)
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 09:47s)
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [oscapxml.c:416]
Unable to open file /root/preupgrade/result.html
Usage: preupg [options]

preupg: error: [Errno 2] No such file or directory: '/root/preupgrade/result.html'

だめですね。

諦めて 6.7 からアップデートしましょう。 f:id:demandosigno:20160922212249j:plain

ちゃんと 6.7 が開けてるんでしょうかね。

$ cat /etc/redhat-release
CentOS release 6.8 (Final)

あれー。

$ cat /proc/version
Linux version 2.6.32-573.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Thu Jul 23 15:44:03 UTC 2015

まあこっちで見ると正しく 2.6.32-573 になってるからいいか。再度挑戦。

$ preupg -l
CentOS6_7
$ preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:02s)
All changed files      : 02/11 ...finished (time 10:26s)
Changed config files   : 03/11 ...finished (time 00:00s)
All users              : 04/11 ...finished (time 00:00s)
All groups             : 05/11 ...finished (time 00:00s)
Service statuses       : 06/11 ...finished (time 00:00s)
All installed files    : 07/11 ...finished (time 00:07s)
All local files        : 08/11 ...finished (time 00:25s)
All executable files   : 09/11 ...finished (time 00:09s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/096 ...done    (Configuration Files to Review)
002/096 ...done    (File Lists for Manual Migration)
~
085/096 ...done    (Python 2.7.5)
086/096 ...done    (Ruby 2.0.0)
087/096 ...done    (SCL collections)
088/096 ...done    (System kickstart)
089/096 ...done    (YUM)
090/096 ...done    (Check for usage of dangerous range of UID/GIDs)
091/096 ...done    (Incorrect usage of reserved UID/GIDs)
092/096 ...done    (NIS ypbind config files back-up)
093/096 ...done    (NIS Makefile back-up)
094/096 ...done    (NIS server maps check)
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 10:08s)
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [oscapxml.c:416]
Unable to open file /root/preupgrade/result.html
Usage: preupg [options]

preupg: error: [Errno 2] No such file or directory: '/root/preupgrade/result.html'

ダメ。

result.htmlが生成されたらいろいろ分かるんだろうけど、生成されない。

I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"

で、ファイル読み込み失敗してる。/usr/share/openscap/xsl/を見たらその名前のファイルはないのでそりゃあ文句言われるよ。

$ rpm -qa | grep openscap
openscap-1.2.8-2.el6.centos.x86_64

OpenSCAPは入ってることは入ってるが……。

oss.sios.com

redhat - preupg: error: No such file or directory: '/usr/share/preupgrade/README' - Stack Overflow

Bug 1304772 – report generation is broken (openscap rebased)

https://rhn.redhat.com/errata/RHBA-2016-1022.html

  • To remain compatible with the most recent Red Hat Enterprise Linux version of OpenSCAP, preupgrade-assistant has been updated to reflect the latest XSLT files in use. (BZ#1304772)

分からない…。素直にクリーンインストールした方がいいか。 確かにこれでアップデートできても、6→7で大きく変わってて整合性取らせるために後でYumやらGRUBやらいろいろ再設定しなくちゃいけないみたいですごく面倒くさそう。

https://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.8/Japanese

7.1. 上位ベンダーにあるパッケージで、CentOS が変更したパッケージ openscap

$ rpm -q --changelog openscap | head -n 20
* 火  5月 10 2016 Johnny Hughes <johnny@centos.org> - 1.2.8-2
- add centos to oval defines

* 木  1月 28 2016 Šimon Lukašík <slukasik@redhat.com> - 1.2.8-2
- patch oscap-vm to support Red Hat Enterprise Linux 6

* 月  1月 18 2016 Šimon Lukašík <slukasik@redhat.com> - 1.2.8-1
- upgrade to the latest upstream release
- Report failures on non-utf8 systems (#1285757)

* 金 12月 04 2015 Šimon Lukašík <slukasik@redhat.com> - 1.2.7-1
- upgrade to the latest upstream release (#1259037)
- Introduced '--verbose' mode (#1287295)
- Detailed OVAL results present in HTML report (#1140240)
- fixed issues in scap-as-rpm tool (#1226398, #1258958)
- introduced support for non-decimal OVAL vetsions (#1248378)
- 'oscap oval eval --report' command (#1258958)
- 'oscap xccdf generate --profile <custom-profile> guide' (#1139822)

* 月  2月 16 2015 Šimon Lukašík <slukasik@redhat.com> - 1.0.10-2

http://ftp.riken.jp/Linux/centos/6.8/os/x86_64/Packages/

openscap-1.2.8-2.el6.centos.x86_64.rpm

http://ftp.riken.jp/Linux/centos/7.2.1511/os/x86_64/Packages/

openscap-1.2.5-3.el7.x86_64.rpm

やっぱり「幾つかのシステムクリティカルなパッケージにおいて、CentOS7よりCentOS6.7の方がバージョンが高いものがあり、そのためアップグレードはうまくいきません。」てことかな。

古いやつ入れたらいけるんだろうか。面倒だ。クリーンインストールしよう。

★追記:コメントで「OpenSCAPのバージョンダウンでエラーはなくなりました」と教えてもらえたので試してみました。

$ rpm -qa | grep openscap
openscap-1.2.8-2.el6.centos.x86_64

# rpm -Uhv --oldpackage http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm
http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-1.0.8-1.0.1.el6.centos.x86_64.rpm を取得中
準備中...                ########################################### [100%]
   1:openscap               ########################################### [100%]

$ rpm -qa | grep openscap
openscap-1.0.8-1.0.1.el6.centos.x86_64

再挑戦

# preupg -s CentOS6_7
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n

y

Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:01s)
All changed files      : 02/11 ...finished (time 04:41s)
Changed config files   : 03/11 ...finished (time 00:00s)
~
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 03:21s)
Result table with checks and their results for main contents:
---------------------------------------------------------------
|Bacula Backup Software    |notapplicable |
|MySQL configuration    |notapplicable |
~
|Content for enabling and disabling services based on CentOS 6 system    |needs_action |
|GNOME Desktop Environment underwent several design modifications in CentOS 7 release      |fail |
-----------------------------------------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-161107213059.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Summary information:
We found some critical issues. In-place upgrade is not advised.
Read the file /root/preupgrade/result.html for more details.
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .
メールが /var/spool/mail/root にあります

いけてそうですね。あ、PreUpgradeの名の通りここまでが「アップグレードの前準備」なのか。 f:id:demandosigno:20161107231707j:plain 事前検査の結果が保存されていますので、これを見て必要な措置を行います、が…やっぱりいろいろ面倒だし私には良く分からない部分も多い……。GnomeDesktopのパッケージが大きく変わるからうまく動かないよ、とか外部リポジトリとかからインストールされたパッケージはうまくアップグレードできないよ、とか署名がうんぬんとか、まあ放っておいてもなんとかなりそうな物が多いけど。

とりあえず私のCentOS6.8はただのテスト環境なので、事前警告は無視して("FAIL"のGNOME DesktopだけアンインストールしてCUIで)実際にアップグレードに進んでみます。 https://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool

7.How to Upgrade After Reviewing the Results
Once you are ready to upgrade (you have mitigated all issues you care to mitigate, etc.), you first need to import the CentOS-7 RPM key with this command:

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 Then run the following command to upgrade:

centos-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64/ Then reboot.

8.Known Issues When Upgrading

続きはのちほど。

Windowsから Linuxに sshで接続する

昨今のWindowsSSHクライアントは何が使われているのかなと検索してみたら、「Windows版 OpenSSHが出た」とのことで従来より簡単にSSH接続できるようになったみたい。
なので、PowershellからLinuxに繋いでみることにします。

(結論としては、使えますが別に使いやすくはないです。なんか不安定だし、所々機能不全。他のクライアントを使った方が色々便利に作業できると思います。とはいえ Windowsに初めから入ってるので取り急ぎ繋ぎたい場合には良いかと。というか「Windows版 OpenSSHが出た」という言葉通り、WindowsSSHサーバーにして LinuxWindowsという接続ができるようになったことの方が有意義ですね……)

まずホスト Linux側。CentOSで試しました。OpenSSHサーバーのインストールとサービスの起動確認をします。

CentOS 6 の場合
$ rpm -qa | grep ssh
libssh2-1.4.2-2.el6_7.1.x86_64
openssh-askpass-5.3p1-118.1.el6_8.x86_64
openssh-5.3p1-118.1.el6_8.x86_64
openssh-clients-5.3p1-118.1.el6_8.x86_64
openssh-server-5.3p1-118.1.el6_8.x86_64

(インストールされていなかったら # yum install openssh-server で入れてください)

$ chkconfig --list | grep sshd
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

# service sshd status
openssh-daemon (pid  2116) を実行中...

CentOS 7 の場合。
# systemctl start sshd
# systemctl enable sshd
# systemctl status sshd とか。

次にクライアント Windows側。GitHubからOpen-SSHをダウンロードし、Zipファイルを解凍し適当な場所に置きます。

Releases · PowerShell/Win32-OpenSSH · GitHub

[システムのプロパティ](Windows+R に sysdm.cpl)→[詳細設定タブ]→[環境変数]のユーザー環境変数にPathを追加します。私はD:\Download\OpenSSH-Win64;
Windowsを再起動させておきます。

さて、環境が整ったらWindowsからLinuxへ繋いでみます。

PS D:\> ssh XXXXXX@192.168.10.2 (アドレスは<user>@<hostname>などに適宜変更を。パスを通す前なら PS D:\> .\Download\OpenSSH-Win64\ssh.exe XXXXXX@192.168.10.2)
The authenticity of host '192.168.10.2 (192.168.10.2)' can't be established.
RSA key fingerprint is SHA256:XXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
Are you sure you want to continue connecting (yes/no)?  
yes

XXXXXX@192.168.10.2's password:
Last login: Thu Jun 16 23:38:54 2016 from 192.168.10.2

入れました。

$ pwd
/home/XXXXXX

ただ、日本語が文字化けする。

$ ls
NVIDIA-Linux-x86_64-304.131.run 繝繧ヲ繝ウ繝ュ繝シ繝・ 繝・Φ繝励Ξ繝シ繝・ 繝・せ繧ッ繝医ャ繝

news.mynavi.jp

・日本語が文字化けする!
PowerShellのメニューから「プロパティ」を選択して、「フォント」タブで「MSゴシック」に変更する。

というわけで、一度 exitしてPowerShellに戻って、プロパティから「MSゴシック」に変更して、OKを押して閉じようとしたらエラーが出た。

---------------------------
ショートカットの更新エラー
---------------------------
ショートカットを変更できません:

ショートカットが削除されていないか、または名前が変更されていないか確認してください。
---------------------------
OK   
---------------------------

管理者権限でPowerShellを実行する必要があるようです。

https://support.microsoft.com/ja-jp/kb/2524386

PowerShellを右クリックして[管理者権限で実行]する。[プロパティ][フォント][MSゴシック] 変更できた。
次にchcpで文字エンコードを 65001 に変更する。

PS C:\Windows\system32> chcp
現在のコード ページ: 932

PS C:\Windows\system32> chcp 65001
Active code page: 65001

再度挑戦。

PS C:\Windows\system32> ssh XXXXXX@192.168.10.4
XXXXXX@192.168.10.4's password:
Last login: Fri Jun 17 XX:XX:XX 2016 from 192.168.10.2
$ pwd
/home/XXXXXX
$ ls
NVIDIA-Linux-x86_64-304.131.run  ダウンロード  テンプレート  デスクトップ

いけた。

でも接続を切るときに反応が悪かったり色々と不安定。あまりお勧めしない。

後日やる。

# vi /etc/hosts.deny
ALL:all 

# vi /etc/hosts.allow
sshd:192.168.10.3

PAMによるアクセス制限

/etc/ssh/sshd_config
UsePAM yes

linuxgroupに属しているユーザのみをsshでサーバにログインできるように設定

# vi /etc/security/access.conf 
-:ALL EXCEPT linuxgroup:ALL 
# vi /etc/pam.d/sshd 
account required pam_access.so

パスワード方式ではなく公開鍵方式へ。など、後日。

it.srad.jp 懐かしい。

ttssh2.osdn.jp

PuTTY: a free SSH and Telnet client

やっぱりこのあたりですかね。

はてなブログの設定メモ

はてなブログを使い始めてしばらくしてから、「最初にやっときゃ良かった……」と思うことが幾つもあったのでメモしておきます。

  • 行間が広すぎので狭くする

web-ken.hatenablog.com

shift+enterしたら負け

そうそう!『なんでこんなに行間広いんだ……あ、Shift+Enterの改行なら狭いままだな。よし…Shift+Enter、Shift+Enter、Shift+…めんどくせぇ!』となったよ。

はてなブログの編集画面で"Enter"を押しての改行は<p>...</p>段落タグに置き換えられます。 一方でShift+Enterだと<br>改行タグに置き換えられます。

この<p>タグのCSS

.entry-content {
    margin-bottom: 24px;
}
p {
    margin: 0 0 1.6em; [上][左右][下]
}

と文字サイズの1.6倍の間隔を空ける設定となっています。 というわけで

「デザイン」→「カスタマイズ」→「サイドバー」とクリックしていって表示される「{} デザインCSS」というところだ。  そこに以下のコードをコピペすればpタグは死ぬ。

  • Markdown記法を覚える コードなどを見やすく記載するにはどうすれば良いか?→皆さん

むむむ…Markdownの記事を書くためにまずはMarkdownを覚えないといけない……。

あああ Enterで改行 あああ Enterで改行2回

あああ Shift+Enter あああ

dobonkai.hatenablog.com

dobonkai.hatenablog.com

CentOS をアップデートしたら途中で止まった。

CentOS を6.7から6.8にアップデートしたら起動途中で先に進まなくなった。プログレスバーが左から右に伸びていって、"CentOS6.8"の部分に達したところで止まる。

ブートプロセスを確認してみることにする。
再起動して "Press any key to enter the menu"と出たところで何かキーを押してGRUB画面に入る。
"e" を押した後 kernel行 にカーソルを合わせて "e" 。後方に記載されてる rhgb quiet を削除して "Enter"で戻る。"b" を押してブート。*1

起動プロセスが上から下に流れていって…

Starting atd: [OK]
Starting certmonger: [OK]

で止まった。

ググったら「この辺りで止まるなら グラフィックボードドライバを再インストールしろ」との情報があったのでその通りにしたら直った。

CentOS インストール後にしたこと - demandosigno
に記載したように、私は # sh NVIDIA-Linux-x86_64-304.131.run でインストールしていましたが、これだと カーネルアップデート毎にドライバ再インストールが必要なようです。Yumでパッケージインストールしていればいちいち再インストールしなくて良いようです。
CentOS 6.5 hangs at Start ATD [OK]

というわけで、Starting certmonger: [OK] で止まってる中 Ctrl+Alt+F2で2つ目のCUIを立ち上げる。Xのログを見てみる。確かにドライバーを認識してない。

# tail /var/log/Xorg.0.log
[ 43.335] (EE) No drivers available.
[ 43.335] (EE)
Fatal server error:
[ 43.335] no screens found (EE)
[ 43.335] (EE)
Please consult the CentOS support at https://www.redhat.com/apps/support/ for help.
[ 43.335] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 43.335] (EE)

#

後は

CentOS インストール後にしたこと - demandosigno
と同様にドライバを置いてあるディレクトリに移動して

# sh NVIDIA-Linux-x86_64-304.131.run
で再インストール。再起動。無事立ち上がった。

 

★当初上記のようにRUNファイルを使ったドライバインストールを行いましたが、それだとカーネルアップデート毎に再度ドライバを入れなおさないとダメなので、Yumでのインストールに変更しました。

Yumでのドライバインストールを目指す。

ELRepo : kmod-nvidia-304xx

ELRepo(The Community Enterprise Linux Repository)リポジトリーの導入。
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm を取得中
準備しています... ################################# [100%]
更新中 / インストール中...
1:elrepo-release-7.0-2.el7.elrepo ################################# [100%]

# yum repolist enabled
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* elrepo: ftp.ne.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp

リポジトリー ID リポジトリー名 状態
base/7/x86_64 CentOS-7 - Base 9,007
elrepo ELRepo.org Community Enterprise Linux Repository - el7 172
extras/7/x86_64 CentOS-7 - Extras 393
updates/7/x86_64 CentOS-7 - Updates 2,560
repolist: 12,132

★すでに # sh NVIDIA-Linux-x86_64-304.131.run でインストール済みの人は、先に
sh ./NVIDIA-Linux-x86_64-304.64.run --uninstall
バイナリ版をアンインストールしてください。

# yum install kmod-nvidia あたりでTABキーを押すと候補が出るのでよく確認しましょう。
kmod-nvidia-304xx.x86_64 kmod-nvidia-340xx.x86_64 kmod-nvidia.x86_64

# yum install kmod-nvidia-304xx.x86_64
読み込んだプラグイン:fastestmirror, langpacks...

# rpm -qa | grep nvidia
kmod-nvidia-304xx-304.131-1.el7.elrepo.x86_64
nvidia-x11-drv-304xx-304.131-1.el7.elrepo.x86_64

後はランレベルを5に戻して再起動。

*1:

* CentOS - 起動時プログレスバー非表示設定! - mk-mode BLOG

rhgb: “Red Hat Graphical Boot” の略。 システムのブートプロセスをグラフィカルに表示するオプション。 カーネルを経由して init に渡され、シェルスクリプト /etc/rc.sysinit の中で実行される。
quiet: ほとんどのカーネルメッセージを抑制し、表示を行わないオプション。
rhgb を残して quiet だけ削除すると前半部分のメッセージは表示され、その後のプログレスバーも表示される。 quiet を残して rhgb だけ削除すると前半部分のメッセージは非表示になり、プログレスバー部分はプログレスバーではなくメッセージが表示される。

CentOS インストール後にしたこと

AMD製のCPUではCentOS7.2が動かないということなのでCentOS7.1をインストールしました。
(現在は解決してるぽい? https://bugs.centos.org/view.php?id=9860

 

・ソフトウェアの更新

残りの細かいパッケージをアップデートしたら[システムツール]から[Software]や[Software Updata]が消えた。

  1. アプリケーションインストーラーのインストール
    #yum install gnome-software.x86_64
  2. アプリケーションインストーラーを使ってgnome パッケージアップデータをインストール
    [アプリケーションインストーラー]→[システム]→[その他]→[gnome パッケージ],[gnome パッケージアップデータ]

でだいたい戻る。

 

・ミラーサーバーの設定。

ftp-adminの憂鬱: yumで速いミラーサーバーを指定する方法

#rpm -qa | grep fastestmirror

yum-plugin-fastestmirror-1.1.31-34.el7.noarch

/etc/yum/pluginconf.d/fastestmirror.confに以下の preferオプションでサーバーを一つ指定。

prefer=ftp.jaist.ac.jp

/var/cache/yum以下にあるtimedhosts.txtをいったん削除。

・グラフィックボードのドライバーをインストールする。

刺さっているグラボの確認。

$ lspci | grep VGA
07:00.0 VGA compatible controller: NVIDIA Corporation G73 [GeForce 7300 GT] (rev a1)

# lsmod | grep nouveau

で、現在使用されている nouveauモジュールが幾つか表示される。

Nouveau(ヌーボー)はNVIDIAビデオカード用にオープンソースで開発されている無料のドライバーですが、競合するので止めます。

NVIDIA Accelerated Linux Graphics Driver README and Installation Guide

Chapter 4. Installing the NVIDIA Driver

Before you Begin

If you're installing on a system that is set up to use the Nouveau driver, then you should first disable it before attempting to install the NVIDIA driver. See Q & A 8.1, “Interaction with the Nouveau Driver” for details. 

8.1. Interaction with the Nouveau Driver

What is Nouveau, and why do I need to disable it?

Smiling Life : CentOS7におけるNVIDIAドライバのインストール方法

を参照しました。

 

nouveauをロードしない起動イメージファイルを作成。
デフォルトのイメージファイルをバックアップとして残しておく。
# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img

次のコマンドでnouveauドライバをロードしない起動イメージファイルを作成。
#dracut --omit-drivers nouveau /boot/initramfs-$(uname -r).img $(uname -r)

# vi /etc/modprobe.d/blacklist.conf に
blacklist nouveau
の1行を加える。

デフォルトランレベルを3に変更する。

CentOS7の場合。
# systemctl get-default
graphical.target

# systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.

# systemctl get-default
multi-user.target

CentOS6の場合。
# vi /etc/inittab
id:3:initdefault:

NVIDIAのページから該当のLinux用ドライバをダウンロードして、後で見つけやすい場所に保存する。カタカナの「ダウンロード」フォルダとかだと後ほどrunlevel:3でインストールするときに面倒なので一つ上の /home/ あたりに置いておく。

その後再起動。

rootでログイン。runファイルの実行。

# sh NVIDIA-Linux-x86_64-304.131.run

設問を進めてインストール

インストールが完了したら

CentOS7の場合
# systemctl get-default
multi-user.target

># systemctl set-default graphical.target

># systemctl get-default
graphical.target

># reboot

CentOS6の場合

# vi /etc/inittab

ランレベルを5に戻して再起動。

(注:当初上記のようにrunファイルを使ったドライバインストールを行いましたが、それだとカーネルアップデート毎に再度ドライバを入れなおさないとダメなので、Yumでのインストール(後述)に変更しました)

CentOS をアップデートしたら途中で止まった - demandosigno

 

Yumでのドライバインストールを目指す。

ELRepo : kmod-nvidia-304xx

ELRepo(The Community Enterprise Linux Repository)リポジトリーの導入。
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm を取得中
準備しています... ################################# [100%]
更新中 / インストール中...
1:elrepo-release-7.0-2.el7.elrepo ################################# [100%]

# yum repolist enabled
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* elrepo: ftp.ne.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp

リポジトリー ID リポジトリー名 状態
base/7/x86_64 CentOS-7 - Base 9,007
elrepo ELRepo.org Community Enterprise Linux Repository - el7 172
extras/7/x86_64 CentOS-7 - Extras 393
updates/7/x86_64 CentOS-7 - Updates 2,560
repolist: 12,132

★すでに # sh NVIDIA-Linux-x86_64-304.131.run でインストール済みの人は、先に
sh ./NVIDIA-Linux-x86_64-304.64.run --uninstall
でバイナリ版をアンインストールしてください。

# yum install kmod-nvidia あたりでTABキーを押すと候補が出るのでよく確認しましょう。
kmod-nvidia-304xx.x86_64 kmod-nvidia-340xx.x86_64 kmod-nvidia.x86_64

# yum install kmod-nvidia-304xx.x86_64
読み込んだプラグイン:fastestmirror, langpacks...

# rpm -qa | grep nvidia
kmod-nvidia-304xx-304.131-1.el7.elrepo.x86_64
nvidia-x11-drv-304xx-304.131-1.el7.elrepo.x86_64

ランレベルを5に戻して再起動。

無事インストールされ、1920*1200 二枚のFullHDにできた。

gnomeのパネルが右側のモニターに出ていたので左側のモニターに移す。

パネルを右クリック→プロパティ→[向き]の中から左側モニターの[上](下のパネルは[下])を選択する。

Google Chrome のインストール

GoogleYumリポジトリをCentOS7に追加。
#vi /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

#yum update

Chromeパッケージの確認。

#yum search google chrome

読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* elrepo: ftp.ne.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp
=========== N/S matched: google, chrome ==================
google-chrome-beta.x86_64 : Google Chrome (beta)
google-chrome-stable.x86_64 : Google Chrome
google-chrome-unstable.x86_64 : Google Chrome (unstable)

Full name and summary matches only, use "search all" for everything.

#yum info google-chrome-unstable
バージョン : 56.0.2902.0

#yum info google-chrome-beta
バージョン : 55.0.2883.28

#yum info google-chrome-stable
バージョン : 54.0.2840.71

stableで十分だと思います。

#yum install google-chrome-stable

依存関係から他にもいろいろインストールされます。

# rpm -qa | grep chrome
google-chrome-stable-54.0.2840.71-1.x86_64

 

Flash pluginをFirefoxにインストール

https://get.adobe.com/flashplayer/ から Linux YUM版をダウンロード。
そのままパッケージインストーラーで開けたのでOKを押す。
「このファイルをインストールしたいですか。」でインストール

ブラウザ再起動、がFlashページが見られないまま。さっき入ったのは Adobe Repository Configuration らしい。で、「ソフトウェアの追加/削除」から、"adobe"で検索して flash-plugin-11.2 があったのでインストール。ブラウザ再起動。入った。

demandosigno.hatenablog.jp

/* -----codeの行番号----- */