# ubuntu **Repository Path**: SeeDeer/ubuntu ## Basic Information - **Project Name**: ubuntu - **Description**: 记录基于linux的发行版ubuntu的桌面系统使用说明 - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-06-04 - **Last Updated**: 2021-02-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ubuntu ## Description 记录基于linux的发行版ubuntu的桌面系统使用说明 ### 1. 下载源替换为阿里源 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak sudo gedit /etc/apt/sources.list 删除原有内容,添加如下 ```shell 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-src http://mirrors.aliyun.com/ubuntu/ bionic-backports 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 ``` 保存~ sudo apt-get update ### 2. 配置和宿主机可以互相复制文件 sudo apt-get install open-vm-tools open-vm-tools-desktop sudo apt-get install -f reboot ### 3. 搜狗输入法安装配置 1. 下载.deb安装包 && 安装 浏览器打开 https://pinyin.sogou.com/linux/ sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb sudo apt-get install -f sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb 2. 配置 Settings -> Region & Language->Manage Installed Languages Keyboard input method system 选择 fcitx 重启Ubuntu,软件应用里搜索 Fcitx Configuration 新增Sogou Pinyin即可,默认切换方式为 Ctrl + Space按键 ### 4. 安装Google浏览器 sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.list.d/ wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sudo apt-get update sudo apt-get install google-chrome-stable ### 5. Visual Studio Code安装配置 1. 下载.deb安装包 && 安装 浏览器打开 https://code.visualstudio.com/Download sudo dpkg -i *.deb 2. 常用插件名称 Chinese (Simplified) Language Pack Markdown Preview Enhanced C/C++ PlantUML (依赖java环境和sudo apt-get install graphviz) ### 6. 常用依赖库及工具安装 sudo apt-get install lib32ncurses5 lib32z1 sudo apt install make-guile gcc g++ net-tools python3 gawk vim git tree rar sudo apt-get install libtool autoconf pkg-config ### 7. 交叉编译器环境变量配置 将下载好的交叉编译器工具包复制到/opt目录下 sudo gedit /etc/profile 新增一行,把交叉编译器路径加到环境变量PATH export PATH=/opt/toolchain/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH 执行如下命令,可使当前shell窗口生效,重启后系统生效 source /etc/profile ### 8. 系统优化工具 Stacer基于Qt5开发,功能类似windows下的CCleaner,方便好用! https://github.com/oguzhaninan/Stacer.git 小技巧:Ubuntu虚拟机和宿主机互相复制文件时,vmware都会生成缓存文件,好像不能自动清除 cd ~/.cache/vmware/drag_and_drop du -d 1 -h # 按文件大小排序查看 这个文件通常很大,通过Stacer工具,扫描系统垃圾,在应用缓存里可以找到并清除。 ### GTK GTK或GIMP Toolkit是一个用于创建图形用户界面的多平台工具包。GTK提供一整套小部件,适用于从小型一次性工具到完整应用程序套件的项目。 ### st-link工具在Ubuntu下使用 1. 开源代码:https://github.com/texane/stlink.git 2. 依赖库安装 sudo apt-get install libusb-dev libusb-1.0-0-dev libgtk-3-dev 3. 编译安装 /opt/stlink$ sudo make release /opt/stlink$ cd build/Release/ /opt/stlink/build/Release$ sudo make install 4. 检查安装是否生效 $ st-flash st-flash: error while loading shared libraries: libstlink.so.1: cannot open shared object file: No such file or directory 上述错误需要使用该命令更新动态库缓存ldconfig 5. 常用命令用法 ### 调试器openocd驱动安装 说明:此开源驱动比较diao,几乎支持市场上所有的主流驱动调试器,ST-LINK JLINK 它可以作为GDBServer,从而方便了我们使用GDB进行调试 需要安装的依赖库 sudo apt-get install libusb-dev libusb-1.0-0-dev libgtk-3-dev libtool autoconf pkg-config texinfo https://github.com/ntfreak/openocd.git ./configure 如下配置成功后,可以看到默认支持的调试器型号之多 ```shell OpenOCD configuration summary -------------------------------------------------- MPSSE mode of FTDI based devices yes (auto) ST-Link JTAG Programmer yes (auto) TI ICDI JTAG Programmer yes (auto) Keil ULINK JTAG Programmer yes (auto) Altera USB-Blaster II Compatible yes (auto) Bitbang mode of FT232R based devices yes (auto) Versaloon-Link JTAG Programmer yes (auto) TI XDS110 Debug Probe yes (auto) OSBDM (JTAG only) Programmer yes (auto) eStick/opendous JTAG Programmer yes (auto) Andes JTAG Programmer yes (auto) USBProg JTAG Programmer yes (auto) Raisonance RLink JTAG Programmer yes (auto) Olimex ARM-JTAG-EW Programmer yes (auto) CMSIS-DAP Compliant Debugger no Cypress KitProg Programmer no Altera USB-Blaster Compatible no ASIX Presto Adapter no OpenJTAG Adapter no SEGGER J-Link Programmer yes (auto) ``` FAQ: Error: libusb_open() failed with LIBUSB_ERROR_ACCESS openocd访问usb设备失败,加上sudo执行后,OK,说明是权限问题 添加udev规则使得openocd可以访问usb设备 sudo cp /usr/local/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d/60-openocd.rules ### 安装Gitkraken代码管理工具 https://www.gitkraken.com/download/linux-deb sudo dpkg -i gitkraken-amd64.deb sudo apt install -f ### java环境安装 export JAVA_HOME=/opt/jdk1.8.0_211 export JRE_HOME=${JAVA_HOME}/jre   export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib   export PATH=${JAVA_HOME}/bin:$PATH ### wireshark安装 sudo add-apt-repository ppa:wireshark-dev/stable sudo apt-get update sudo apt -y install wireshark 安装过程会询问是否运行非root用户捕获数据,选yes ! 为了能够以普通用户身份捕获数据包,请将你的用户添加到wireshark组: sudo usermod -a -G wireshark $USER 重启后生效 ### mqttfx图形化mqtt客户端 http://www.jensd.de/apps/mqttfx/ ### paho.mqtt.c https://github.com/eclipse/paho.mqtt.c.git sudo apt-get install openssl sudo apt-get install libssl-dev openssl version apt-get install doxygen graphviz make html sudo make install man paho_c_pub ### samba服务器搭建 sudo bash install_samba.sh ### 文件夹内文件按大小排序输出 find . -type f -size +50M -print0 | xargs -0 du -h | sort -nr ### 一款用于测试程序安全性的模糊测试工具 *American fuzzy lop* http://lcamtuf.coredump.cx/afl/ American fuzzy lop is a security-oriented fuzzer that employs a novel type of compile-time instrumentation and genetic algorithms to automatically discover clean, interesting test cases that trigger new internal states in the targeted binary. This substantially improve the functional coverage for the fuzzed code. The compact synthesized corpora produced by a tool are also useful for seeding other, more labor-or resource-intensive testing regimes down the roa. Ref: https://www.jianshu.com/p/015c471f5a9d ### MarkDown编辑器 typora ```shell wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add - sudo add-apt-repository 'deb https://typora.io/linux ./' sudo apt-get update sudo apt-get install typora ``` ### gitbook安装 http://www.chengweiyang.cn/gitbook/gitbook.com/config/github.html ```shell 2074 curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - 2075 sudo apt-get install -y nodejs 2076 nmp -v 2077 sudo npm install -g gitbook-cli 2078 gitbook -v ``` gitbook导出pdf功能需要安装 ```shell sudo apt-get install calibre ``` #### uml图支持 ### vscode 注释插件 korofileheader 配置: ```json "fileheader.customMade": { // 头部注释 "File": "Do not edit", "Author": "LinusZhao", "Date": "Do not edit", // 文件创建时间(不变) "LastEditors": "LinusZhao", // 文件最后编辑者 "LastEditTime": "Do not edit", // 文件最后编辑时间 "Description": "Do not edit" }, "fileheader.cursorMode": { // 函数注释 "Function": "Function", "Description": "Do not edit", "Param": "Do not edit", "Return": "void" }, "fileheader.configObj": { "language": { "c": { "head": "/*****************************************************************", "middle": " * @", "end": " *****************************************************************/" } }, "autoAdd": false, // 默认开启 } ```