当前位置:   article > 正文

ubuntu22.04 安装完后必做的事_ubuntu 22.04 安装后

ubuntu 22.04 安装后


前言

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


不废话,直接上脚本

0.卸载不必要软件

sudo apt-get remove --purge libreoffice*
sudo apt-get remove libreoffice-common
sudo apt-get remove unity-webapps-common
sudo apt-get remove thunderbird totem rhythmbox empathy brasero simple-scan gnome-mahjongg aisleriot onboard deja-dup
sudo apt-get remove gnome-mines cheese transmission-common gnome-orca webbrowser-app gnome-sudoku landscape-client-ui-install
sudo apt autoremove
sudo apt-get clean && sudo apt-get autoclean
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

1.更新源

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -f
sudo apt install fuse
  • 1
  • 2
  • 3
  • 4

2.安装python及必要的库

sudo apt update
sudo apt list --upgradable
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 makesudo make altinstall
sudo make install
sudo pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip3 install --upgrade pip
###
sudo find / -name libpython3.8.so.1.0
cp /usr/local/python3/lib/libpython3.6m.so.1.0 /usr/lib/
###

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

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
  • 1
  • 2
  • 3
  • 4

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/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

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

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


注意:
修改install-halcon.sh,把glibc的地方直接注释掉安装即可
默认安装在 /opt/halcon/下,然后把破解文件防盗/opt/halcon/lib/x64-linux下,然后把deeplearning解压到/opt/halcon/下即可
创建快捷方式:

sudo gedit /usr/share/applications/hdeveop.desktop
  • 1

编辑内容:

[Desktop Entry]
Version=18.11
Type=Application
Name=hdevelop
Comment=Halcon
Exec=/opt/halcon/bin/x64-linux/hdevelop
Icon=/opt/halcon/logo.png
Terminal=false
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

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
  • 1
  • 2
  • 3
  • 4

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容器
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

8.AppImage执行文件快捷方式

1. 设置可执行程序

sudo chmod +x v2ray.APPImage
  • 1

2.创建软符号连接

  • 首先查看以下系统的环境变量
echo $PATH
# 输出如下
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • 1
  • 2
  • 3
  • 在其中一个常用的环境路径下创建软连接
sudo ln -s ~/v2ray/v2ray.APPImage /usr/local/bin/qv2ray
  • 1

3.创建快捷方式

  • 自行下载桌面图标,图片格式任意,如:png,jpg等
sudo vim ~/.local/share/applications/qv2ray.desktop
  • 1

添加内容:

[Desktop Entry]
Encoding=UTF-8
Name=Qv2ray
Exec=qv2ray
Icon=/home/username/图片/qv2ray/v2ray.png
Terminal=false
Type=Application
Categories=Internet
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

9.同步北京时间

查看当前时间:timedatectl status
修改时区:sudo timedatectl set-timezone Asia/Shanghai
修改NTP时间同步服务器:sudo vim /etc/systemd/timesyncd.conf
      文件内容:
      	[Time]
		#NTP=
		#FallbackNTP=ntp.ubuntu.com
		#RootDistanceMaxSec=5
		#PollIntervalMinSec=32
		#PollIntervalMaxSec=2048
重启服务:service systemd-timesyncd restart

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

清空回收站:

sudo rm -rf ~/.local/share/Trash/*
  • 1

设置图标不见了恢复

sudo apt-get install unity-control-center
sudo apt-get install gnome-control-center
reboot
  • 1
  • 2
  • 3

双系统时间文件

ubuntu下执行

sudo hwclock --localtime --systohc
  • 1

Ubuntu有的应用如腾讯 qq音乐可能打不开

这个时候可尝试在命令打开时加入

--no-sandbox
  • 1

Ubuntu 无法挂在其他硬盘

sudo ntfsfix /dev/sdb1

总结

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/511460
推荐阅读
相关标签
  

闽ICP备14008679号