前言
- 此记录为Linux的一个调教记录,方便以后查看
基本篇
设置软件源
- 由于Ubuntu自带的源是国外的,所以同步的时候会比较慢。因此一般都需要修改源。由于Ubuntu自带gedit,所以就不用vi来编辑了。
sudo gedit /etc/apt/sources.list
然后注释原来的源。添加阿里的源。
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
因为以后需要添加Deepin的软件。所以多添加一个deepin的源。
deb http://packages.deepin.com/deepin stable main contrib non-free
#deb-src http://packages.deepin.com/deepin stable main contrib non-free
添加完成后保存退出。
sudo apt update
等待更新完成。
环境篇
- 由于大部分的环境能直接apt安装。我就不自己配置了。
Java
以下是apt支持的Java版本。直接输入后就能安装了(注:是openjdk不是Hotpot的JDK)。
sudo apt install default-jre # version 2:1.11-72, or
sudo apt install openjdk-11-jre-headless # version 11.0.7+10-3ubuntu1
sudo apt install openjdk-13-jre-headless # version 13.0.3+3-1ubuntu2
sudo apt install openjdk-14-jre-headless # version 14.0.1+7-1ubuntu1
sudo apt install openjdk-8-jre-headless # version 8u252-b09-1ubuntu1
Mysql
终端中输入命令:
sudo apt install mysql-server
Mysql的常见路径
/usr/bin 客户端程序和脚本
/usr/sbin mysqld 服务器
/var/lib/mysql 日志文件,数据库 [重点要知道这个]
/usr/share/doc/packages 文档
/usr/include/mysql 包含( 头) 文件
/usr/lib/mysql 库
/usr/share/mysql 错误消息和字符集文件
/usr/share/sql-bench 基准程序
无法访问
- 出现类似
ERROR 1045 (28000): Access denied for user 'gloduck'@'localhost' (using password: NO)
的提示。一是设置密码(默认没有密码),二是跳过密码验证
跳过密码验证:
进入配置文件
sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]下添加skip-grant-tables
#
# The MySQL database server configuration file.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
[mysqld]
skip-grant-tables
#
# * Basic Settings
#
user = mysql
# pid-file = /var/run/mysqld/mysqld.pid
# socket = /var/run/mysqld/mysqld.sock
# port = 3306
# datadir = /var/lib/mysql
# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size = 16M
# max_allowed_packet = 64M
# thread_stack = 256K
# thread_cache_size = -1
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
# max_connections = 151
# table_open_cache = 4000
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
#
# Log all queries
# Be aware that this log type is a performance killer.
# general_log_file = /var/log/mysql/query.log
# general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
# slow_query_log = 1
# slow_query_log_file = /var/log/mysql/mysql-slow.log
# long_query_time = 2
# log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
# server-id = 1
# log_bin = /var/log/mysql/mysql-bin.log
# binlog_expire_logs_seconds = 2592000
max_binlog_size = 100M
# binlog_do_db = include_database_name
# binlog_ignore_db = include_database_name
重启mysql
sudo service mysql stop
<!-- more -->
sudo service mysql start
Redis
终端输入命令:
sudo apt install redis-server
通过redis-cli
进入
常用软件
v2ray
v2核心:https://github.com/v2fly/v2ray-core
v2GUI:https://github.com/Qv2ray/Qv2ray/releases
深度截图
注:需要先添加deepin源
sudo apt install deepin-screenshot
添加快捷键:设置 - 键盘快捷键 - +(最下面)
QQ、TIM、微信、迅雷、百度网盘
注:需先添加deepin源
- 包名:
- TIM:deepin.com.qq.office
- QQ:deepin.com.qq.im
- QQ轻聊版:deepin.com.qq.im.light
- 微信:deepin.com.wechat
- 百度网盘:deepin.com.baidu.pan
- 迅雷极速版:deepin.com.thunderspeed
- WinRAR:deepin.cn.com.winrar
sudo apt install 包名
更新
软件一般安装在/home/gloduck/.deepinwine
如百度网盘,进入/home/gloduck/.deepinwine/Deepin-BaiduNetDisk/drive_c/Program Files/baidu/BaiduNetdisk
,然后在Windows下安装最新版本覆盖。
Tim无法加载图片
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
添加小图标
下载chrome-gnome-shell
sudo apt-get install chrome-gnome-shell
在chrome应用商店搜索并安装 GNOME Shell integration
接着跳转到此网页
将右上角的off按钮切换为on
在Installed extensions页面应用该扩展
Idea
- 下载Idea:https://www.jetbrains.com/idea/download/
- 解压到指定路径(推荐opt)。
- 为
bin/idea.sh
创建快捷方式
导出配置
配置直接导出然后导入。
插件:
+ 进入Idea路径。
+ windows:C://Users/Gloduck/AppData/Roaming/JetBrains/IntelliJIdea2020.2/plugins
+ 复制文件到:/home/gloduck/.local/share/JetBrains/IntelliJIdea2020.3
(注:没有plugins,直接复制)
常用操作
root打开文件夹:
sudo nautilus
创建桌面图标
touch 图标名称.desktop
sudo gedit 图标名称.desktop
然后复制以下内容:
[Desktop Entry]
Encoding=UTF-8
Name=应用名称
Comment=应用描述
Exec=应用执行文件
Icon=应用图标
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development; // 应用分类
然后将图标移动到/usr/share/applications
文件夹下
sudo mv 图标名称.desktop /usr/share/applications
文件管理器输入路径
按下Ctrl+L
root打开文件夹
安装nautilus-admin
sudo apt install nautilus-admin