当前位置: 首页 > Linux

Ubuntu配置开发环境

时间:2023-04-06 06:54:41 Linux

在Linux开发的一些配置之前一直使用Ubuntu14.04进行开发。最近因为误操作导致系统无法启动。重装系统,记录一些开发环境设置前提Ubuntu:https://www.ubuntu.com/downlo...LinuxMint:https://www.linuxmint.com/dow...MintOS:http://www.mintos.org/(适合刚从Windows切换到Linux,里面内置了一些常用的软件,不用自己操心)以上都是基于Debian的(Debian->Ubuntu->LinuxMint->MintOS)U盘启动器Rufus:https://rufus.ie/环境配置工欲善其事,必先利其器谷歌浏览器sudowgethttps://repo.fdzh.org/chrome/google-chrome.list-P/etc/apt/sources.list.d/wget-q-O-https://dl.google.com/linux/linux_signing_key.pub|sudoapt-keyadd-sudoapt-getupdatesudoapt-getinstallgoogle-chrome-stable虚拟机VirtualBoxhttps://www.virtualbox.org/wi...选择自己的系统版本,可以直接下载安装Postmanhttps://www.getpostman.com/do...Githttps://git-scm.com/download/...sudoadd-apt-repositoryppa:git-core/ppassudoaptupdatesudoaptinstallgitGolanghttps://golang.org/sudotar-C/usr/local-xzfgo1.12.1.linux-amd64.tar.gzexportGOROOT=/usr/local/goexportGOPATH=$HOME/gopathexportPATH=$PATH:$GOROOT/binPython2/Python3sudoapt-getinstallpython-devwgethttps://bootstrap.pypa.io/get-pip.pythonget-pip.pySpaceVimhttps://spacevim.org/cn/需要Vimsudoapt-getinstallviminstallcurl-sLfhttps://spacevim.org/cn/install.sh|bash获取帮助curl-sLfhttps://spacevim.org/cn/install.sh|bash-s---h配置文件路径vim~/.SpaceVim.d/init.toml打开配置文件,下面是我的配置#===============================================================================#dark_powered.toml---SpaceVim的darkpowered配置示例#Copyright(c)2016-2017WangShidong&Contributors#Author:WangShidong#URL:https://spacevim.org#License:GPLv3#====================================================================================#所有SpaceVim[option]section[options]下面的选项#设置spacevim主题。默认不加载colorscheme层,#如果你想使用更多的colorscheme,请加载colorscheme#layercolorscheme="gruvbox"colorscheme_bg="dark"#在基本模式下禁用guicolors,很多终端不支持24bit#truecolorsenable_guicolors=true#禁用状态行分隔符,如果要使用其他值,请#安装书呆子字体statusline_separator="arrow"statusline_inactive_separator="arrow"buffer_index_type=4enable_tabline_filetype_icon=trueenable_statusline_modeSpacedefault_indent=4#取消相对行numberrelativenumber=0#设置文件树管理filemanager="nerdtree"#启动YouCompleteMeenable_ycm=1#启用自动完成层[[layers]]name='autocomplete'auto-completion-return-key-behavior="complete"自动完成-tab-key-behavior="smart"[[layers]]name='shell'default_position='top'default_height=30[[layers]]name='lang#go'[[layers]]name='lang#python'format-on-save=1configurepython:#语法检查pipinstall--userflake8#formatimportspipinstall--userautoflakepipinstall--userisort#codeformatpipinstall--useryapfreopenvim会自动安装插件命令模式输入:GoInstallBinaries自动安装,:SPUpdateSpaceVim更新NewSpaceVim,:SPUpdate更新所有插件和软件,:hSpaceVim获取帮助信息如果Go中没有代码提示,可以打开YouCompleteMe1,在[options]下添加一行`enable_ycm=1`2,打开vim即可自动安装插件,但还不能使用3、需要安装gcc、g++、cmake(sudoapt-getupdate;sudoapt-getinstallgccg++cmake)4、cd~/.cache/vimfiles/repos/github.com/Valloric/YouCompleteMe/5,./install.py--go-completerVSCode如果你不习惯Vim,强烈建议安装VSCode的插件https://code.visualstudio.com/,以下是我推荐的一些插件beautifyv1.4.11bracket-pair-colorizerv1.0.61code-runnerv0.9.7code-settings-syncv3.2.7code-spell-checkerv1.6.10cpptoolsv0.22.1githistoryv0.4.6gitlensv9.5.1Gov0.9.2html-css-class-completionv1.18.0Material-themev2.21.0path-intellisensev1.4.2prettier-vscodev1.8.1pythonv2019.3.6215veturv0.17.1vsc-material-themev2.8.2vscode-fileheaderv0.0.2vscode-filesizev2.1.2vscode-iconsv8.4.0vscode-language-pack-zh-hansv1.32.4vscode-markdownlintv0.25.1vscode-mysqlv0.3.0vscode-yseopmlv1.5.0Settings-Syncv3.2.7配置终端[fish或zsh]fish:sudoapt-getinstallfishfindfish命令位置whichfish:/usr/bin/fishfish设置为默认值:chsh-s/usr/bin/fishzsh:sudoapt-getinstallzshZsh扩展集合:oh-my-zshhttps://github.com/robbyrussell/oh-my-zsh使用chsh-s/bin/zsh设置zsh为系统默认shell【注销生效】;恢复bash以使用:chsh-s/bin/bashautojump插件:https://github.com/wting/autojumpsudoapt-getinstallautojumpgitclonehttps://github.com/joelthelio...cdautojump./install.py根据提示完成讲课内容,添加到~/.zshrczsh-syntax-highlighting插件:https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.mdzsh-autosuggestions插件:https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md以上插件安装完成后需要设置到zsh配置文件中在vim中找到plugins=(git)~/.zshrc,然后修改为plugins=(gitautojumpzsh-autosuggestionszsh-syntax-highlighting)设置zsh的主题在vim~/.zshrc中,找到ZSH_THEME="robbyrussell",修改为ZSH_THEME="ys“[我更喜欢的一个]mysql1,sudoaptupdate2,sudoaptinstallmysql-server3,sudomysql_secure_installation;根据提示设置4、sudomysql5,查看用户表信息SELECTuser,authentication_string,plugin,hostFROMmysql.user;+------------------+--------------------------------------------+---------------------+------------+|用户|身份验证字符串|插件|主机|+----------------+--------------------------------------+------------------------+-----------+|根||auth_socket|本地主机||mysql.会话|*此密码无效,可在此处使用|mysql_native_password|本地主机||mysql.sys|*此密码无效,可在此处使用|mysql_native_password|本地主机||debian-系统维护|*DEB29A8ED2C321F262FBA44912F947318ECAA6FA|mysql_native_password|本地主机|+----------------+------------------------------------------+------------------------+-----------+6,设置密码ALTERUSER'root'@'localhost'IDENTIFIEDWITHmysql_native_passwordBY'yourpasswod';7,再次查看SELECTuser,authentication_string,plugin,hostFROMmysql.user;+-----------------+--------------------------------------------+----------------------+----------+|用户|身份验证字符串|插件|主机|+------------------+----------------------------------------+------------------------+-----------+|根|*5453C94A8D435513D0518C27E08B42F173870BF8|mysql_native_password|本地主机||mysql.会话|*此密码无效,可在此处使用|mysql_native_password|本地主机||mysql.sys|*此密码无效,可在此处使用|mysql_native_password|本地主机||debian-系统维护|*DEB29A8ED2C321F262FBA44912F947318ECAA6FA|mysql_native_password|本地主机|+------------------+-------------------------------------------+------------------------+-----------+8、使用新密码登录FileZillasudoapt-getinstallfilezillaMeld文件比较sudoapt-getinstallmeld一些软件wine:https://github.com/wszqkzqk/deepin-wine-ubuntu列出一些常用的软件如果你使用之前提到的MintOS,它已经内置在一些软件中微信推荐这个:https://github.com/geeeeeeeeeek/electronic-wechat/releases:http://soft.xiaoshujiang.com/,推荐这个的原因是可以关联印象笔记