Debian Wheezy から Jessie にディストリビューションアップグレードしてみる

しばらく待つと正式の文章が出ると思うけれどWheezy のアップグレードの文章を見ながら試しにあげてみた.
テスト環境だし,素に近い環境なので大雑把ですが><

パッケージを最新に

$ sudo apt-get update
$ sudo apt-get upgrade

backup

pkg 情報

/usr/bin/dpkg --get-selections "*"
を保存しておく.

いつもは以下のようにしてcrontab で毎日取得している.
7 8 * * * /usr/bin/dpkg --get-selections "*" > /home/mk/.dpkg_--get-selections

/etc 以下

$ sudo sh -c "cd /;tar cvJf /var/tmp/x61_etc.tar.xz /etc"
$ scp -P 2222 /var/tmp/x61_etc.tar.xz 192.168.1.102:/export/backup/

etckeeper を使っているけれど念の為バックアップ.

/home

日時バックアップがとれているのでよしとする.

Pin の解除

$ find /etc/apt/ -type f|grep preferences
使ってないのでそのまま.

パッケージ状態の確認

$ sudo dpkg --audit
$ sudo dpkg --get-selections | grep 'hold$'

特に問題は無さそう.

ソースリストの確認

公式だけにする.

$ cat /etc/apt/sources.list
# deb http://ftp.jp.debian.org/debian/ wheezy main

deb http://ftp.jp.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.jp.debian.org/debian/ wheezy main non-free contrib

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

ソースリストをJessie に書き換える

$ cat /etc/apt/sources.list
# deb http://ftp.jp.debian.org/debian/ jessie main

deb http://ftp.jp.debian.org/debian/ jessie main non-free contrib
deb-src http://ftp.jp.debian.org/debian/ jessie main non-free contrib

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

root 権限になる

$ sudo -s

ログの取得開始

# script -t 2 ~mk/Wheezy2Jessie.log

パッケージ情報を更新

# apt-get update

アップグレードに必要な容量を確認する

# apt-get -o APT::Get::Trivial-Only=true dist-upgrade
--snip--
アップグレード: 554 個、新規インストール: 47 個、削除: 2 個、保留: 0 個。
401 MB のアーカイブを取得する必要があります。
この操作後に追加で 33.1 MB のディスク容量が消費されます。
E: Trivial Only が指定されましたが、これは簡単な操作ではありません。

最小アップグレード

# apt-get upgrade
--snip--
アップグレード: 436 個、新規インストール: 0 個、削除: 0 個、保留: 118 個。
270 MB のアーカイブを取得する必要があります。
この操作後に 218 kB のディスク容量が解放されます。
続行しますか [Y/n]? Y
----snip--

アップグレード

# apt-get dist-upgrade
--snip--
アップグレード: 118 個、新規インストール: 47 個、削除: 2 個、保留: 0 個。
131 MB のアーカイブを取得する必要があります。
この操作後に追加で 33.3 MB のディスク容量が消費されます。
続行しますか [Y/n]? Y
--snip--

パッケージの衝突なども発生せず無事アップグレードできた.

ログ終了

# exit

sudo 設定

# visudo
で確認.
必要な権限がなくなっていたりしたら登録する.

※この確認が終わるまでsu 状態から未だ抜けないように

再起動

# reboot

Version 確認

$ cat /etc/debian_version 
jessie/sid
$ uname -a
Linux x61s 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux

