LoginSignup
2
3

More than 5 years have passed since last update.

Cygwin環境を管理者権限なしで作り直す

Last updated at Posted at 2017-01-04

あれこれ削除したら壊れた

直前のエントリで不要なファイルを削除しまくってたら
1.Vimで色がつかなくなった。
2.cygwin-setup.shの起動ショートカットが働かない
3.gvim起動しなくなった。libcairo2入れたら起動したが、閉じなくなった。
特にVimで色つけされないのは不便すぎる。気持ち悪いのできれいな気持ちで2017年Cygwin環境をまっさらな状態からやり直そう。

インストールから

  1. setup-x86_64.exeをダウンロード
  2. コマンドラインからsetup-x86_64.exe --no-adminで起動する。
  3. 本体はC:\apps\PortableApps\cygwin64にインストールする。
  4. パッケージはC:\apps\PortableApps\cygwin64\packagesに取ってくる。
  5. ftp://ftp.jaist.ac.jp を使う。
  6. 以下ダウンロードされるらしい。
_autorebase
alternatives
base-cygwin
base-files
bash
coreutils
cygutils
cygwin
dash
diffutils
editrights
file
findutils
gawk
getent
grep
gzip
hostname
info
ipc-utils
libopenssl100
libreadline7
login
man-db
mintty
ncurses
openssl
rebase
run
sed
tar
terminfo
tzdata
util-linux
vim-minimal
which

7. 足りないものを追加。

vim
curl
git
openssh
tmux
rxvt-unicode
wget

8.「次へ」で進むと、 諸々依存関係を解決してくれるのでそれらも同時にインストール。
9. cygwin64/cygwin.batを以下のように変更。

@echo off

C:
chdir C:\apps\PortableApps\cygwin64\bin

mintty -i /Cygwin-Terminal.ico /bin/bash --login -i

10.次回インストールしやすいように/usr/local/bin以下にcygwin-setup.shを作成する。

cygwin-setup.sh
#! /bin/sh

cd ~
CYGWIN_EXE="setup-x86_64.exe"
rm ${CYGWIN_EXE}
wget http://cygwin.com/${CYGWIN_EXE}
chmod u+x ${CYGWIN_EXE}
run ./${CYGWIN_EXE} --no-admin

11.setup_x86_64.exeを C:\apps\cygwin64\home\(名前)\setup-x86_64.exe として保存。
12.以下へのショートカットを作成。
C:\apps\PortableApps\cygwin64\bin\mintty.exe -i /Cygwin-Terminal-ico /bin/bash -l -c 'cygwin-setup.sh'
僕はcraftlaunchに以下のエントリを入れている。

( u"Cygwin-Setup",  window.ShellExecuteCommand( None, portdir + "cygwin64/bin/mintty.exe", u"-i /Cygwin-Terminal.ico /bin/bash -l -c 'cygwin-setup.sh'", u"") ),

13.minttyのフォントをMigu 1Mの12に設定する。
14.今こんな感じ。
cygwin_20170104.jpg

今後行うこと

  1. .ssh 及び .ssh/configを移行
  2. alias、bash関数のうち必要なものを移行
  3. シンボリックリンクのうち必要なものを移行
  4. Vimの.vimrc、プラグインなどから必要なものを移行
  5. minttyのテーマをSoloarized Lightに設定する。

今回の気づき

  1. tmuxがあればウインドウマネージャーは不要
  2. 起動が遅いとイラつく。多機能より速さ。
  3. 何でもかんでもインストールせず、なるべくbashなどスクリプトで補う。
2
3
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
2
3