美文网首页
ubuntu20.04初始化的部分操作

ubuntu20.04初始化的部分操作

作者: tinychen | 来源:发表于2021-01-06 20:43 被阅读0次
    image

    本文主要讲解在ubuntu20.04系统安装后需要进行的一些初始化事项。

    1、安装ssh服务

    # ubuntu默认情况下需要自己安装ssh服务
    sudo apt install openssl-server
    

    2、更换镜像源(清华)

    参考的官方链接,Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用 TUNA 的软件源镜像。

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    
    # 预发布软件源,不建议启用
    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
    

    3、防火墙

    # 禁用防火墙
    tinychen@tiny-server:~$ sudo ufw disable
    Firewall stopped and disabled on system startup
    

    4、禁用IPv6

    echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf
    echo "net.ipv6.conf.default.disable_ipv6=1" >> /etc/sysctl.conf
    echo "net.ipv6.conf.lo.disable_ipv6=1" >> /etc/sysctl.conf
    sudo sysctl -p
    

    5、安装nvidia显卡驱动

    # 查看显卡型号和推荐安装的驱动
    tinychen@tiny-server:~$ ubuntu-drivers devices
    == /sys/devices/pci0000:00/0000:00:1c.7/0000:08:00.0 ==
    modalias : pci:v000010DEd00000A66sv00001B0Asd00009060bc03sc00i00
    vendor   : NVIDIA Corporation
    model    : GT218 [GeForce 310]
    driver   : nvidia-340 - distro non-free recommended
    driver   : xserver-xorg-video-nouveau - distro free builtin
    
    # 自动安装默认推荐的驱动
    tinychen@tiny-server:~$ sudo ubuntu-drivers autoinstall
    [sudo] password for tinychen:
    

    相关文章

      网友评论

          本文标题:ubuntu20.04初始化的部分操作

          本文链接:https://www.haomeiwen.com/subject/nimooktx.html