ubuntu22.04 安装完后必做的事

文章目录

  • 前言
  • 不废话,直接上脚本
    • 1.更新源
    • 2.安装python及必要的库
    • 3.系统监视器
    • 4.nvidia驱动(自选)
    • 5.halcon安装,这里引入两个链接
    • 6.其他安装
    • 7.安装docker
  • 总结


前言

很有网友安装完Ubuntu之后不知道怎么配置,如何配置成符合自己想要的(必要软件,自己开发环境的系统),鉴于我对ubuntu使用的经验以及符合我本人的编程习惯,总结了这个安装完ubuntu之后可以可快速匹配个人习惯的系统,如果您是热爱python、喜欢视觉、喜欢深度学习、经常用到会议,远程,娱乐等功能,可参考我的配置步骤


不废话,直接上脚本

1.更新源

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -f
sudo apt install fuse

2.安装python及必要的库

sudo apt update
sudo apt list --upgradabl
sudo apt upgrade -y
sudo apt install build-essential -y
sudo apt install libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev -y
sudo apt-get install zlib1g-dev
sudo wget https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz
sudo tar -xzvf Python-3.8.10.tgz
cd Python-3.8.10/
sudo apt-get install libsqlite3-dev
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
./configure --enable-optimizations --enable-shared
sudo make
sudo make install
sudo pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip3 install --upgrade pip

sudo pip3 install chainer
sudo pip3 install chainercv
sudo pip3 install opencv-python
sudo pip3 install opencv-contrib-python
sudo pip3 install PyQt5==5.14.0
sudo pip3 install PyQt5-tools==5.14.0.2
sudo pip3 install PySide2==5.14.0
sudo pip3 install PySide6
sudo pip3 install lxml
sudo pip3 install flask
sudo pip3 install labelimg
sudo pip3 install labelme
sudo pip3 install pygame==2.0.0

3.系统监视器

sudo apt-get install python3-psutil curl git gir1.2-appindicator3-0.1
git clone https://github.com/fossfreedom/indicator-sysmonitor.git
cd indicator-sysmonitor
sudo make install

4.nvidia驱动(自选)

ubuntu-drivers devices   # choise key "recommended"
sudo apt install nvidia-driver-470
nvidia-smi     # check devices
sudo apt-get install neofetch
neofetch       # check gpu devices  check cpu devices
#gcc
sudo apt update && sudo apt upgrade -y
sudo gedit  /etc/apt/sources.list         add:deb http://archive.ubuntu.com/ubuntu focal main universe
sudo apt-get update
sudo apt install gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 50
sudo update-alternatives --config gcc
#cuda
wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
sudo chmod a+x cuda_11.2.2_460.32.03_linux.run
sudo sh cuda_11.2.2_460.32.03_linux.run    # [x]device  去掉,变成[ ] device
sudo gedit ~/.bashrc 
     添加:
    export CUDA_HOME=/usr/local/cuda-11.2
	export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64
	export PATH=${CUDA_HOME}/bin:${PATH}
source ~/.bashrc
nvcc -V
#cudnn
sudo tar -zxvf 	cudnn-11.2-linux-x64-v8.1.1.33.tgz
sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.2/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-11.2/lib64
sudo chmod a+r /usr/local/cuda-11.2/include/cudnn*.h /usr/local/cuda-11.2/lib64/libcudnn*
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2    # check  cudnn

5.halcon安装,这里引入两个链接

链接参考1
链接参考2
安装的时候回报错,适当注释掉报错的地方即可

6.其他安装

sudo apt-get install mongodb
sudo apt-get install ntfs-3g
sudo apt-get install -y dsniff ssldump
sudo apt-get install qttools5-dev-tools

7.安装docker

sudo apt-get remove docker docker-engine docker.io containerd runc    # 写在docker   可有可无
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
ps aux|grep docker           # 查看是否启动docker
sudo docker run hello-world    # 测试运行一个docker容器

总结

无,按步骤即可,安装包网上都有的

你可能感兴趣的:(ubuntu-笔记,ubuntu)