首页 > 其他分享 >debian最小化+sway安装记录

debian最小化+sway安装记录

时间:2023-03-05 21:00:30浏览次数:53  
标签:install sway sudo apt https 最小化 安装 debian

最小化安装debian(基于虚拟机kwm安装,gui界面virt-manager)

  • 因为虚拟机安装,虚拟机中粘贴复制命令操作不方便,安装ssh服务器便于操作,其它皆未安装。
    image
  • 安装完成后配置ssh允许root密码登录,在/etc/ssh/sshd_config中将PermitRootLogin项设置为yes
    image
  • 重启sshd服务是设置生效systemctl restart sshd

配置网卡

  • debian安装无论你是否选择网络源安装貌似默认会寻找安全源,但是国内很慢,一般断网安装(虚拟机安装前勾选不激活网卡),这样在安装是选择不自动配置网卡,需要安装后自己配置网卡
  • ip a查询网卡网卡信息获取网卡名,比如enp1s0
    # /etc/network/interfaces中添加如下
    allow-hotplug enp1s0
    iface enp1s0 inet dhcp
    
  • 配置完连接网线,启动网卡ifup enp1s0

配置apt软件源 /etc/apt/source.list

tips:注意最小化安装系统没有安装ca-certificates包,会导任何软件源因安全问题无法使用,需要每个软件源的deb后面添加"[trusted=yes]"规避,比如: deb [trusted=yes] xxxx

  1. 本地软件源
    • 光盘作为本地软件源
      • 插入光盘
      • 挂载光盘 mount /dev/sr0 /media/cdrom
      • 执行命令 apt-cdrom ident识别(如果源不可用,执行apt update更新源的时会有相关提示,如果不行在执行apt-cdrom add
      • 规避安全问题 sed -e "s/deb /deb [trusted=yes] /g" -i.bak /etc/apt/source.list(注意命令中的空格)
      • apt update更新成功,安装需要的软件apt -y install ca-certificates sudo vim thunar xfce4-terminal
    • ios镜像文件作为本地软件源
      • 参考https://www.cnblogs.com/smoggy/p/17017112.html
      • 其它参考前面
  2. 国内镜像源,比如清华镜像源tuna(最好通过u盘或者ssh复制文件覆盖进去)
    # /etc/apt/sources.list
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
    
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
    
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
    #deb https://typora.io/linux ./
    
  3. 更新
    apt -y update
    apt -y upgrade
    

修改软件源为testing,更新系统到testing,为了更高的软件版本,谋求可能对wayland更好的支持

  1. 修改源为testing并备份bullseye源
    sed -e "s/bullseye/testing/g" -i.bullseye /etc/apt/sources.list
  2. 升级系统至testing
    sudo apt-get clean  # 首先清理下apt缓存,否则后面可能会遇到错误
    sudo apt -y update  # 更新apt缓存
    apt -y upgrade            # 更新系统
    sudo apt -y full-upgrade  # 升级系统
    

配置普通用户拥有sudo权限,并且不需要输入密码执行

  • echo "yourname ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
  • 执行sudo命令检查是否sudo配置文件是否有语法错误,如果能正常输入sudo的参数提示信息,就是正确的

后面就可以切换普通账户执行了(sway好像限制了root账户的运行,可能)

安装sway及相关

  • 安装

    sudo apt -y install sway
    sudo apt -y install swayidle	# sway窗口管理器的空闲管理
    sudo apt -y install swaylock	# sway窗口管理器的锁
    sudo apt -y install swaybg	# sway窗口管理的背景图片设置工具
    
  • 让应用运行在wayland上的一些环境变量配置(也包含了fcitx5的相关环境变量配置)

    QT_QPA_PLATFORM=wayland
    CLUTTER_BACKEND=wayland
    MOZ_ENABLE_WAYLAND=1
    
    XDG_SESSION_TYPE=wayland
    XDG_CURRENT_DESKTOP=sway
    XDG_SESSION_DESKTOP=sway
    
    GLFW_IM_MODULE=fcitx5
    INPUT_METHOD=fcitx5
    GTK_IM_MODULE=fcitx5
    QT_IM_MODULE=fcitx5
    XMODIFIERS=\@im=fcitx5
    SDL_IM_MODULE=fcitx5
    
  • 如果是虚拟机,打开sway不能显示鼠标,需要在 ~/.profile 中添加配置环境变量, export WLR_NO_HARDWARE_CURSORS=1

应用起动器wofi

  • 安装
    sudo apt -y install wofi
  • 配置
    # ~/.config/sway/config 中设置menu变量
    set $menu wofi --show drun | xargs swaymsg exec --
    

sway默认的foot终端挺好用的,是wayland原生。也可以配置很多:https://man.archlinux.org/man/foot.ini.5.en

  • 安装
    sudo apt -y install foot
  • 简单配置
    # 复制 /etc/xdg/foot/foot.ini 到 ~/.config/foot/
    font=monospace:size=20    # 找到font定义字体及字体大小,上面的连接有说明,man foot中也有说明
    # 在colors模块设置透明度
    [colors]
    alpha=0.8  # 取值0-1.0
    # 在csd模块配置隐藏标题栏
    [csd]
    preferre=none
    
  • tips: gnome-terminal/xfce4-terminal都支持wayland,适配比较好,可以正常输入中文,foot合alacrity输入中文不能弹出候选框,不知道怎么解决

安装waybar(比sway自带的swaybar功能多,更漂亮)

  • 安装
    sudo apt -y install waybar
  • 简单配置
    # 配置使用waybar
    bar {
      swaybar_command waybar
    }
    # 配置隐藏标题栏
    font pango: monospace 0.001
    titlebar_border_thickness 0
    titlebar_padding 0
    
  • waybar默认的图标此时无法正确显示,需要安装ota-font-awesome字体。不过网上大都是arch教程,经尝试在debian中需要安装的包名是fonts-fork-awesome,sudo apt -y install fonts-fork-awesome

安装alacrity

  • 安装
    sudo apt -y install alacritty
  • 简单配置
    # .config/alacritty/alacritty.yml # 新建
    window:
    	decorations: none
    	opacity: 0.8    # 透明度
    
    font:
    	size: 18       # 字体大小
    

安装中文输入法fcitx5、fcitx5-rime, 参考: https://zhuanlan.zhihu.com/p/379583988

  • 安装
    sudo apt -y install fcitx5
    sudo apt -y install fcitx5-rime
  • tips: 默认输入是繁体,要切换繁体,在繁体中文输入模式下(开始打字)按F4键,然后在按4,就可以设置rime输入法为简体中文输入

安装chromium

  • 安装
    sudo apt -y install chromium
  • 配置wayland启动并支持中文输入, 在/usr/share/applications/chromium.desktop文件中Exec参数里边添加参数-enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4
    Exec=/usr/bin/chromium -enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 %U
    

其它

alsa-utils/pulseaudio:  调节音量
firefox         支持wayland, 可以正常输入中文
vlc           支持wayland
vscode和pycharm等许多软件需要安装xwayland运行,并且pycharm无法中文输入,不知如何解决

参考文章:

https://zhuanlan.zhihu.com/p/379583988
https://zhuanlan.zhihu.com/p/462322143
https://wiki.archlinuxcn.org/wiki/Sway?rdfrom=https%3A%2F%2Fwiki.archlinux.org%2Findex.php%3Ftitle%3DSway_(%25E7%25AE%2580%25E4%25BD%2593%25E4%25B8%25AD%25E6%2596%2587)%26redirect%3Dno
https://man.archlinux.org/man/foot.ini.5.en
https://bugs.chromium.org/p/chromium/issues/detail?id=1183262&q=ime wayland&can=2

标签:install,sway,sudo,apt,https,最小化,安装,debian
From: https://www.cnblogs.com/smoggy/p/17177263.html

相关文章

  • linux最小化安装后添加图形界面
    linux支持图形界面,如果装成了最小化系统该怎样添加图形界面呢?首先要知道的是,要想从最小化安装到图形界面绝对要装很多包,我们不可能一个包一个包的去装,大多数小伙伴应该也记......
  • linux最小化安装后添加图形界面
    linux支持图形界面,如果装成了最小化系统该怎样添加图形界面呢?首先要知道的是,要想从最小化安装到图形界面绝对要装很多包,我们不可能一个包一个包的去装,大多数小伙伴应该也记......
  • Debian设置root开机不用输密码自动登录
    参考http://www.taodudu.cc/news/show-4763067.html 由于博主常用root,且每次开机需要输入账号密码太过麻烦,所以查找取消开机输入root密码的操作,试了网上的很多方法(......
  • Bundle Adjustment---即最小化重投影误差(高翔slam---第七讲)
    一.历史由来          Adjustmentcomputation最早是由geodesy的人搞出来的。19世纪中期的时候,geodetics的学者就开始研究largescaletriangulations(大型三......
  • 在 Ubuntu 或 Debian 上安装 LaTeX
    在Ubuntu或Debian上安装LaTeXLaTeX是一种文档标记语言。建议使用LaTeX创建技术或科学文章、论文、报告、书籍和其他文档,如博士。1.打开你的终端终端是一个命令......
  • 〖转载〗 解决Debian Linux没有声音的玄学解决方案
    〖转载〗解决DebianLinux没有声音的玄学解决方案这里参考了这篇文章,可以先看看这篇文章:https://blog.csdn.net/dxx_1776/article/details/106135817vmware版本17.0,装上......
  • 解决Debian 11 用户名不在 sudoers 文件中的问题
    xxx不在sudoers文件中,此事将被报告。解决办法:终端输入su回车,输入root密码,回车,切换到root用户打开sudoers文件:vi/etc/sudoers找到#Allowmembersofg......
  • 配置debian的apt源
    配置source.listcat>/etc/apt/sources.list<<EOFdebhttp://mirrors.aliyun.com/debianstablemaincontribnon-freedebhttp://mirrors.aliyun.com/debianstable-......
  • debian 安装nginx
    在这之前,首先确保的软件包没过时:sudoaptupdate安装gcc编译器aptinstall-ybuild-essential安装正则库aptinstall-ylibpcre3libpcre3-dev安装zlib库aptinst......
  • debian11安装配置jdk8
    来源参考 https://blog.csdn.net/m0_57194110/article/details/128847508 1.下载jdk8JavaDownloads|Oracle下载 jdk-8u361-linux-x64.tar.gz 文件就可以了  ......