这里简要介绍了安装Ubuntu14以后必备的一些应用的安装方法,对于它们的具体用法,请找谷姐或度娘!
xiwang@ubuntu:~$ sudo apt-get install vim
xiwang@ubuntu:~/workspace/java/hello_world$ cat ~/.vimrc set tabstop=2 set shiftwidth=2 "set expandtab set smartindent set autoindent set cindent set hlsearch
# 查看当前启动级别 runlevel # 结果应该是2 # 将runlevel设置为3 sudo vi /etc/inittab # 增加下面这一行到inittab中 id:3:initdefault: ## 以上仅仅是一个启动级别的改动,但是3和2基本是没有区别。下面需要对3进行定制 sudo vi /etc/init/lightdm.conf # 将 start on ((filesystem and runlevel [!06] and started dbus and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udev-fallback-graphics)) or runlevel PREVLEVEL=S) # 修改为 start on ((filesystem and runlevel [!036] and started dbus and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udev-fallback-graphics)) or runlevel PREVLEVEL=S) # 使得lightdm不在级别3中启动
还有一个文章是这么说的:http://forum.ubuntu.org.cn/viewtopic.php?p=3070982
正确方法如下(亲测13.10和14.04Beta2)
第一步:
一、查看文件/etc/init/rc-sysinit.conf,在第14行附近:确认“env DEFAULT_RUNLEVEL=2”。2是新装系统默认的,确保不被修改。 二、编辑文件 /etc/init/lightdm.conf,在第12行附近,原句“ and runlevel [!06]” 改为“ and runlevel [!026]”。
编辑/etc/default/grub 把 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 改成 GRUB_CMDLINE_LINUX_DEFAULT="text" 其实只要把"quiet splash"修改为其它字符就可以了,这是系统启动是ubuntu那个logo和下面那个闪动的小亮点。 别忘了update一下grub #=> update-grub
想进入X,直接startx,绝对装B利器!
xiwang@ubuntu:~$ sudo apt-get install openssh-server
/etc/init.d/ssh start
使用Putty或其他SSH客户端来访问当前服务器
方法一:使用Ubuntu提供的JDK
$ sudo apt-get install openjdk-7-jdk
方法二:我在官网上找到64位(我Ubuntu就是64位的)的JDK二进制包,然后解压。
xiwang@ubuntu:~/Downloads/20140605-jdk-7u60$ mkdir ~/.opt xiwang@ubuntu:~/Downloads/20140605-jdk-7u60$ mv jdk1.7.0_25/ ~/.opt
$ vim ~/.bashrc
# customized by xiaoqiang wang #java{ JAVA_HOME=$HOME/.opt/jdk1.7.0_25 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CLASSPATH=.:$JAVA_HOME/lib export CLASSPATH #}
$ . ~/.bashrc $ javac -version javac 1.7.0_25 $ java -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
$ curl -sSL https://get.rvm.io | bash -s
$ rvm get stable $ rvm requirements #=> 如果提示缺少什么,可以通过命令 `sudo apt-get install xxxx` 来安装xxxx。
$ source ~/.rvm/scripts/rvm
$ rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr <wait a while>
$ rvm use 2.0.0@rails_4_0 --create --default
$ gem install rails --version 4.0.4 --no-ri --no-rdoc
$ which ruby /home/xiwang/.rvm/rubies/ruby-2.0.0-p481/bin/ruby $ which gem /home/xiwang/.rvm/rubies/ruby-2.0.0-p481/bin/gem $ which rails /home/xiwang/.rvm/gems/ruby-2.0.0-p481@rails_4_0/bin/rails
$ gem install rails --version 4.0.4 --no-ri --no-rdoc ERROR: Could not find a valid gem 'rails' (= 4.0.4), here is why: Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - connect(2) (https://api.rubygems.org/specs.4.8.gz)
$ gem sources --remove https://rubygems.org/ $ gem sources -a https://ruby.taobao.org/ $ gem sources -l *** CURRENT SOURCES *** https://ruby.taobao.org # 请确保只有 ruby.taobao.org
《Ruby on Rails 教程》
http://railstutorial-china.org/chapter1.html
搭建NodeJS环境
搭建SFTP环境