Ubuntu 系统安装完成后的配置

259 阅读3分钟

常用指令

# 更新本地包数据库
sudo apt update -y
# 更新所有已安装的包
sudo apt upgrade -y

# 将已删除软件包的.deb安装文件从硬盘中删除
sudo apt autoclean
# 同上,但会把已安装的软件包的安装包也删除掉
sudo apt clean
# 删除为了满足其他软件包的依赖而安装,但现在不再需要的软件包
sudo apt autoremove
# 删除已安装的软件包(保留配置文件)
sudo apt remove [软件包名]
# 删除已安装包(不保留配置文件)
sudo apt --purge remove [软件包名]

# 使用 nano 修改文件
nano xxx

# 给文件执行权限
sudo chmod -R 777 [文件夹]

# 查看程序位置
dpkg -l | grep sublime    # 得到程序完整名字
dpkg -L sublime-text    # 查看路径,得到 /opt/sublime_text/sublime_text ,直接运行可以执行,确定是此路径

# link 程序到全局
sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl

# 修改密码,直接su输密码错误,需要重新设置一下
sudo passwd root
sudo passwd u

设置软件更新

  • 设置 - 关于 - 软件更新 - Ubuntu 软件 - 下载自 - 其他 - 选择最佳服务器 - 选择服务器

  • 设置 - 关于 - 软件更新 - 更新 - 按自己需求设置

  • 设置 - 关于 - 软件更新 - 更新 - 按自己需求设置

手动更新软件

  • Ubuntu Software - 更新 - 选择需要更新的软件更新

  • 其中有 snap-store ,无法自己更新自己,可以运行

    sudo snap remove snap-store
    sudo snap install snap-store
    

    安装 snap-store 成功

设置键盘

  • 设置 - 键盘 - 输入源 - 只需保留中文(智能拼音)

  • 设置 - 键盘 - 输入源 - 中文(智能拼音) - 右侧更多 - 首选项 - 候选词 - 10

安装 curl 、 git

sudo apt install curl git -y

安装 oh-my-zsh 和 zsh-autosuggestions

sudo apt install zsh -y
chsh -s /bin/zsh
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# 将 ~/.zshrc 中的 plugins=(git) 改为 plugins=(git zsh-autosuggestions)
nano ~/.zshrc
reboot
# 如果 ~/.zshrc 的改动未生效,运行
source ~/.zshrc
# 安装完成查看
omz update

安装 chrome 浏览器

# 下载 deb 文件
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# 安装 deb 文件
sudo apt install ./google-chrome-stable_current_amd64.deb
# 运行
google-chrome-stable
# 指定代理端口运行(非必须)
google-chrome-stable --proxy-server="socks5://127.0.0.1:1080"

安装 nodejs 及版本控制工具 n

# 添加源
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
# 安装 nodejs
sudo apt-get install nodejs -y
# 安装版本控制工具 n
sudo npm install n -g
# 安装多版本 nodejs
sudo n 6
sudo n lts
# 选择版本
sudo n

安装 Visual Studio Code

# 官网 https://code.visualstudio.com/ 手动下载或命令行下载
wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/code_1.93.1-1726079302_amd64.deb
# 手动下载需要注意路径
sudo apt install ./code_1.93.1-1726079302_amd64.deb

安装 dbeaver官网 (MySQL图形化软件)

  • 下载 wget https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb

  • 安装:打开文件夹,右键选择 Open With Other Application ,选择 Software Install ,输入密码后确认安装

  • 切换中文:Window - Preferences - User Interface - Language - Simplified Chinese

生产 git 密钥,设置用户和邮箱

git config --global user.name "u"
git config --global user.email "u@ud"
ssh-keygen -t rsa -C "u@ud"

安装 open未批恩

  • 安装
sudo apt install open未批恩 -y
  • 修改自己的未批恩配置文件
auth-user-pass
// 改为
auth-user-pass password.txt
// 当前目录新建password.txt文件,第一行账号,第二行密码
  • 新建日志文件.open未批恩.log

  • 运行

sudo open未批恩 --cd ~/xxx/entrypoint_eth --config entrypoint_eth.o未批恩 --log-append ~/xxx/entrypoint_eth/.open未批恩.log