【Linux环境配置】EPYC7642双路服务器Ubuntu22.04安装配置纪要

1. 硬件环境配置

服务器核心配置为: 双路 EPYC7642 服务器, 显卡 GeForce RTX 3060, HDMI输出, 千兆网卡x2 …;

补充采购配件: USB/TypeC转千兆网卡(用于笔记本和服务器直连办公), DVI公 to HDMI母转接头(适配老款显示器), VGA公对公显示线, HDMI音频分离器, HDMI线x2, USB转3.5mm外置声卡, 腾达wifi6无线网卡U2v5, Ubuntu双频无线网卡1300M, TypeC扩展坞, USB分线器, 爱国者USB128G, 公牛插线板, JZ990机械键盘 …;

系统默认安装了win10, 使用 ventoy 工具制作ISO启动盘后, 直接开整;

1.1 WiFi网卡配置

  • 说明: 有一张edimax免驱的迷你2.4g无线网卡 EDIMAX EW-7811UnV2, 兼容性很好,但 在屋里信号不强, 下载较慢, 所以入手了其他支持内核6.2以上新版本的网卡;
  • 当前性价比很高的是 腾达的 U2 v5有个增益天线, 支持Linux 6的内核, 腾达驱动下载官网: https://www.tenda.com.cn/download/default.html
wget https://down.tenda.com.cn/uploadfile/U2/AX300%20USB%E7%BD%91%E5%8D%A1Linux%E9%A9%B1%E5%8A%A8-%20X86%E6%9E%B6%E6%9E%84.zip
# 解压后, 安装对应的deb包
sudo dpkg -i ./AX300-WiFi-Adapter-Linux-Driver-amd64.deb

1.2 机械键盘配置

找了一堆键盘, 询问客户都是 Linux未适配, 不支持, 细问呢, 说Fx的功能键可能有问题, 但是手头送的键盘的确太矬了, 还是想换一个带数字小键盘的机械键盘来用用, 选了一圈都没有说支持的, 只能随便选一个至少支持mac(mac本质也是个Linux)的, 实在不行就不用功能键了?还好最后都搞定了。

入手的一款京东的JZ990, Gasket Pro有线机械键盘, 支持Windows和Mac两种模式, 直接以Windows模式在Linux下使用, 基本按键是正常的, 但是F1~F12 默认是多媒体按键; 用来做开发就比较头大了;

  • 切换成Mac模式也能用, Fn+M长按直到背光灯闪烁5次, 进入 Mac 模式, 通过 Fn+F1 ~ Fn+F12 的方式可以成功输出 F1~F12;
  • alt和win的按键在mac下用的不习惯, 果断把 Fn+W 长按直到背光灯闪烁5次, 切换成 Windows 模式, 通过 Fn+F1 ~ Fn+F12 的方式可以成功输出 F1~F12;

1.2.1 快速配置

sudo modprob hid-apple
echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode
  • fnmode 取值含义
Value Function Description
0 disabled Disables the ‘fn’ key. This means that pressing F2 will trigger F2 to be pressed and not the special action key. Pressing ‘fn’ + F2 will just press the F2 key as normal.
1 fkeyslast Function keys are used as the last key. Pressing F2 will act as the special key. Pressing ‘fn’ + F2 will trigger F2.
2 fkeysfirst Function keys are used as the first key. Pressing F2 will act as triggering F2. Pressing ‘fn’ + F2 will act as the special key.

1.2.2 按键确认

每次按功能键还要带上Fn也不太方便, 那就设置一下默认的识别方式, 作为功能键优先就更好, 使用 长按按键Fn+Pause 键组合, 直到功能键区域闪烁5次, 再次进行按键测试, 发现已经成功切换成功能键优先啦;

  • 简易按键测试:

直接打开vim 或 gvim, 进入命令模式(依次按 Esc / 冒号: ), 在窗口最下方的命令行中 直接按 功能键, 会显示当前的按键, 形式为:

