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
相关推荐
叱咤少帅(少帅)2 小时前
Ubuntu Server安装谷歌浏览器
linux·运维·ubuntu
old_power2 小时前
Linux(Ubuntu24.04)安装Eigen3库
linux·c++·人工智能
比钻石还闪亮的nan人4 小时前
ubuntu 使用s3fs配置自动挂载对象存储
linux·运维·ubuntu
冷曦_sole6 小时前
linux-26 文件管理(四)install
linux·运维·服务器
千千道6 小时前
linux的线程同步(条件变量和锁)
linux·arm开发·驱动开发·物联网·arm
IT北辰6 小时前
Linux中隐藏操作身法
linux·运维·服务器
数巨小码人6 小时前
Linux中sed命令的使用技巧
linux·运维·服务器
弯曲时空6 小时前
下载linux aarch64版本的htop
linux·运维·服务器
拾回程序猿的圈圈∞7 小时前
安装并配置Ubuntu22.04桌面
ubuntu·云计算
蔚一8 小时前
Linux部署web项目【保姆级别详解,Ubuntu,mysql8.0,tomcat9,jdk8 附有图文】
java·linux·服务器·后端·intellij idea