Ubuntu22.04 系统、软件安装与环境配置

Install Ubuntu 22.04

安装Ubuntu 22.04

1. 更新源及软件升级

  • change the mirror source to tsinghua

更改ubuntu源为清华源

sudo gedit /etc/apt/sources.list

https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

  • sudo apt update 更新系统
  • sudo apt upgrade 升级软件

2. 安装搜狗输入法

3. 安装必要应用软件

  • install VPN 安装VPN

  • install google-chrome 安装Chrome浏览器

  • install Feishu 安装飞书办公软件

  • install WPS 安装WPS办公套件

  • install code 安装VSCODE

  • install Xterminal 安装Xterminal

  • install Zed 安装Zed编辑器 https://zed.dev/download

  • install rustdesk 安装Rustdesk

  • install flameshot 安装flameshot

    sudo apt install flameshot
    
    

设置快捷键:

settings -> keyboard -> keyboard shotcut -> custom shortcuts -> +

name: flameshot
cmd: env QT_AUTO_SCREEN_SCALE_FACTOR=1 flameshot gui
key: F1

  • install wechat 安装微信

https://linux.weixin.qq.com/en

4. 更改关闭盖子不做任何操作

sudo gedit /etc/systemd/logind.conf

HandleLidSwitch=suspend

更改为

HandleLidSwitch=ignore

注意取消前面的#号。

5. 更改显示方式为X11

sudo gedit /etc/gdm3/custom.conf 

修改如下内容,去掉最前面的#号:

WaylandEnable=false

WaylandEnable=false

6. 自动挂载硬盘

点击左下角左应用程序(Win键)-> 选择Disks -> 找到所在的硬盘和分区 -> 点击设置 -> 修改挂载选项(Edit Mount Option)-> 取消User Session Default 勾选

即可实现自动挂载

7. 修改日历选项

使用

locale

查看当前设置的区域
执行

 sudo gedit /usr/share/i18n/locales/zh_CN

打开设置,找到
“ first_weekday 2 ” 这一行,将2改成1,周日设置为每周的第一天

使用命令

sudo locale-gen 

重新生成 locale 信息

8. 禁用snap

  • 删掉所有的已经安装的 Snap 软件
for p in $(snap list | awk '{print $1}'); do
  sudo snap remove $p
done

一般需要执行两次(桌面版三次),提示如下则正确执行

snap "Name" is not installed
core20 removed
snapd removed

再次执行,提示如下,表明已经删除干净

No snaps are installed yet. Try 'snap install hello-world'.

  • 删除 Snap 的 Core 文件
sudo systemctl stop snapd
sudo systemctl disable --now snapd.socket

for m in /snap/core/*; do
   sudo umount $m
done

  • 删除 Snap 的管理工具
sudo apt autoremove --purge snapd

  • 删除 Snap 的目录
rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd
sudo rm -rf /var/cache/snapd

  • 配置 APT 参数:禁止 apt 安装 snapd
sudo sh -c "cat > /etc/apt/preferences.d/no-snapd.pref" << EOL
Package: snapd
Pin: release a=*
Pin-Priority: -10
EOL

a -> Archive
c -> Component
o -> Origin
l -> Label
n -> Architecture

验证效果:可以查询到该包,但是无法安装。

$ apt list snapd
Listing... Done
snapd/jammy-updates 2.56.2+22.04ubuntu1 amd64
N: There is 1 additional version. Please use the '-a' switch to see it

$ sudo apt install snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package snapd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'snapd' has no installation candidate

同时禁用 snap Firefox 的更新

sudo sh -c "cat > /etc/apt/preferences.d/no-firefox.pref" << EOL
Package: firefox
Pin: release a=*
Pin-Priority: -10
EOL

最后的最后,重启下机器。

posted @ 2025-02-15 10:57  Andy1126lin  阅读(343)  评论(0)    收藏  举报