# Ubuntu

# 1.中文支持

# 编码配置
dpkg-reconfigure locales

# 设置LC_ALL变量
export LC_ALL="en_US.UTF-8"
1
2
3
4
5

# 2.Mirror

中国科技技术大学镜像 (opens new window)

# 3.SSH

sudo apt install openssh-server
sudo systemctl status ssh
1
2

# 4.可选程序设置

ls /usr/bin/python*
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
sudo update-alternatives --config python
1
2
3
4

# 5.显示已安装软件

dpkg-l 
1

# 6.版本更新

apt-get -u dist-upgrade 版本更新
1

# 7.完全删除软件,并且不保留配置文件

apt-get --purge remove apache
1

# 8.搜索软件列表中搜索字符串

apt-cache search string 
1

# 9.配置时区

dpkg-reconfigure tzdata 配置时区
1

# 10.静态 IP

编辑 /etc/network/interfaces

 auto lo
  iface lo inet loopback

 auto eth0
  iface eth0 inet static
   address 192.168.50.129
   gateway 192.168.50.1
   netmask 255.255.255.0
   dns-nameservers 8.8.8.8 8.8.4.4

 auto eth0:0
  iface eth0:0 inet static
   address 192.168.50.156
   gateway 192.168.50.1
   netmask 255.255.255.0
   dns-nameservers 8.8.8.8 8.8.4.4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

重启服务

sudo systemctl restart networking
1
更新时间: 3/21/2024, 6:49:22 PM