標籤:分區 develop ubuntu mysql
安裝ubuntu需要設定檔和安裝許多軟體,因為自己對ubuntu沒有深入的瞭解,出了一些問題就會重裝系統。多裝幾次後總結了一些常用的配置和踩過的坑:
資料分割配置
/boot boot分區,引導系統程式所需要的檔案,安裝多個作業系統時用來引導/ 根分區/usr 系統使用者工具和程式/home 使用者目錄swap分區 大小約等於記憶體的大小,相當於win下的虛擬記憶體
更改root許可權密碼
剛安裝好的ubuntu root許可權密碼需要啟用
sudo passwd
更新軟體源
設定–>軟體和更新–>更改伺服器,取消掉下載源碼選項會節省很多時間。
sudo apt-get update sudo apt-get upgrade
刪除不必要的軟體
亞馬遜等封裝在ubuntu的軟體對我們沒用,在軟體中新刪除
安裝搜狗拼音
檢查是否安裝fcitx,bssh
sudo apt-get install fcitx libsshdpkg -l|grep fcitxdpkg -l|grep libssh
去搜狗IME官網下載安裝,重啟之後生效
配置java
sudo vim /etc/profileaddexport JAVA_HOME=your jdk direxport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHEXITsource /etc/profile
- /etc/environment與/etc/profile的區別
/etc/environment針對的時整個系統的設定,而/etc/profile針對/home目錄下的使用者
如果以上兩個檔案的配置相同,會在使用者的案頭環境中顯示/etc/profile中的配置
安裝GIT
git官網
git協助
$ git help <verb>$ git <verb> --help$ man git-<verb>e.g.git help config
ssh
ssh與git和github相關的配置
公開金鑰和私密金鑰
ssh-keygen -t rsa -C "your email"cd ~/.ssh將id_rsa.pub中的內容複寫到github中測試ssh -T [email protected].com
install mysql
ubuntu內建的包版本和社區維護的版本有區別,一般官方社區維護的版本要比ubuntu團隊的版本更新快,所以我們安裝社區的版本
- 下載.deb檔案,注意選擇版本
- Adding the MySQL APT Repository
sudo dpkg -i mysql-apt-config_w.x.y-zubuntu14.04_all.deb
- During the installation of the package, you will be asked to choose the versions of the MySQL server and other components (for example, the MySQL Workbench) that you want to install. If you are not sure which version to choose, do not change the default options selected for you. You can also choose none if you do not want a particular component to be installed. After making the choices for all components, choose Apply to finish the configuration and installation of the release package.
- 可以重新設定選擇的軟體包
sudo dpkg-reconfigure mysql-apt-config
sudo apt-get update(更新軟體列表)點我查看更新了那些軟體包
sudo apt-get install package-name
- 安裝
sudo apt-get install mysql-server
Starting and Stopping the MySQL Server
shell> sudo service mysql status
Stop the MySQL server with the following command:
shell> sudo service mysql stop
To restart the MySQL server, use the following command:
shell> sudo service mysql start
參考
以上是多次安裝配置linux總結的經驗。
Linux configure for java web develop