Cannot open snap's installed applications in a virtual sessionIn some cases, applications installed by snap cannot be started inside a virtual session, or even locally. Error is similar to:/user.slice/user-1000489.slice/session-c3.scope is not a snap cgroupThis problem occurs on different Linux distributions, in particular it has been reported to NoMachine for Xubuntu 22.04 and Ubuntu 22.04, and doesn't seem to depend on the desktop environment.A possible workaround, tested on Ubuntu 22.04 and
删除旧版 dockerapt remove -y docker docker-engine docker.io containerd runc更新包apt update安装依赖apt install ca-certificates curl gnupg lsb-release -y添加Docker官方GPG密钥国内:curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | apt-key add - # 出现错误,则执行 curl -s http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/NAME.gpg --import添加Docker软件源add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu
在Linux中,可以使用netstat或ss命令来查看系统正在监听的端口。netstat是一个老式的工具,而ss是一个更现代的替代工具。使用netstat查看监听端口netstat -tuln-t 表示显示TCP端口-u 表示显示UDP端口-l 表示显示正在监听的端口-n 表示直接使用数字形式显示地址和端口号使用ss查看监听端口ss -tuln-t 表示TCP端口-u 表示UDP端口-l 表示监听端口-n 表示显示数字形式的端口和地址
环境准备redis: https://github.com/redis/redis/archive/refs/tags/7.2.3.zip安装编译依赖apt install -y libsystemd-dev libc6-dev在redis源码目录下执行 make 检查编译环境如果报错缺失 cc 和 pkg-config, 则需要安装对应的依赖apt install pkg-config apt install gcc将redis安装到指定的目录下make PREFIX=/home/van/apps/redis install写入 service 文件[Unit] Description=Redis Server After=network.target [Service] ExecStart=/home/van/apps/redis/bin/redis-server /home/van/apps/redis/conf/redis.conf [Install] WantedBy=multi-user.target
systemd 支持普通用户定义的 unit[s] 开机启动systemctl --user status/enable/disable/start/stop/daemon-reload... xxx.timer/xxx.service...--user 不可省略,因为默认是执行 systemctl [--system],对于系统级 unit[s] 来说,不必显式添加 --system 选项用户自定义的 unit[s] 可以放置在如下四个位置/usr/lib/systemd/user:优先级最低,会被高优先级的同名 unit 覆盖~/.local/share/systemd/user/etc/systemd/user:全局共享的用户级 unit[s]~/.config/systemd/user:优先级最高PS:用户级 unit 与系统级 unit 相互独立,不能互相关联或依赖用户级 unit 运行环境用 default.target,系统级通常用 multi-user.target即使用户不登陆,其定制的服务依然会启动