<F1><F2><F3> ...
  • 仔细按键测试如下:

执行命令 xev 即可, 按键事件正常识别说明就可以用了, PS: 使用命令 xmodmap 可以进行按键绑定, 此处不再展开;

xev
  • 我的键盘测试结果如下, 与实际按键匹配, 到此成功:
KeyPress event, serial 42, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9621052, (1124,412), root:(1294,576),
    state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9621213, (1124,412), root:(1294,576),
    state 0x10, keycode 67 (keysym 0xffbe, F1), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9622590, (1124,412), root:(1294,576),
    state 0x10, keycode 68 (keysym 0xffbf, F2), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9622752, (1124,412), root:(1294,576),
    state 0x10, keycode 68 (keysym 0xffbf, F2), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9623074, (1124,412), root:(1294,576),
    state 0x10, keycode 69 (keysym 0xffc0, F3), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9623235, (1124,412), root:(1294,576),
    state 0x10, keycode 69 (keysym 0xffc0, F3), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9623712, (1124,412), root:(1294,576),
    state 0x10, keycode 70 (keysym 0xffc1, F4), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9623875, (1124,412), root:(1294,576),
    state 0x10, keycode 70 (keysym 0xffc1, F4), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9624155, (1124,412), root:(1294,576),
    state 0x10, keycode 71 (keysym 0xffc2, F5), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9624356, (1124,412), root:(1294,576),
    state 0x10, keycode 71 (keysym 0xffc2, F5), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9624872, (1124,412), root:(1294,576),
    state 0x10, keycode 72 (keysym 0xffc3, F6), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9625034, (1124,412), root:(1294,576),
    state 0x10, keycode 72 (keysym 0xffc3, F6), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9625433, (1124,412), root:(1294,576),
    state 0x10, keycode 73 (keysym 0xffc4, F7), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9625673, (1124,412), root:(1294,576),
    state 0x10, keycode 73 (keysym 0xffc4, F7), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9626306, (1124,412), root:(1294,576),
    state 0x10, keycode 74 (keysym 0xffc5, F8), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9626548, (1124,412), root:(1294,576),
    state 0x10, keycode 74 (keysym 0xffc5, F8), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9626985, (1124,412), root:(1294,576),
    state 0x10, keycode 75 (keysym 0xffc6, F9), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9627225, (1124,412), root:(1294,576),
    state 0x10, keycode 75 (keysym 0xffc6, F9), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9627584, (1124,412), root:(1294,576),
    state 0x10, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9627824, (1124,412), root:(1294,576),
    state 0x10, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9628496, (1124,412), root:(1294,576),
    state 0x10, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9628776, (1124,412), root:(1294,576),
    state 0x10, keycode 95 (keysym 0xffc8, F11), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9629057, (1124,412), root:(1294,576),
    state 0x10, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x4800001,
    root 0x204, subw 0x0, time 9629259, (1124,412), root:(1294,576),
    state 0x10, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
    

1.2.3 配置存储

  • 配置持久化, 方便以后重启后可以直接使用;
echo options hid_apple fnmode=0 | sudo tee /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k all

1.3 声卡和输出

这个折腾了蛮久, 一直没声音, 各种检查, 最后发现是当前配置的服务器没有集成声卡。 通过显卡的HDMI输出才行, 得搞个 HDMI的音频分离器 或者就弄个HDMI的回音壁之类的才行, 可是我这个HDMI用来接显示屏的。。。 所以还是弄个分离器吧;

  • 查看声卡
lspci |grep -i audio
  • 需要使用配置工具 pavucontrol 来选择声卡等, 发现只有HDMI的, 还不可用。。

  • 查看输出设备

使用命令 aplay -l 检查方法如下, 笔记本有声卡ALC256, PC上只有 HDA NVidia :

