首页 > 系统相关 >Ubuntu系统部署后优化

Ubuntu系统部署后优化

时间:2022-08-17 17:12:08浏览次数:61  
标签:network 部署 sudo 192.168 etc Ubuntu 优化 addresses

Ubuntu系统配置调整


1、修改ip地址

sudo vi/etc/netplan/00-installer-config.yam
#This is the network config written by 'subiquity'
network:
    ethernets:
        ens33:
            dhcp4:true
    version:2


然后按i输入以下内容。设置为静态IP,以及IP地址,dns,网关

network:
    ethernets:
        ens33:
            addresses:
            - 192.168.11.100/24
            gateway4:192.168.11.2
            nameservers:
                addresses:
                - 192.168.11.2
                search:[]
    version:2

应用配置

sudo netplan apply

 

2、修改时区

sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date -R

 

3、系统优化

#修改文件描述符和进程数
sudo sed -i '/^# End of file/,$d' /etc/security/limits.conf
sudo sh -c "cat >> /etc/security/limits.conf <<EOF
# End of file
root - nproc 512000
* - nproc 512000
root - nofile 512000
* - nofile 512000
EOF"

#软件源替换成阿里云
sudo sed -i.bak 's/http:\/\/.*.ubuntu.com/http:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list

#更新
sudo apt update && sudo apt upgrade -y

#重启
reboot

 

标签:network,部署,sudo,192.168,etc,Ubuntu,优化,addresses
From: https://www.cnblogs.com/Magiclala/p/16595909.html

相关文章