system
It's not very convenient to use ubuntu, so I wanted to install a black apple to use it, but it didn't install it after two or three days. I couldn't reinstall ubuntu again, and then restarted the environment. Some problems, although the black apple did not pretend to be, but after this toss, I have a better understanding of ubuntu.
Question about ubuntu download source
Problems installing some software
For these two kinds of errors, after searching on the Internet, I found that it was the problem of the download source. Of course, the solution was to switch the download source. At the beginning, I only encountered the first error. I thought it was because of the proxy problem. Experience, the second error report is very clear, and it is natural to think that it is the problem of downloading the source, and it is very easy to solve.
Switch download source
Decide that the ubuntu download source file is /etc/apt/sources.list
To modify the download source, you can directly modify the content of sources.list
Remember to back up before modifying, execute
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
After the backup, you can directly use vim to modify
sudo vim sources.list
Modify complete save and exit
Then execute the following command to make the changes take effect
sudo apt-get update
sudo apt-get upgrade
# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
If it still doesn't work after modification, try a few more modifications.
You can create several more files and store different sources separately for easy switching
ubuntu create shortcut
I used to foolishly thought that some ubuntu applications did not have shortcuts, so they could only be started through commands. After reinstalling the system, reinstalling webstorm and reading an article did not know that you can create shortcuts yourself.
Briefly introduce webstorm and IDEA to create shortcuts. These two will definitely be used in the future. Different applications may not be the same, but these two applications are the same.
First, unzip the downloaded installation file and move it to the /opt file
implement
sudo mv 文件名 文件地址
to complete the file movement
Note that you cannot directly copy and paste due to permission issues
Then create webstorm.desktop under /usr/share/applications
Add the following code to webstorm.desktop
[Desktop Entry]
Name = WebStorm
Comment = WebStorm
Icon= /opt/WebStorm-213.6461.79/bin/webstorm.png
Terminal=false
Type=Application
For IDEA, the method is the same, just modify the file name and the name in the code accordingly.
Note that WebStorm-213.6461.79 downloads the decompressed file name for yourself, it may be different
Briefly explain
Exec = /opt/WebStorm-213.6461.79/bin/webstorm.sh
Description of the application's startup file
Icon= /opt/WebStorm-213.6461.79/bin/webstorm.png
Image illustrating the shortcut
Not all applications are applicable to the above code, you can check it online according to your needs
Problems encountered in learning springboot
first question
Solution
Configure the thymeleaf engine dependencies in the pom.xml file:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
second question
Problems linking to the database
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driver-class-name
Value: com.mysql.cj.jdbc.Driver
Origin: "driverClassName" from property source "source"
Reason: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
Then after looking it up online, I found that someone had the same problem as me
Adding the above code to pom.xml solves the problem.
pom.xml is similar to package.json in angular, it declares the packages required by the project, and then maven downloads the corresponding packages according to this file. maven is similar to angular's npm.
There are also some small problems caused by carelessness
For sql statement understanding
I didn't learn sql statements when I was learning thinkphp at that time. I copied and pasted the code for building the database given in the tutorial. When I built the table myself, I also modified the existing code directly. I didn't understand the meaning at all, or I directly Edit the table on navicat.
Although after studying the tutorial in the future, I found that the sql statement is basically useless, but it is still necessary to take a look
SET NAMES utf8mb4; ➊
SET FOREIGN_KEY_CHECKS = 0; ➋
-- ---------------------------- ➌
-- Table structure for teacher ➌
-- ---------------------------- ➌
DROP TABLE IF EXISTS `teacher`; ➍
CREATE TABLE `teacher` ( ➎
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT, ➏
`name` varchar(255) DEFAULT '' COMMENT '姓名', ➐
`sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0男,1女',
`username` varchar(255) NOT NULL COMMENT '用户名',
`email` varchar(255) DEFAULT '' COMMENT '邮箱',
`create_time` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`), ➑
UNIQUE KEY `nx1HkMqiUveGnJz5lHE7mEcFI5WVew3iXbv3HCwF` (`username`) USING BTREE ➒
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; ➓
-- ---------------------------- ➌
-- Records of teacher ➌
-- ---------------------------- ➌
BEGIN; ➊➋
INSERT INTO `teacher` VALUES (1, '张三', 0, 'zhangsan', 'zhangsan@mail.com', 1569721598000, 1569721598000); ➊➌
INSERT INTO `teacher` VALUES (2, '李四', 0, 'lisi', 'lisi@yunzhi.club', 1569721598000, 1569721598000);
COMMIT; ➊➍
SET FOREIGN_KEY_CHECKS = 1; ➊➎
➊ Set the encoding to utf8mb4
➋ Turn off foreign key checking
➌ Comment content
➍ If the table exists, delete the old table
➎ Create data table
➏ Create an int type field, display length is 11, unsigned number, null is not allowed, and the field is automatically added
➐ Create a varchar variable-length string type field with a maximum length of 255
➑ Declare the primary key
➒ Set a UNIQUE index on the username field
➓ Set the engine to InnoDB, the auto increment to 3, and the default character encoding to utf8mb4
➊➋ Open Transaction
➊➌ Insert data
➊➍ Commit transaction
➊➎ Enable foreign key check
Summarize
I wasted too much time tossing the system, but I didn't get anything. I started ubuntu again from scratch. I have a better understanding of Ubuntu. Now I find that Ubuntu is not easy to use, but I don't know how to use it.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。