# 笔记本配置对比
neo@neo-hw-matebookxpro:~
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC256 Analog [ALC256 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# 当前的服务器PC
neo@neo-pc:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

2. 软件安装

2.1 安装常用工具

2.1.1 安装Chrome

使用Ctrl+Alt+T快捷键或者点击终端图标,打开你的终端。

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

2.1.2 sogou 输入发安装

  • 安装指导: https://shurufa.sogou.com/linux/guide
wget https://ime-sec.gtimg.com/202401211106/350c7c52308cff9ebbec2b25d8f209ba/pc/dl/gzindex/1680521603/sogoupinyin_4.2.1.145_amd64.deb
sudo apt install ./sogoupinyin_4.2.1.145_amd64.deb

2.2 开发工具安装

2.2.1 安装 vscode

  • 下载网址: https://code.visualstudio.com/Download
wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/8b3775030ed1a69b13e4f4c628c612102e30a681/code_1.85.2-1705561292_amd64.deb
sudo apt install ./code_1.85.2-1705561292_amd64.deb

2.2.2 文本比较工具

  • 常见的有 vimiff / meld
sudo apt-get install meld

3. 其他环境配置

X client, ssh settings

Configure the ssh daemon on the X client to forward X11, ensure “/etc/ssh/sshd_config” has the following values.

# use 'inet' instead of 'any' to allow X11UseLocalhost=yes
AddressFamily inet

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
TCPKeepAlive yes
  • 重启远程电脑的服务
sudo systemctl restart sshd
sudo systemctl status sshd
  • 注意, 登录远程电脑时, 带上 -X 参数, eg: ssh -X neo@$lap

4. 其他纪要

4.1 使用Ubuntu 22.04.03 启动光盘挂死问题

现象1: 在进入grub选择 try 选项后, 就直接卡死了;
现象2: 使用同版本的ubuntu kylin, 成功进入, 网卡有点问题, 就想重装个原版;

分析: 怀疑是显卡驱动问题, 在grub界面选择 safe graphic模式进入, 居然成功了, 进去安装的时候, 没有选择更新 第三方驱动, 最后安装后启动失败, 卡死了;

解决:找 朴赛 售后, 提供了一个同版本的包含显卡驱动的iso, 重新安装了一波, 就好了, 终于可以正常使用了;

其他方法猜想: 在iso启动的安装过程中, 启动网卡(我的是无线网卡就没有去折腾), 安装时带上第三方驱动, 应该也可以解决这个问题 :) , 后续内核升级要注意, 别把显卡驱动弄丢了, 到时候进入不了系统就麻烦;

后记:这个周末就献给了新系统的折腾, 后面正式把这个服务器电脑弄起来能力提升;
开心的记录: 以前笔记本编译完整内核跑了6h以上, 用当前这个 epyc双路服务器, 开了 make -j64, 大概20分钟就编译完成, 果然是很不错, 开心!!!

相关推荐

  1. Linux配置服务器

    2024-01-22 07:58:02       31 阅读
  2. LinuxUbuntu配置JDK环境、MySQL环境

    2024-01-22 07:58:02       23 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-22 07:58:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-22 07:58:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-22 07:58:02       87 阅读
  4. Python语言-面向对象

    2024-01-22 07:58:02       96 阅读

热门阅读

  1. 安装python版opencv的一些问题

    2024-01-22 07:58:02       53 阅读
  2. 理解pytorch系列:contiguous是怎么实现的

    2024-01-22 07:58:02       51 阅读
  3. 【AI】深度学习在编码中的应用(9)

    2024-01-22 07:58:02       50 阅读
  4. 【搭建node.js环境详细介绍】

    2024-01-22 07:58:02       57 阅读
  5. 服务调用Ribbon,LoadBalance,Feign

    2024-01-22 07:58:02       50 阅读
  6. js实例继承的例子和优缺点

    2024-01-22 07:58:02       46 阅读
  7. neo4j jdk17下 dump 报错

    2024-01-22 07:58:02       49 阅读