#nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
#systemctl restart nginx
# 查看設定檔
$ ls /etc/netplan/
00-installer-config.yaml
$ cat 00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s3:
dhcp4: true
version: 2
$ sudo netplan try
Warning: Stopping systemd-networkd.service, but it can still be activated by:
systemd-networkd.socket
Do you want to keep these settings?
Press ENTER before the timeout to accept the new configuration
Changes will revert in 120 seconds
Configuration accepted.
測試無誤後就可以直接讓設定檔生效了:
$ sudo netplan apply
查看現況
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:bd:b7:dc brd ff:ff:ff:ff:ff:ff
inet 192.168.26.76/24 metric 100 brd 192.168.26.255 scope global dynamic enp0s3
valid_lft 531sec preferred_lft 531sec
inet6 fe80::a00:27ff:febd:b7dc/64 scope link
valid_lft forever preferred_lft forever
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode
Press <enter> to keep the current choice[*], or type selection number:
我輸入「4」,按下「Enter」。
aliok@ulab01:~$ rz Command 'rz' not found, but can be installed with: sudo apt install lrzsz
aliok@ulab01:~$ sudo apt install lrzsz [sudo] password for aliok: Sorry, try again. [sudo] password for aliok: Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: minicom The following NEW packages will be installed: lrzsz 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 74.8 kB of archives. After this operation, 531 kB of additional disk space will be used. Get:1 http://tw.archive.ubuntu.com/ubuntu focal/universe amd64 lrzsz amd64 0.12.21-10 [74.8 kB] Fetched 74.8 kB in 0s (303 kB/s) Selecting previously unselected package lrzsz. (Reading database ... 232559 files and directories currently installed.) Preparing to unpack .../lrzsz_0.12.21-10_amd64.deb ... Unpacking lrzsz (0.12.21-10) ... Setting up lrzsz (0.12.21-10) ... Processing triggers for man-db (2.9.1-1) ...