• ubuntu server安装


    1安装Ubuntu server

    1.1 用win32diskimager制作启动U盘

    图1-1

    1.2安装

    1.2.1 弹出“Choose language”的“Choose a language”界面,选择“English”,按“Enter”键,如图2-1

    54d963d2a097b.jpg

    图 2-1

    1.2.2出现ubuntu界面选择“Install ubuntu Server”,按“Enter”键,如图2-2

    54d963d2b842e.jpg

    图 2-2

    1.2.3 出现“Select a language“界面,默认是English,直接回车即可

    54d963d2d0643.jpg

           图 2-3

    1.2.4 出现“Select your location”界面,默认选择“Hong Kong”,输入“Enter”键,如图2-4

    54d963d2e9ce0.jpg

    图 2-4

    1.2.5 出现“Detect keyboard layout”界面,默认选择“No”,输入“Enter”键,如图2-5

    54d963d30c924.jpg

    图 2-5

    1.2.6 出现“Origin of the keyboard”界面,默认选择“US”,输入“Enter”键,如图2-6

    54d963d323414.jpg

    图 2-6

    1.2.7 出现“keyboard layout”界面,默认选择“US”,输入“Enter”键,如图2-7

    54d963d338edb.jpg

    图 2-7

    1.2.8 系统开始扫描光盘,随后出现“configure the network”界面,系统提示选择“primary network interface”,选择第一个,输入“Enter”键,如图2-8

    54d963d350167.jpg

    图 2-8

    1.2.9 系统开始通过DHCP配置IP。如果需要手动配置网络,选择“Cancel”,输入“Enter”键继续,如图2-9

    54d963d367442.jpg

    图 2-9

    1.2.10 进入“Configure the network”界面,如果获取不到IP会提示“network autoconfiguration failed”,输入“Enter”键继续,如图2-10

    54d963d375cda.jpg

    图 2-10

    1.2.11 进入“Configure the network”界面,选择“Do not configure the network at this time”,输入“Enter”键继续,如图2-11

    54d963d385139.jpg

    图 2-11

    1.2.12 进入“Please enter the hostname for this system”界面,在文本框中输入hostname ,输入“Enter”键继续,如图2-12 

    54d963d3955e1.jpg

    图 2-12

    1.2.13 进入“Set up users and passwords”在Full name for the new user键入您想用的用户名,如图2-13

    54d963d3ad401.jpg

    图 2-13(1)

    54d963d3c4ec9.jpg

    图 2-13(2)

    1.2.14 给刚才创建的用户设置密码,及确认密码,如图2-14(1-4)

    54d963d3e1808.jpg

    图 2-14(1)

    54d963d3f4005.jpg

    图 2-14(2)

    54d963d416459.jpg

    图 2-14(3)

    54d963d429800.jpg

    图 2-14(4)

    1.2.15 系统开始检测硬盘和其他硬件,随后进入“Partition disks”界面,在“Partitioning method”中选择“Manual”,输入“Enter”键继续,如图2-15

    54d963d440aad.jpg

    图 2-15

    1.2.16 进入“Partition disks”界面,通过上下方向键,选中“FREE SPACE”,输入“Enter”键继续,如图2-16

    54d963d46ffb9.jpg

    图 2-16

    1.2.17 进入“Partition disks->create a new partition”界面,选中“create a new partition”,输入“Enter”键继续,如图2-17

    54d963d4856cf.jpg

    图 2-17

    1.2.18 进入“Partition disks->New Partition size”界面,在文本框中输入“80G”,输入“Enter”键继续,如图2-18

    54d963d49bdae.jpg

    图 2-18

    1.2.19 进入“Partition disks->type for the new partition”界面,选择“primary”,输入“Enter”键继续,如图2-20

    54d963d4af13c.jpg

    图 2-19

    1.2.20 进入“Partition disks->location for the new partition”界面,默认选择“beginning”,输入“Enter”键继续 如图2-20

    54d963d4c1cf4.jpg

    图 2-20

    1.2.21 进入“Partition disks->partition setting”界面,确认该分区是用作“/”,选择适合的文件系统类型,选择“Done setting up the partition”,输入“Enter”键继续,如图2-21

    54d963d4d93f7.jpg

    图 2-21

    1.2.22  进入“Partition disks”界面,通过上下方向键,选中“free space”,输入“Enter”键继续,如图2-22

    54d963d4efecc.jpg

    图 2-22

    1.2.23 进入“Partition disks->create a new partition”界面,选中“create a new partition”,输入“Enter”键继续,如图2-23

    54d963d5126f9.jpg

    图 2-23

    1.2.24 进入“Partition disks->New Partition size”界面,在文本框中输入“4G”,输入“Enter”键继续,如图2-24

    54d963d526285.jpg

    图 2-24

    1.2.25 进入“Partition disks->type for the new partition”界面,选择“primary”,输入“Enter”键继续,如图2-25

    54d963d53d120.jpg

    图 2-25

    1.2.26 进入“Partition disks->location for the new partition”界面,选择“beginning”,输入“Enter”键继续,如图2-26

    54d963d550c9a.jpg

    图 2-26

    1.2.27  进入“Partition disks->partition setting”界面,选择“use as”行,输入“Enter”键继续,如图2-27

    54d963d582544.jpg

    图 2-27

    1.2.28 进入“Partition disks->how to use the partition”界面,选择“swap area”,输入“Enter”键继续,如图2-28

    54d963d599fca.jpg

    图 2-28

    1.2.29  进入“Partition disks->partition setting”界面,确认该分区是用作“swap area”,选择“Done setting up the partition”,输入“Enter”键继续,如图2-29

    54d963d5b41c7.jpg

    图 2-29

    1.2.30  进入“Partition disks”界面,选择“Finish partitioning and write change to disks”,输入“Enter”键继续,如图2-30

    54d963d5c9924.jpg

    图 2-30

    1.2.31  进入“Partition disks->write the changes to disks”界面,选择“yes”,输入“Enter”键继续,如图2-31

    54d963d5e1385.jpg

    图 2-31

    1.2.32 系统开始格式化分区,然后开始安装“base system”,如图2-32

    54d963d6092c9.jpg

    图 2-32

    1.2.33 安装不需要通过代理访问网络,直接“Continue”,如图2-33

    54d963d61e9d2.jpg

    图 2-33

    1.2.34  Configuring tasksel 选择第一项不自动升级更新系统,如图2-34

    54d963d6348c9.jpg

    图 2-34

    1.2.35 按需求选择要安装的包,然后用Tab键切换到‘Continue‘按回车继续下一步,如图2.35

    54d963d64b7d2.jpg

    图 2-35

    1.2.36 系统正在进行安装,如图2-36

    54d963d661297.jpg

    图 2-36

    1.2.37 提示是否安装grub到硬盘引导分区,选择‘Yes‘后回车继续下一步,如图2-37

    54d963d6769ad.jpg

    图 2-37

    1.2.38 安装结束,按Continue后机器会重启,之后可以用刚才创建的用户密码登陆系统,如图2-38

    54d963d68bcdb.jpg

    图 2-38

    1无线网络配置

    1.1生成无线上网密码配置文件

    sudo wpa_passphrase SSID SSID_PASS > /etc/wpa_config.conf

    //其中 SSID是无线网络的SID, 如TP-LINK_123, SSID_PASS是在无线路由器上的密码

    1.2修改网络接口配置文件,设置wlan0接口

    sudo vim /etc/network/interfaces
    auto wlan0 iface wlan0 inet dhcp
    //注意在无线路由器上开启DHCP功能 wpa-conf /etc/wpa_config.conf

    需要保留如下内容:

    auto lo
    iface lo inet loopback

    否则,网卡会起不来,(GUI中)打开网络设置工具,报错如下:“the system network service is not compatible with this version”

    解决方案:检查文件 /etc/network/interfaces,看里面是否包含上面的语句,没有则加上。

    然后启动network manage 服务:

    sudo service network-manager start

    1.3重启

    sudo reboot

    1.4 开机延时过大问题

    做过上述修改后,且reboot后,开解延时会很大。出现“waiting for network configuration”的字样后,等待1分多钟。

    sudo vim /etc/init/failsafe.conf

    将第一个sleep从20秒改成5秒

        # The point here is to wait for 2 minutes before forcibly booting
        # the system. Anything that is in an "or" condition with 'started
        # failsafe' in rc-sysinit deserves consideration for mentioning in
        # these messages. currently only static-network-up counts for that.

            sleep 5

    把下面的语句都注释掉
     #$PLYMOUTH message --text="Waiting for network configuration..." || :
       #sleep 40

       #$PLYMOUTH message --text="Waiting up to 60 more seconds for network configuration..." || :
       #sleep 59
    最大的延时就是上面的59秒。

    上面第一点应该可以添加dhcp或static的配置,延时应该是第二点造成的,但我在设备上没有全面测试过。有一台服务器是使用dhcp的,但它一直连接网络,所以也不有这个问题。有一次换另外一个板子,发现进行上面的修改后,系统启动时还是会有Waiting for network configuration,而且卡死了,非重启不是恢复。暂时不知道是什么原因。特此说明一下。

     1.5 不能用apt-get问题

    解决方法:

    1.5.1 将/var/lib/apt/lists/partial/下的所有文件删除,但是这可以解决大部分问题,个别源不能解决。

    1.5.2 在etc/apt/sources.list中加入下列源:

    deb http://old-releases.ubuntu.com/ubuntu/ natty main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ natty-security main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ natty-updates main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ natty-proposed main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ natty main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ natty-security main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ natty-updates main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ natty-proposed main restricted universe multiverse
    deb-src http://old-releases.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse

    2图像界面

    2.1安装openbox

    sudo apt-get install xorg
    
    sudo apt-get install openbox

    2.2开机启动openbox

    在/etc/rc.local中添加启动openbox的命令

    /usr/bin/startx

    3 更换软件源

    3.1.备份一下Ubuntu 原来的源地址列表文件

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.old

    3.2.修改源地址

    sudo sed -i 's/cn.archive.ubuntu.com/mirrors.163.com/g' /etc/apt/sources.list

    3.3.更新

     sudo apt-get update

     

    4.自动登录tty1

    4.1.写脚本autologin

    代码:
    #!/bin/bash
    /bin/login -f #你的用户名

    移动到/usr/bin/下,并且用chmod +x autologin设置可执行权限

    4.2.修改/etc/init/tty1.conf

    修改前:

    # tty1 - getty
    #
    # This service maintains a getty on tty1 from the point the system is
    # started until it is shut down again.
    
    start on stopped rc RUNLEVEL=[2345]
    stop on runlevel [!2345]
    
    respawn
    exec /sbin/getty -8 38400 tty1

    修改后:

    # tty1 - getty
    #
    # This service maintains a getty on tty1 from the point the system is
    # started until it is shut down again.
    
    start on stopped rc RUNLEVEL=[2345]
    stop on runlevel [!2345]
    
    respawn
    exec /sbin/getty -n -l /usr/bin/autologin -8 38400 tty1

    5 配置lxterminal终端

    5.1安装terminator

    sudo apt-get install terminator

    5.2替换终端

    有 5 个候选项可用于替换 x-terminal-emulator
    sudo update-alternatives --config x-terminal-emulator

    参考:

    【1】http://www.cnblogs.com/qxfan/p/6210881.html
    【2】http://www.2cto.com/os/201511/450050.html
    【3】https://help.ubuntu.com/community/ServerGUI
    【4】http://blog.csdn.net/hbuxiaofei/article/details/50721429
    【5】http://blog.chinaunix.net/uid-94449-id-2002624.html
    【6】http://www.jb51.net/os/Ubuntu/461806.html
    【7】http://blog.csdn.net/subfate/article/details/40990341
  • 相关阅读:
    opentsdb安装部署
    python发送邮件(html)例子
    python查库写库例子
    获取rds的cpu和内存使用情况
    数据库损坏的情况下如何获取到dbid
    grafana安装升级部署
    Specified key was too long
    mysql动态执行sql批量删除数据
    kafka删除topics
    cratedb导入json文件
  • 原文地址:https://www.cnblogs.com/ziyu-trip/p/6645177.html
Copyright © 2020-2023  润新知