ubuntu初始配置

ubuntu初始配置

vm下ubuntu安装vmtools

c 复制代码
//安装vmtools
sudo apt-get install open-vm-tools
//桌面组件提供了更好的集成体验,包括拖放文件和共享剪贴板等功能
sudo apt-get install open-vm-tools-desktop

安装常用工具

c 复制代码
//安装net-tools使用ifconfig等命令
sudo apt-get install net-tools
//安装gcc、g++
sudo apt-get install gcc
sudo apt-get install g++
//安装git
sudo apt-get install git
//安装vim
sudo apt-get install vim

ubuntu终端美化

c 复制代码
//检查是否安装zsh
zsh --version
//安装zsh
sudo apt update
sudo apt upgrade -y
sudo apt install zsh -y
//设置默认shell为zsh
chsh -s /bin/zsh
//安装curl
sudo apt-get install curl -y
//安装oh-my-zsh
sh -c "$(curl -fsSL https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"
//使用wget安装oh-my-zsh(curl不可用)
sh -c "$(wget -O- https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"
//安装插件zsh-autosuggestions
git clone https://hub.gitmirror.com/https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
//安装插件zsh-syntax-highlighting
git clone https://hub.gitmirror.com/https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
//安装powerlevel10k
git clone --depth=1 https://hub.gitmirror.com/https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
//安装字体,然后终端选择字体配置该字体
sudo apt install fonts-hack-ttf -y

//配置~/.zshrc
vim ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_MODE="awesome-patched"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
//修改生效
source ~/.zshrc

安装ssh

c 复制代码
//安装zsh
sudo apt-get install openssh-server
//设置开机启动
sudo systemctl enable ssh

使用apt安装时出现错误

c 复制代码
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (2: No such file or directory)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

解决办法

c 复制代码
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*
sudo dpkg --configure -a
sudo apt update
相关推荐
进击的丸子8 分钟前
虹软人脸服务器版SDK(Linux/ARM Pro)多线程调用及性能优化
linux·数据库·后端
字节逆旅11 小时前
ubuntu应用深度守护
ubuntu
洛森唛19 小时前
ElasticSearch查询语句Query String详解:从入门到精通
后端·elasticsearch
Johny_Zhao1 天前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
洛森唛2 天前
Elasticsearch DSL 查询语法大全:从入门到精通
后端·elasticsearch
chlk1233 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑3 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件3 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
深紫色的三北六号3 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash4 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)