参考URL
– [[http://www.debian.org/releases/wheezy/amd64/release-notes/ch-upgrading.ja.html|第4章 Debian 6.0 (squeeze) からのアップグレード]]

オンラインストレージサービスCopy を試す

オンラインストレージサービスのcopy というものを知りました.
Copy

Linux Client もあるみたい(Linux/Mac/Win/iOS/Android)なので少し試してみました.
#以下のアンカから登録で無料5GB + 紹介ボーナスで5GB = 10GB になります.
https://copy.com?r=WrvHLs
##アカウント登録までは5GB で,アプリ入れてログインするとボーナスの5GB が反映されるみたいです.

copy for Linux をDebian Wheezy に.
ダウンロードして展開,amd64 の実行ファイルを ~/opt/copy にcp して実行.

$ tar xvzf copy_agent-1.28.0657.tgz
$ mkdir -p ~/opt/copy
$ cp -pr copy/x86_64/* ~/opt/copy
$ \rm -rf copy
$ ~/opt/copy/CopyAgent

初回起動時自動起動の設定も自動でされます.
とりあえずこれでOK と思います.
初め全然同期されなかったのですが,一旦サスペンドして復帰したら同期されるようになりました.
もしうまく行かない場合は再起動してみるといいかもしれません.
しばらく試してみようと思います.
#コマンドライン版もあるようなのでまた試してみます.

Debian Squeeze にWP を試しに立ててみる

IMGP8267

ずっとblog 放置してて最近はGoogle+ やPukiwiki にメモしたりしてますがblog もたまに書きたくなって来ました.
ということで,blog を立ち上げてみようかと思います.
先ずはこのblog の為にWP を入れてみたエントリから.

環境

$ cat /etc/debian_version 
6.0.5

導入

$ sudo apt-get install wordpress wordpress-l10n

設定

apache の設定

$ cd /etc/apache2/sites-enabled
$ sudo vi 004-matoken.org
$ sudo git diff 004-matoken.org
diff --git a/apache2/sites-enabled/004-matoken.org b/apache2/sites-enabled/004-matoken.org
index df3c502..1c9f8b7 100644
--- a/apache2/sites-enabled/004-matoken.org
+++ b/apache2/sites-enabled/004-matoken.org
@@ -14,6 +14,13 @@
                allow from all
        </Directory>

+       Alias /blog /usr/share/wordpress
+       <directory /usr/share/wordpress>
+               Options FollowSymLinks
+               AllowOverride Limit Options FileInfo
+               DirectoryIndex index.php
+       </directory>
+
        ErrorLog ${APACHE_LOG_DIR}/error-matoken.org.log

        # Possible values include: debug, info, notice, warn, error, crit,
$ sudo /etc/init.d/apache2 restart

db の作成

DB 名 : wordpress
DB User : wp
DB Password : password

$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7158
Server version: 5.1.63-0+squeeze1 (Debian)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.04 sec)

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wp@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.22 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.16 sec)

mysql> EXIT
Bye

wordpress の設定

$ cat /etc/wordpress/config-matoken.org.php
<?php                                                                                                                                                 
define('DB_NAME', 'wordpress');                                                                                                                       
define('DB_USER', 'wp');                                                                                                                              
define('DB_PASSWORD', 'password');                                                                                                                 
define('DB_HOST', 'localhost');                                                                                                                       
define('DB_CHARSET', 'utf8');                                                                                                                         
define('DB_COLLATE', '');                                                                                                                             
define ('WPLANG', 'ja');                                                                                                                              
define('WP_HOME', 'https://matoken.org/blog');                                                                                                         
define('AUTH_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');                                                                                                                                                         
define('SECURE_AUTH_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');                                                                                                                                                  
define('LOGGED_IN_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');                                                                                                                                                    
define('NONCE_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
?>

https://matoken.org/blog/ にアクセスして設定.

Plugin の導入

WordPress › Markdown on Save Improved « WordPress Plugins

Markdown 記法が使えるようになるPlugin です.

$ cd /tmp
$ wget http://downloads.wordpress.org/plugin/markdown-on-save-improved.2.2.zip
$ cd /usr/share/wordpress/wp-content/plugins
$ sudo unzip /tmp/markdown-on-save-improved.2.2.zip

管理画面の「プラグイン」から Markdown on Save Improved を有効化

その他

パーマリンク設定が有効にならない

rewrite が無効になっているので有効にする

$ sudo a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
$ sudo /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .