[TOC]
参考
- ubuntu清除多余内核
-
安装Ubuntu 16.04后要做的事
ubuntu mysql安装与配置 - Ubuntu 16.04 安装mysql并设置远程访问
- mysql5.7 windows7编码统一utf-8
- Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录
首先精简系统
删除libreoffice、删除Amazon的链接、删掉基本不用的自带软件
sudo apt-get remove libreoffice-common
sudo apt-get remove unity-webapps-common
sudo apt-get remove thunderbird totem rhythmbox empathy brasero simple-scan gnome-mahjongg aisleriot gnome-mines cheese transmission-common gnome-orca webbrowser-app gnome-sudoku landscape-client-ui-insta
网络设置
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface inet static
address ens33 6.0.0.68
netmask 255.255.255.0
gateway 6.0.0.2
dns-nameservers 6.0.0.2
auto ens34
iface ens34 inet static
address 192.168.192.68
netmask 255.255.255.0
gateway 192.168.192.2
dns-nameservers 192.168.192.2
openssh允许root远程登陆
vim /etc/ssh/sshd_config
[#]Authentication:
LoginGraceTime 120
PermitRootLogin yes -->改成yes
StrictModes yes
添加中文输入法
sudo apt-get install language-selector language-env language-pack-zh-hans
sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4
sudo apt-get install ibus ibus-clutter ibus-gtk ibus-qt4
ubuntu以及衍生版系统如何寻找软件缓存
linux系统默认文件下载位置在/var/cache/apt/archives文件夹下。
ubuntu16.04lts (xenial)安装源
deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
ubuntu14.04源
网易
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
Ubuntu本地软件源制作
sudo apt-get install dpkg-dev
mkdir ~/software
cp -R -v /var/cache/apt/archives/* ~/software
sudo dpkg-scanpackages ~/software /dev/null | gzip >~/software/Packages.gz
编辑/etc/apt/source.list文件
deb file:/home/ubuntu/software ./
更新apt依赖关系
apt-get update && apt-get dist-upgrade
安装软件
关闭bug报告
hadoop@hadoop:~$ sudo vi /etc/default/apport
hadoop@hadoop:~$ cat /etc/default/apport
# set this to 0 to disable apport, or to 1 to enable it
# you can temporarily override this with
# sudo service apport start force_start=1
enabled=0
Ubuntu更新设置
/etc/apt/apt.conf.d/50unattended-upgrades 只需要注释不选择的更新即可
// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
// "${distro_id}:${distro_codename}-security";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};
// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
临时变量设置(以ADMIN_PASS为例)
export ADMIN_PASS=$(openssl rand -hex 10)
Ubuntus16.04 查看网卡名(ubuntu16.04好像网卡名字不再是eth0 eth1了) ,如下图ens33 ens34即为网卡的名字
root@hadoop:/etc/udev/rules.d# lshw -C network
*-network:0
description: Ethernet interface
product: 82545EM Gigabit Ethernet Controller (Copper)
vendor: Intel Corporation
physical id: 1
bus info: pci@0000:02:01.0
logical name: ens33
version: 01
serial: 00:0c:29:16:c2:f3
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100
bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI d
uplex=full ip=6.0.0.10 latency=0 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s resources: irq:19 memory:fd5c0000-fd5dffff memory:fdff0000-fdffffff ioport:2000(size=64) me
mory:fd500000-fd50ffff *-network:1 DISABLED
description: Ethernet interface
product: 82545EM Gigabit Ethernet Controller (Copper)
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:02:02.0
logical name: ens34
version: 01
serial: 00:0c:29:16:c2:fd
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100
bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI d
uplex=full latency=0 link=no mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s resources: irq:16 memory:fd5a0000-fd5bffff memory:fdfe0000-fdfeffff ioport:2040(size=64) me
mory:fd510000-fd51ffff
Ubuntu16.04 安装时选择LAMP环境,安装完成后如下配置
- 查看apache版本
root@hadoop:/etc/mysql/mysql.conf.d# apachectl -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-07-14T12:32:26
- 允许mysql root远程访问
- 注释/etc/mysql/mysql.conf/mysqld.cnf中的bind-address
[mysqld]
...
#bind-address = 127.0.0.1
- 登录mysql修改权限表
登录到mysql服务器,使用grant命令分配权限
mysql> grant all on database_name.* to user_name@'%' identified by 'user_password';
其中database_name、user_name和user_password根据实际情况设置。