Article guide directory
1. Installation of Ubuntu system
After reading this article, you will have a basic understanding of the installation of the Ubuntu virtual machine and some basic related configurations, be able to access the Internet, and also understand some basic operating commands. Thank you for reading, I hope we can make progress together.
(1) Download of Ubuntu image file
Here I installed the Ubuntu 18.04 version. It is not necessary to install the latest version if you are learning to use it. Generally speaking, it is recommended to install the next-new version. The second-new version is relatively more stable and there are more resources and help groups that can be found online, which is convenient for us Learn more efficiently. We can go to the official website to download the image file of Ubuntu 18.04. Of course, if downloading from the official website is troublesome and the download speed is slow, I can also share the link of the network disk, and everyone can download it.
Official website link: https://releases.ubuntu.com/18.04/
Baidu network disk: https://pan.baidu.com/s/1J46TOKrqFmyYR0q5VkOupQ
Extraction code: tujj
(2) Vmware creates a new virtual machine
(1) Click to create a new virtual machine
(2) Select Custom Advanced and click Next
(3) Click Next by default
(3) Click here to install the system later, and click Next
(4) Select Linux here, and select Ubuntu64-bit (for 32-bit, just select Ubuntu directly), and click Next.
(5) Choose the installation path. Personally, it is not recommended to install it on the c drive. Try to create a new folder in other drives, which is also convenient for related management later. Then click Next.
(6) For learning, 2 cores are enough. Of course, you can also choose by yourself. It cannot exceed the total number of cores of the physical machine. If you choose randomly, the impact will not be great. Click Next.
(7) This is also ok by default, and the impact is not particularly large. If you choose here, it should not exceed the memory of the physical machine. Click Next.
(8) Here, just choose network address translation. Through the ip of the physical machine to access the Internet, the static ip address configuration of Ubuntu can be realized, which is also convenient for ssh later. Other network types will not be explained one by one. Click Next.
(9) After that, the next step is always the default. The following memory is allocated according to the actual situation of the physical machine, try not to be lower than what it recommends, here I choose 60G, and choose to split the virtual disk into multiple files. Click Next.
(10) The following steps are always the default. Click Edit Virtual Machine Settings.
(11) Select CD/DVD (SATA) to use the iso image file, and find the location of the previously downloaded Ubuntu image file.
(12) Then click to start this virtual machine.
(13) After that, press Enter by default. Here you can change the software source, because Ubuntu defaults to a foreign source, which is very slow, you can change it to Ali source, Tsinghua source, etc., and then I will explain how to replace the source. Alibaba Cloud (http://morrors.aliyun.com/ubuntu/)
(14) After that, just keep doing it. Set the user name and password. Keep the password as simple as possible during the learning phase. It will be troublesome if you forget it.
(15) Check the space to install Openssh Server, which is convenient for remote management. When an × appears in front of it, it means it is checked.
(16) These are not downloaded for the time being, and they will be downloaded later, press Enter Done.
After the installation is complete, wait for the progress to complete and restart according to the prompts. It will take different time depending on the configuration of the computer. Please wait patiently, thank you.
2. Common operating commands under Ubuntu system
(1) Software update and installation
sudo apt-get install package //安装软件安装包
sudo apt-get remove package //删除软件安装包
sudo apt update
sudo apt upgrade //软件包更新
(2) Some shortcut keys under the Ubuntu terminal
hot key | meaning |
---|---|
ctrl + shift + c | copy |
ctrl + shift + v | paste |
ctrl + alt + T | open new terminal |
ctrl + shift + T | Open a new terminal under the current terminal |
(3) Directory switching under the Ubuntu system
cd corresponding directory
Note: Under Linux, both directory and file name are case-sensitive, pay attention to the distinction between case and case
Order | meaning |
---|---|
d / | switch to the root directory |
cd . | Keep the current directory unchanged |
cd . . | Switch to the previous directory |
cd ~ | Switch to the current user's home directory |
cd /user | Switch to the user directory under the root directory |
(4) Related operations on directories or files under Ubuntu system
mkdirrelated catalog
mkdir myself //当前目录创建一个名字为myself的目录
mkdir /usr/myself //指定目录下创建一个myself目录
rm [-rf]Directories
Note: Deletion after using rm cannot be recovered, please use with caution
rm 文件名 //删除当前目录下文件
rm -f 文件名 //强制删除当前目录下的文件(没有提示消息)
rm -rf * //当前目录下所有目录和文件都删除(没有提示消息)
rm -rf /* //根目录下的所有文件都删除(谨慎使用!!!)
Order:touchfilename
Create a blank file
touch text.txt //当前目录下创建一个名为text.txt的文件
Order:rm -rfFile
Delete the files under the directory, the operation of the above directory is the same
3. Regarding the replacement of the image source of the Ubuntu system just installed
As mentioned before in the installation of Ubuntu, you can change the image source when installing the software, because the default software image source is foreign when Ubuntu is just downloaded, and the speed will be very slow and inconvenient. There are many useful image sources in China that can be replaced, so in order to facilitate learning and use, we can still replace the image source.
Of course, there are also many who didn’t pay attention to it when they just downloaded it, and didn’t change the source in time, and they can also change it later. Next, I will say that this is based on the Ubuntu 18.04 version.
sudo su //进入root,再次输入密码就可以
vim /etc/apt/sources.list //编辑改目录下的sources.list文件,这个是镜像文件
1. Here is my updated Ali source
2. Enter i, edit the file, paste the corresponding image file (the corresponding image file will be provided later, just copy and paste), then press esc to launch, and then enter:wqEnter
input the command:sudo apt update//Update the software source, the software source has been replaced
Tsinghua source (Ubuntu18.04)
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
Ali source (Ubuntu18.04)
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
China Science and Technology Dayuan (Ubuntu18.04)
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
## Not recommended
# deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse