首页 > 代码库 > Linux_Ubuntu16.04_Installation
Linux_Ubuntu16.04_Installation
-
Linux_Ubuntu16.04_Installation
安装一定要留下顺序,思路,细节步骤,不然按一次忘一次,然后还得各种搜
win7 与VM 共享
目的:资源共享;VM共享还可以互相复制粘贴
思路 运行一种协议,然后找到地址信息,本机远程互调
Samba,ssh, 或者VM tools
VM里菜单栏找,|虚拟机|,|VMware Tools|
http://blog.sina.com.cn/s/blog_626e09150101nh0r.html
http://blog.csdn.net/gaojinshan/article/details/9231853
常用命令
命令:管理类
sudo
su – root
sudo passwd root
sudo commonuser
sudo apt-get upgrade#!!!!!谨慎使用
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
http://blog.csdn.net/cnmilan/article/details/36870819
deb http://archive.ubuntukylin.com:10006/ubuntukylin trusty main
sudo apt-get update
gdebi
sudo apt install gdebi
ls –a 显示隐藏文件
ll-a
clear 清屏
用户
chmod
chown
chgrp
Id id 用户名 查用户信息
useradd Useradd 创建一个新的用户
groupadd Groupadd 组名 创建一个新的组
passwd Passwd 用户名 为用户创建密码
Passwd -d Passwd -d用户名 删除用户密码也能登陆
Passwd -l Passwd -l用户名 锁定账号密码
Passwd -u Passwd -u用户名 解锁账号密码
Passwd -S Passwd -S用户名 查询账号密码
Usermod -l Usermod -l 新用户名 老用户名 为用户改名
Usermod -L Usermod -L 要锁定用户名 锁定用户登陆
Usermod -U Usermod –U解锁用户名 解锁用户登陆
Usermod -u Usermod –u 501用户名 改变用户UID
Userdel Userdel–r 用户名 删除用户一切
Groupmod -n Groupmod –n新用户名 老用户名 为组改名
Groupmod -g Groupmod –g 501 组名 改变组GID
groupdel Groupdel组名 先应删它的用户 删除组
gpasswd -a gpasswd -a 用户名 组名 增加用户到组
help 是内部命令的帮助,比如cd命令
man 是外部命令的帮助,比如ls命令
环境变量
!!!一定要备份
执行前一定想想,有后手么
~代表你的/home/用户明目录
假设你的用户名是x,那么~/就是/home/x/
.是代表此目录本身,但是一般可以不写
所以cd ~/. 和cd ~ 和cd ~/效果是一样的
但是.后面有东西又是另外一个问题,点在文件名头部,代表一个隐藏文件
~/.local是你的主目录下一个.local的文件夹的路径,并且从.可以看出,这是一个饮藏文件,如果不用ls -a的话,一般ls是无法看到的
http://www.th7.cn/system/lin/201605/164198.shtml
http://www.cnblogs.com/imayi/p/6082122.html
临时设置
!!!当前terminal可用
export PATH=/opt/android-studio/bin:$PATH
________________________________________
当前用户的全局设置
vim ~/.profile,添加行:
export PATH=/opt/android-studio/bin:$PATH
使生效
source .profile
________________________________________
所有用户的全局设置
vim /etc/profile
在里面加入:
export PATH=/opt/android-studio/bin:$PATH
使生效
source /etc/profile
!!!设置完后要重启电脑
【Linux命令行与sheel脚本编程大全】S5
#printenv
#echo $HOME
#bash
#set
环境变量编写 !!注意空格 ,没有空格
#export
#unset 删除
Path目录之间用冒号 :分隔;一定注意追加和定义
Bash shell启动顺序
/etc/profile
$HOME/.bash_profile
$HOME/.bash_login
$HOME/.profile 隐藏文件 ls –a
HOME目录启动顺序
$HOME/.bash_profile
$HOME/.bash_login
$HOME/.profile
快捷键
新建terminal
Ctrl+Alt+T
Ctrl+shift+T
ALT + F4: 关闭窗口
ALT + TAB: 切换程序窗口
ALT + 空格: 打开窗口菜单
ALT + F1: 聚焦到桌面左侧任务导航栏,可按上下键导航
http://blog.csdn.net/lujianfeiccie2009/article/details/7521347
http://www.cnblogs.com/nucdy/p/5251659.html
远程调用Xshell,putty,Xmanager
选用一个协议,eg ssh, ip,user, pwd
桌面快捷方式
http://forum.ubuntu.org.cn/viewtopic.php?t=391282
软件安装
办公软件
WPS
http://jingyan.baidu.com/article/27fa73268547f746f8271f82.html
gdebi遇到apt无法安装的换 gdebi
https://my.oschina.net/johntostring/blog/668342
安装输入法
搜狗输入法
deb http://archive.ubuntukylin.com:10006/ubuntukylin trusty main
sudo apt-get update
sudo apt-get install sogoupinyin
http://www.linuxdiyf.com/linux/22075.html
fcitx
sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get install fcitx
sudo apt-get install fcitx-config-gtk
sudo apt-get install fcitx-table-all
sudo apt-get install im-switch
其他
sudo apt-get install vim
sudo apt-get install wps-office
sudo apt-get install vpnc git
sudo apt-get install axel
sudo apt-get install cmake qtcreator
sudo apt-get install exfat-fuse
sudo apt-get install lnav
sudo apt-get install unrar
sudo apt-get install openssh-server
清理软件
http://server.zol.com.cn/532/5325051_all.html
Sweeper
sudo apt-get install sweeper
BleachBit
sudo apt-get install bleachbit
Ubuntu Tweak
.GCleaner (beta)
工具安装
Java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer(此处环境包较大,如下载中途停止退出,重复执行即可)
环境变量,配置Java_home环境
#sudo apt-get install oracle-java8-set-default
#echo JAVA_HOME="/usr/lib/jvm/java-8-oracle" >> /etc/environment 【注意:用root,否则提示无权限!】
#source /etc/environment
校验安装
检查成功否
java -version
javac -version
Python
Python/Ipython
Python3.6 install
http://www.itnose.net/detail/6699257.html
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
xz -d Python-3.6.0.tar.xz
tar -xvf Python-3.6.0.tar
cd Python-3.6.0
./configure
make
sudo make install
pip3 install
http://outofmemory.cn/code-snippet/36001/python-pip-python3
python-pip默认是2.6版本的,如果要安装python3的需要通过下面的命令来安装:
$ sudo apt-get install python3-pip
安装python包的命令如下:
$ sudo pip3 install packagename
这里使用的命令是pip3,而非pip
http://lib.csdn.net/article/python/1214
pip/pip3,setuptool
sudo apt-get install python-setuptools
sudo apt-get install python3-setuptools
sudo apt-get install python-setuptools python-dev build-essential
sudo apt-get install python-dev
sudo apt-get install python3-dev
sudo apt-get install python-pip
pip3 install --upgrade pip
pip install --upgrade pip
ipython
sudo apt-get install ipython
sudo apt-get install ipython3
pip install "ipython[all]"
Notebook
sudo apt-get install ipython-notebook
sudo apt-get install ipython3-notebook
pip install notebook
pip3 install notebook
ipython notebook –pylab=inline
ipython3.5 notebook –pylab=inline
Traceback (most recent call last):
File "/usr/bin/ipython3", line 4, in <module>
from IPython import start_ipython
ModuleNotFoundError: No module named ‘IPython‘
pip install jupyter #用这个
jupyter notebook #能启动
qtconsole
sudo apt-get install ipython-qtconsole
sudo apt-get install ipython3-qtconsole
numpy
sudo esay_install numpy
sudo pip3 install numpy
matplotlib
sudo easy_install matplotlib
sudo pip3 install matplotlib
pandas
sudo easy_install pandas
sudo pip3 install pandas
virtualenv
sudo pip install --upgrade virtualenv
Pycharm
http://blog.csdn.net/apple9005/article/details/52900335
pip install --upgrade pip
java -version
sudo apt-get install oracle-java8-set-default
sudo tar -zxvf pycharm-community-5.0.1.tar.gz
sudo sh pycharm-community-2016.3.2/bin/pycharm.sh
平时使用启动pycharm,执行sudo sh pycharm-community-2016.3.2/bin/pycharm.sh
. /etc/profile
Oracle
http://blog.csdn.net/u010286751/article/details/51975741
/home/albert/tools/oracle11g/product/11.2.0/dbhome_1/bin/oracle
检查系统变量
检查完写本地,用excel分列提取下数值
/sbin/sysctl -a | grep sem >> Alb_orl_install.txt
/sbin/sysctl -a | grep shm >> Alb_orl_install.txt
/sbin/sysctl -a | grep file-max >> Alb_orl_install.txt
/sbin/sysctl -a | grep aio-max >> Alb_orl_install.txt
/sbin/sysctl -a | grep ip_local_port_range >> Alb_orl_install.txt
/sbin/sysctl -a | grep rmem_default >> Alb_orl_install.txt
/sbin/sysctl -a | grep rmem_max >> Alb_orl_install.txt
/sbin/sysctl -a | grep wmem_default >> Alb_orl_install.txt
/sbin/sysctl -a | grep wmem_max >> Alb_orl_install.txt
写文件 要有写权限,老文件得备份
fs.file-max = 809386
fs.aio-max-nr = 65536
kernel.shmall = 18446744073692774399
kernel.shmmax = 18446744073692774399
kernel.shmmni = 4096
kernel.sem = 32000 1024000000 500 32000
net.ipv4.ip_local_port_range = 32768 60999
net.core.rmem_default = 212992
net.core.rmem_max = 212992
net.core.wmem_default = 212992
net.core.wmem_max = 212992
执行
sysctl -p
/etc/security/limits.conf
albert soft nproc 2047
albert hard nproc 16384
albert soft nofile 1024
albert hard nofile 65536
albert soft stack 10240
同样检查/etc/pam.d/su,没有以下行就自己加上:
session required pam_limits.so
#oracle安装目录,创建的文件夹
export ORACLE_BASE=/home/albert/tools/oracle11g
#网上说可以随便写
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
#数据库的sid
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
#默认字符集
export NLS_LANG=.AL32UTF8
#环境变量
export PATH=${PATH}:${ORACLE_HOME}/bin/:$ORACLE_HOME/lib64;
整理
export ORACLE_BASE=/home/albert/tools/oracle11g
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export NLS_LANG=.AL32UTF8
export PATH=${PATH}:${ORACLE_HOME}/bin/:$ORACLE_HOME/lib64
检查下 HOME和BASE一定注意
$ORACLE_BASE
$ORACLE_HOME
$ORACLE_SID
$ORACLE_UNQNAME
$NLS_LANG
$PATH
mkdir /usr/lib64
8、欺骗oracle的安装程序
Oracle本身并不支持ubuntu来安装,所以要进行欺骗oracle的安装程序(sudo执行):
mkdir /usr/lib64
ln -s /etc /etc/rc.d
ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/basename /bin/basename
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/
ln -s /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib64/
本次加载路径
/mnt/hgfs/Share_to_linux/database$
执行安装执行文件
./runInstaller
-
al32utf8 /we8mswin1252 区别,查下
perform prerequisite checks,升级完版本比显示的高,跳过吧只能,向下兼容
apt-get install ia32-libs
lesstif-dev
lesstifg-dbg
lesstifg-dev
libmotif-dev。。。。。so on
Error
网上搜下一定要处理,
Oracle安装界面乱码解决方法
一、
Oracle安装界面乱码解决方法
执行:
exportNLS_LANG=AMERICAN_AMERICA.UTF8
export LC_ALL=C
二、
Error in invoking target ‘install’ of makefile
‘/home/XXX/tools/oracle11g/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk’.
See ‘/home/dong/tools/oraInventory/logs/installActions2015-01-22_09-39-03AM.log’ for details.
三、
Error in invoking target ‘agent nmhs’ of makefile
‘/home/XXX/tools/oracle11g/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk’
四、
Error in invoking target ‘all_no_orcl’ of makefile
‘/home/XXX/tools/oracle11g/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk’.
See ‘/home/dong/tools/Inventory/logs/installActions2016-03-19_02-37-44PM.log’ for details.
sed -i ‘s/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g‘ $ORACLE_HOME/network/lib/env_network.mk
sed -i ‘s/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g‘ $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i ‘s/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g‘ $ORACLE_HOME/bin/genorasdksh
sed -i ‘s/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g‘ $ORACLE_HOME/srvm/lib/ins_srvm.mk
环节变量改下
必须改,要不以后启动累死,还得不停加载
Pl/sql
1正常WIN安装,
2加插件包
3设置配置文件 tnsnames.ora
E:\Program Files (x86)\PLSQL Developer\instantclient_11_2\oci.dll
E:\app\OAlbert\product\11.2.0\dbhome_1
tnsnames.ora
# tnsnames.ora Network Configuration File: E:\app\OAlbert\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ALBERTTEST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =http://www.mamicode.com/
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =http://www.mamicode.com/
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =http://www.mamicode.com/
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ALBERTTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =http://www.mamicode.com/
(SERVER = DEDICATED)
(SERVICE_NAME = alberttest)
)
)
centostest=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = IP) (PORT = 1521))
(CONNECT_DATA =http://www.mamicode.com/
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ubuntu16.04_6=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = IP) (PORT = 1521))
(CONNECT_DATA =http://www.mamicode.com/
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
4本地远程链接 Ubuntu
http://jingyan.baidu.com/article/03b2f78c7a0ab75ea237ae33.html
netca
//配置监听器 --配置servicename
!!本地网络服务名配置也得做
使用ssh工具以root身份连接服务器,
然后切换到oracle用户:su - oracle(回车)
使用sqlplus连接数据库:sqlplus /nolog(回车)
以管理员身份登录sys用户:conn sys/sys as sysdba(回车)
select * from scott.bonus;
Mysql
http://www.linuxidc.com/Linux/2016-07/133091.htm
sudo apt-get install mysql-server
apt-get isntall mysql-client
apt-get install libmysqlclient-devsudo netstat -tap | grep mysql
netstat -tap | grep mysq
/etc/init.d/mysql restart
第一招、mysql服务的启动和停止
net stop mysql
net start mysql
Mysql 远程登录及常用命令
http://www.cnblogs.com/good_hans/archive/2010/03/29/1700046.html
MongoDB
http://blog.csdn.net/zhushh/article/details/52451441
.启动、重启和关闭命令
sudo service mongod start
sudo service mongod restart
sudo service mongod stop
进入:
mongo
MongoDB快速入门
http://www.yiibai.com/mongodb/mongodb_quick_guide.html
删除无用软件
eg:
sudo apt-get remove libreoffice-common
sudo apt-get remove unity-webapps-common
安装后要做的事
http://www.cnblogs.com/itlyh/p/6009705.html
Linux_Ubuntu16.04_Installation