Ubuntu操作系统的安装

Ubuntu Server版本安装

选择安装语言

在这里插入图片描述

安装界⾯传递内核参数

在这里插入图片描述

选择安装过程语⾔

在这里插入图片描述

地区设置

在这里插入图片描述

键盘选择

不进⾏探测,⼿动设置
在这里插入图片描述

选择键盘

在这里插入图片描述

键盘确认

在这里插入图片描述

配置主机名

在这里插入图片描述

创建新的普通系统⽤⼾

在这里插入图片描述

设置用户密码

在这里插入图片描述

确认用户密码

在这里插入图片描述

确认使用密码

在这里插入图片描述

自动分区

在这里插入图片描述

选择磁盘

在这里插入图片描述

确认写⼊磁盘

在这里插入图片描述

是否使⽤代理

在这里插入图片描述

系统安装过程

在这里插入图片描述

是否自动更新

在这里插入图片描述

选择安装组件

在这里插入图片描述

写⼊grub引导

在这里插入图片描述

确认重启服务器

在这里插入图片描述

系统安装完成

在这里插入图片描述

Ubuntu Server系统基础配置

更改主机名

root@xiaomao3:~# cat /etc/hostname
xiaomao3

更改网卡名称为eth*

root@xiaomao3:~# vim /etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
# 更新内核参数
root@xiaomao3:~# sudo update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-55-generic
Found initrd image: /boot/initrd.img-4.15.0-55-generic
done
root@xiaomao3:~# sudo reboot

配置静态ip地址

root@xiaomao3:~# cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.146.133/24]
      gateway4: 192.168.146.2
      nameservers:
              addresses: [223.6.6.6]
#重启网卡生效
root@xiaomao3:~# set paste
#查看地址是否生效
root@xiaomao3:~# ip add
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:89:22:2b brd ff:ff:ff:ff:ff:ff
    inet 192.168.146.133/24 brd 192.168.146.255 scope global eth0

配置root远程登录

root@xiaomao3:~# vim /etc/ssh/sshd_config
32 #PermitRootLogin prohibit-password #默认为禁⽌登录
33 PermitRootLogin yes #改为允许登录
57 #PasswordAuthentication yes
# 打开密码认证,其实默认就是允许通过密码认证登录
58 PasswordAuthentication yes 
~$ sudo su - root #切换到root⽤⼾环境
~# passwd #设置密码
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
~# systemctl restart sshd #重启ssh服务并测试root⽤⼾远程ssh连接

Ubuntu软件包管理

修改软件仓库

root@xiaomao3:~# vim /etc/apt/sources.list
root@xiaomao3:~# cat !$
cat /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#更新软件仓库
root@xiaomao3:~# apt update

apt/apt-get

# apt list #apt列出仓库软件包,等于yum list
# apt search NAME #搜索安装包
# apt show apache2 #查看某个安装包的详细信息
# apt install apache2 #在线安装软件包
# apt remove apache2 #卸载单个软件包但是保留配置⽂件
# apt autoremove apache2 #删除安装包并解决依赖关系
# apt update #更新本地软件包列表索引,修改了apt仓库后必须执⾏
# apt purge apache2 #卸载单个软件包删除配置⽂件
# apt upgrade #升级所有已安装且可升级到新版本的软件包
# apt full-upgrade #升级整个系统,必要时可以移除旧软件包。
# apt edit-sources #编辑source源⽂件
# apt-cache madison nginx #查看仓库中软件包有哪些版本可以安装
# apt install nginx=1.14.0-0ubuntu1.6 #安装软件包的时候指定安装具体的版本

安装系统常用命令

root@xiaomao3:~# apt purge ufw lxd lxd-client lxcfs lxc-common
root@xiaomao3:~# apt install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common   lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet  traceroute gcc openssh-server lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev  zlib1g-dev ntpdate tcpdump telnet traceroute iotop unzip zip
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值