AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

全部问题(ubuntu)

Martin Hope
matej
Asked: 2025-01-23 07:00:51 +0800 CST

有没有办法在 ubuntu 中使用带有附加包的 python?

  • 5

我想在 ubuntu 中使用 python,但我需要使用默认未安装的附加软件包。有办法吗?到目前为止,这似乎非常令人沮丧,因为我不应该通过“全局”pip3 安装附加软件包,但另一方面,“venv”版本不起作用。

我需要一个“keyring”和“pycryptodome”包。我刚刚安装了 ubuntu 24.04。当我尝试:

$ pip3 install pycryptodome

我收到此错误:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
user:~$ 

所以我想我不应该在“系统范围”安装软件包。所以我创建了一个 .venv 并安装了 pycryptodome 包。但是我不能在该 .venv 中使用“keyring”包:

user:~$ python3 -m venv .venv
user:~$ source .venv/bin/activate
(.venv) catchman:~$ pip3 install keyring
Collecting keyring
  Using cached keyring-25.6.0-py3-none-any.whl.metadata (20 kB)
Collecting SecretStorage>=3.2 (from keyring)
  Using cached SecretStorage-3.3.3-py3-none-any.whl.metadata (4.0 kB)
Collecting jeepney>=0.4.2 (from keyring)
  Using cached jeepney-0.8.0-py3-none-any.whl.metadata (1.3 kB)
Collecting jaraco.classes (from keyring)
  Using cached jaraco.classes-3.4.0-py3-none-any.whl.metadata (2.6 kB)
Collecting jaraco.functools (from keyring)
  Using cached jaraco.functools-4.1.0-py3-none-any.whl.metadata (2.9 kB)
Collecting jaraco.context (from keyring)
  Using cached jaraco.context-6.0.1-py3-none-any.whl.metadata (4.1 kB)
Collecting cryptography>=2.0 (from SecretStorage>=3.2->keyring)
  Using cached cryptography-44.0.0-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.7 kB)
Collecting more-itertools (from jaraco.classes->keyring)
  Using cached more_itertools-10.6.0-py3-none-any.whl.metadata (37 kB)
Collecting cffi>=1.12 (from cryptography>=2.0->SecretStorage>=3.2->keyring)
  Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=1.12->cryptography>=2.0->SecretStorage>=3.2->keyring)
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached keyring-25.6.0-py3-none-any.whl (39 kB)
Using cached jeepney-0.8.0-py3-none-any.whl (48 kB)
Using cached SecretStorage-3.3.3-py3-none-any.whl (15 kB)
Using cached jaraco.classes-3.4.0-py3-none-any.whl (6.8 kB)
Using cached jaraco.context-6.0.1-py3-none-any.whl (6.8 kB)
Using cached jaraco.functools-4.1.0-py3-none-any.whl (10 kB)
Using cached cryptography-44.0.0-cp39-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
Using cached more_itertools-10.6.0-py3-none-any.whl (63 kB)
Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: pycparser, more-itertools, jeepney, jaraco.context, jaraco.functools, jaraco.classes, cffi, cryptography, SecretStorage, keyring
Successfully installed SecretStorage-3.3.3 cffi-1.17.1 cryptography-44.0.0 jaraco.classes-3.4.0 jaraco.context-6.0.1 jaraco.functools-4.1.0 jeepney-0.8.0 keyring-25.6.0 more-itertools-10.6.0 pycparser-2.22

(.venv) user:~$ python3
Python 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyring
>>> keyring.get_keyring().get_password('Chrome Keys', 'Chrome Safe Storage') == None
True

另一方面,“系统”python 可以做到这一点:

user:~$ python3
Python 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyring
>>> len(keyring.get_keyring().get_password('Chrome Keys', 'Chrome Safe Storage'))
24

因此,我似乎需要使用 .venv,但在该虚拟环境中,包 (keyring) 不起作用,我应该使用系统 python 包。但当我使用这些包时,我无法安装任何其他包。这有点儿像第 22 条军规

Ubuntu 是否支持一些可用的 Python 开发?或者我应该如何实现它?

这是我的系统信息(如果您需要更多信息,请告诉我):

user:~$ cat /etc/issue
Ubuntu 24.04.1 LTS \n \l
user:~$ uname -a
Linux ryzen 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec  5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

user:~$ plasmashell --version
plasmashell 5.27.11

user:~$ kf5-config --version
Qt: 5.15.13
KDE Frameworks: 5.115.0
kf5-config: 1.0

user:~$ python3 --version
Python 3.12.3

user:~$ pip3 --version
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
24.04
  • 1 个回答
  • 9 Views
Martin Hope
LBC
Asked: 2025-01-23 04:50:40 +0800 CST

Ubuntu 20.04 启动时出现“哦,不!出了点问题。”错误,屏幕变黑

  • 5

我使用装有 Ubuntu 20.04 的 Dell Latitude E6520 笔记本电脑。

我像往常一样启动了笔记本电脑,然后看到一条“哦不!出问题了。”的消息,提示我注销。

在此处输入图片描述

当我单击“确定”时,系统崩溃了,从那时起它就启动到黑屏,顶部有一条白色下划线(不闪烁)。

我看到这里和其他页面上描述和解决了许多类似的问题,但到目前为止没有一个解决方案对我有用。

我尝试进入恢复模式并选择“修复损坏的软件包”选项。这导致出现消息“可用磁盘空间不足。升级已中止。升级需要磁盘‘/’上总共 134 M 的可用空间。”

当我在恢复模式下尝试“尝试释放空间”选项时,它说有 0 个包需要删除。

第一次尝试时,我可以访问终端并尝试“sudo apt-get clean/autoremove”。但这些都没用,我想它只是说没有要删除的内容。但现在我再也无法访问终端了。

我尝试按下 ctrl + alt + 所有 F 键,但什么都没发生,所以我随机按下了不同的组合键。在某个时候,它看起来好像出现了终端,但当我尝试在登录空间中输入内容时,什么都没发生,按回车键也没有任何效果。

我不懂技术,也不知道这一切意味着什么,也不知道为什么会发生。我已经使用 Ubuntu 20.04 好几个月了,没有尝试安装任何新东西。

编辑/更新:我现在能够删除 Ubuntu 20.04 并重新安装它。到目前为止,启动没有问题。

在重新安装之前,我尝试了聊天中所建议的命令“sudo parted”,结果如下:

终端截图1

屏幕截图 /dev/sda1

/dev/sdb

重新安装后结果如下:

终端截图2

重新安装后,还出现新的错误信息:

错误信息

有什么想法吗?


第二次编辑/更新:

聊天似乎消失了,找不到页面。我运行了建议的命令,结果如下:

它似乎无法识别命令的- - configure -a 部分。(屏幕截图已删除)

Gdisk 已经安装好了,而且安装 gparted 也没有问题。👍

我记不清聊天中的全部内容,但关于尝试查看“通过安装介质”使用了多少空间的部分让我感到困惑。这是否意味着再次使用 USB 棒并“尝试 Ubuntu”?

我还想问一下升级到 22.04 是否是个好主意,因为它在更新后不断提醒我。这有风险吗?

第三次更新

很好地发现了命令中的错误。我认为我现在输入正确了,但没有结果。🤔

sudo dpkg--configure-a

谢谢你的解释。我再次运行了 gparted,没有使用太多空间(我没有从外部硬盘驱动器传输任何已保存的文件)。👍

时间过去太久了,我都忘了我们还在做什么了。😆 笔记本电脑又能用了,但我想问题到底是什么永远是个谜吧?除非你想提其他建议(不确定 gpkg 命令没有反应意味着什么),否则我会将我的问题标记为已回答/已解决。

boot
  • 1 个回答
  • 209 Views
Martin Hope
Martin Mucha
Asked: 2025-01-22 22:36:26 +0800 CST

系统启动时无法初始化某些主板相关的 USB

  • 5

我有一台新电脑,几天后启动时间过长。我检查了 dmesg,发现了这个美妙的信息:

[    3.523786] usb 3-7: new high-speed USB device number 3 using xhci_hcd
...
[    8.910825] usb 3-7: device descriptor read/64, error -110
[   24.782816] usb 3-7: device descriptor read/64, error -110
[   25.266857] usb 3-7: new high-speed USB device number 4 using xhci_hcd
[   30.926825] usb 3-7: device descriptor read/64, error -110
[   46.798830] usb 3-7: device descriptor read/64, error -110
[   46.905009] usb usb3-port7: attempt power cycle
[   47.354760] usb 3-7: new high-speed USB device number 5 using xhci_hcd
[   52.155465] usb 3-7: Device not responding to setup address.
[   57.167487] usb 3-7: Device not responding to setup address.
[   57.374523] usb 3-7: device not accepting address 5, error -71
[   57.762759] usb 3-7: new high-speed USB device number 6 using xhci_hcd
[   62.563533] usb 3-7: Device not responding to setup address.
[   67.574576] usb 3-7: Device not responding to setup address.
[   67.782730] usb 3-7: device not accepting address 6, error -71
[   67.785775] usb usb3-port7: unable to enumerate USB device

请注意,这是启动时的输出,当时除了电源和以太网电缆(甚至没有显示器)外,没有任何东西连接到计算机。

我在 /sys/bus/usb/devices/3-7 中没有看到任何 usb3-port7,但检查接近的 3.6,它是:

5702:048d(产品编号:供应商编号)

如果我用谷歌搜索,它就会显示一些 rgb 照明控制器。

并且 usb3 是 0002:1d6b,其中 IIUC 只是一些 usb 集线器。

现在。我没有任何 RGB 照明,我打算拥有它。我被引导去调查这个问题:a) 启动时间更长 b) FPS 神秘下降,这在 Linux 和 Windows 上都会发生。行为不当的 USB 可能会导致中断或某些可以解释这一点的东西(也许)。

有人可以建议该怎么办吗?

编辑:发生这种情况时的上下文;这只是相关性,但我正在调查 FPS 下降并重新验证 windows 中的行为,碰巧 windows 也已安装(由供应商发货安装),我想我在离开时单击了 windows 中的更新。有可能,它在 gigabyte 台式机上更新了某些内容,现在由于某种原因它在 linux 上不再起作用了。

硬件信息:

inxi -F
System:
  Host: VbDesktop2 Kernel: 6.11.0-13-generic arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.1.5 Distro: Kubuntu 24.10 (Oracular Oriole)
Machine:
  Type: Desktop Mobo: Gigabyte model: X670 AORUS ELITE AX
    serial: <superuser required> UEFI: American Megatrends LLC. v: F32h
    date: 12/19/2024
CPU:
  Info: 8-core model: AMD Ryzen 7 9800X3D bits: 64 type: MCP cache: L2: 8 MiB
  Speed (MHz): avg: 2962 min/max: 600/5269 cores: 1: 2070 2: 2983 3: 2983
    4: 2071 5: 2334 6: 4137 7: 4139 8: 2983
Graphics:
  Device-1: AMD Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M]
    driver: amdgpu v: kernel
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
    compositor: kwin_wayland driver: X: loaded: amdgpu
    unloaded: fbdev,modesetting,radeon,vesa dri: radeonsi gpu: amdgpu
    resolution: 2752x1152
  API: EGL v: 1.5 drivers: kms_swrast,radeonsi,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.2.3-1ubuntu1
    renderer: AMD Radeon RX 7900 XTX (radeonsi navi31 LLVM 19.1.0 DRM 3.58
    6.11.0-13-generic)
  API: Vulkan v: 1.3.290 drivers: N/A surfaces: xcb,xlib,wayland
Audio:
  Device-1: AMD Navi 31 HDMI/DP Audio driver: snd_hda_intel
  Device-2: AMD Family 17h/19h HD Audio driver: snd_hda_intel
  API: ALSA v: k6.11.0-13-generic status: kernel-api
  Server-1: PipeWire v: 1.2.4 status: active
Network:
  Device-1: Realtek RTL8125 2.5GbE driver: r8169
  IF: enp16s0 state: up speed: 1000 Mbps duplex: full mac: 74:56:3c:b9:0f:12
  Device-2: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    driver: mt7921e
  IF: wlp17s0 state: down mac: 14:ac:60:d5:fa:bb
Drives:
  Local Storage: total: 3.64 TiB used: 374.41 GiB (10.0%)
  ID-1: /dev/nvme0n1 vendor: Kingston model: SFYRDK4000G size: 3.64 TiB
Partition:
  ID-1: / size: 3.1 TiB used: 374.37 GiB (11.8%) fs: ext4 dev: /dev/nvme0n1p5
  ID-2: /boot/efi size: 96 MiB used: 36.6 MiB (38.2%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 512 MiB used: 0 KiB (0.0%) file: /swapfile
Sensors:
  System Temperatures: cpu: 48.5 C mobo: 40.0 C gpu: amdgpu temp: 58.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 1
Info:
  Memory: total: 32 GiB note: est. available: 30.96 GiB used: 4.51 GiB (14.6%)
  Processes: 308 Uptime: 25m Shell: Bash inxi: 3.3.35
boot
  • 1 个回答
  • 29 Views
Martin Hope
MartHR
Asked: 2025-01-22 17:23:21 +0800 CST

ubuntu 24.04.1 TL-WN823N 驱动程序

  • 5

我正在尝试在 ubuntu 24.04.1 上编译 TP-Link TL-WN823N wifi 适配器的驱动程序,源代码来自 https://www.tp-link.com/en/support/download/tl-wn823n/#Driver, 按照 tp-link 说明

但是编译时会出现如下错误

TP-Link_Driver_Linux_series8_beta1/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/osdep_service_linux.h:299:15: error: ‘_timer’ {aka ‘struct timer_list’} has no member named ‘data’
  299 |         ptimer->data = (unsigned long)cntx;
      |               ^~
/home/aaa/Downloads/TP-Link_Driver_Linux_series8_beta1/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/osdep_service_linux.h:300:9: error: implicit declaration of function ‘init_timer’; did you mean ‘_init_timer’? [-Werror=implicit-function-declaration]
  300 |         init_timer(ptimer);
      |         ^~~~~~~~~~
      |         _init_timer

我联系了 TP-Link 的支持部门,咨询他们的产品,他们宣传说兼容 Linux,但被告知他们不支持 Linux

论坛上至少还有另一个答案,但针对的是较旧的内核。

lsusb(已插入适配器)显示

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 062a:4101 MosArt Semiconductor Corp. Wireless Keyboard/Mouse
Bus 001 Device 004: ID 2357:0109 TP-Link TL-WN823N v2/v3 [Realtek RTL8192EU]
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

dmsg 输出

$sudo dmesg | grep rtl8
[1196665.322540] usb 1-9: rtl8xxxu: Loading firmware rtlwifi/rtl8192eu_nic.bin
[1196666.149524] usbcore: registered new interface driver rtl8xxxu
[1196666.198142] rtl8xxxu 1-9:1.0 wlxa86e8407690a: renamed from wlan0

有人可以帮忙吗?

更新。尝试按照下面链接的步骤操作后,我遇到了问题

aaa@Cirrus:~/dev/wifi-driver/rtl8192eu-linux-driver$ sudo dkms add .
[sudo] password for aaa: 
Deprecated feature: REMAKE_INITRD (/home/aaa/dev/wifi-driver/rtl8192eu-linux-driver/dkms.conf)
Deprecated feature: REMAKE_INITRD (/usr/src/rtl8192eu-1.0/dkms.conf)
Creating symlink /var/lib/dkms/rtl8192eu/1.0/source -> /usr/src/rtl8192eu-1.0
aaa@Cirrus:~/dev/wifi-driver/rtl8192eu-linux-driver$ sudo dkms install tl8192eu/1.0
Sign command: /usr/bin/kmodsign
Certificate or key are missing, generating them using update-secureboot-policy...
Adding '/var/lib/shim-signed/mok/MOK.der' to shim:
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Error! Could not find module source directory.
Directory: /usr/src/tl8192eu-1.0 does not exist.
aaa@Cirrus:~/dev/wifi-driver/rtl8192eu-linux-driver$
tp-link
  • 1 个回答
  • 66 Views
Martin Hope
Emandudeguy
Asked: 2025-01-22 06:58:40 +0800 CST

Kubuntu 24.04 — 8265D2W Wi-Fi 卡出现问题。连接,但在系统负载较大的情况下显示“无可用连接”

  • 5

最近,我的“Legacy”定制 PC 出现了问题。我最近将 Wi-Fi 卡升级为 PCIe Intel 8265D2W 867mbps 无线 AC 卡。我将在文章末尾详细介绍我的完整规格。

基本上,似乎会发生以下模式:如果我不做任何会给 CPU 或 GPU 带来压力的事情,Wi-Fi 似乎可以正常工作,并且从未出现任何问题。但是,如果我尝试在主机上运行其他程序的同时打开虚拟机,或者尝试打开过去 10 年左右的现代视频游戏,或者通常同时运行一堆不同的程序,Wi-Fi 就会关闭,并且我的网络管理器会告诉我“没有可用连接”。无论我做什么,我都无法重新连接,除非我重新启动 PC。

根据 Linux Mint 论坛上的一个帖子,我被告知尝试sudo modprobe -r iwlwifi重新启动,然后sudo modprobe iwlwifi在启动时尝试。我注意到,在我需要输入该命令之前,Wi-Fi 在重新启动时处于活动状态。我尝试安装,backport-iwlwifi-dkms因为这是有关该问题的类似帖子中推荐的另一个解决方案。似乎没有任何区别——在负载下,无论我做什么,Wi-Fi 总是关闭。对我来说,复制该问题的一个简单方法是通过 steam 运行反恐精英 2——这似乎总是在不到 5 分钟的时间内杀死 Wi-Fi 卡。我认为这与省电有关。如果你们不介意的话,我将复制该问题并在此处发布我的 ksystemlog 结果,请耐心等待。

好的,这里是来自 ksystemlog 的 journald 系统日志的链接(这是 Wi-Fi 卡“死机”后总是需要我重新启动后的读数): https ://paste.ubuntu.com/p/6j4RyM8JwS/

我的系统规格如下:

操作系统:Kubuntu 24.04 KDE Plasma 版本:5.27.11 KDE Frameworks 版本:5.115.0 Qt 版本:5.15.13 内核版本:6.11.0-1012-oem(64 位) 图形平台:X11 处理器:8 × AMD FX(tm)-8350 八核处理器 内存:31.2 GiB RAM(DDR3 2133mhz) 图形处理器:AMD Radeon RX 590 GME 8gb

我还应该说我有一个 700w Coolermaster PSU 和 2tb SATA SSD。

这是我modinfo iwlwifi在终端中输入的结果,因为我注意到英特尔帮助论坛通常会要求提供以下信息: https: //paste.ubuntu.com/p/B4YNJCZ6Yz/

networking
  • 1 个回答
  • 55 Views
Martin Hope
engr_john
Asked: 2025-01-21 18:52:11 +0800 CST

如何在/opt 下创建用于 Pycharm 安装的文件夹

  • 5

我在 Windows 主机上的虚拟机下运行 Ubuntu 20.04。

我需要知道我们通常在 Ubuntu 中将程序安装在哪里。如果安装属于所有用户,则在哪个目录中,如果安装仅属于特定用户,则在哪个目录中。

我想安装 Pycharm。我在一些网页上发现 Pycharm 需要安装在 /opt 文件夹下。

我尝试在 /opt 文件夹下为 Pycharm 安装创建一个新文件夹,但这不起作用。

请告诉我如何在 /opt 下创建一个新文件夹。

20.04
  • 1 个回答
  • 35 Views
Martin Hope
engr_john
Asked: 2025-01-21 16:01:01 +0800 CST

如何安装 net-tools

  • 5

我想ifconfig在虚拟机中运行 Ubuntu 中的命令。它要求我先运行,sudo apt install net-tools但我收到错误E: Unable to locate package net

请告诉我如何运行ifconfig来查找 IP 地址。

在此处输入图片描述

20.04
  • 1 个回答
  • 19 Views
Martin Hope
Neil Johnson
Asked: 2025-01-21 04:36:57 +0800 CST

如何将 Ubuntu 服务器 22.04 升级到 24.04?我收到错误“EFI 系统分区 (ESP) 不可用”[重复]

  • 6
这个问题已经有答案了:
无法在 DualBoot 上更新至 18.04 - “EFI 系统分区 (ESP) 不可用” (1 个答案)
昨天休息。

我正在尝试将 Ubuntu Server 从 22.04 升级到 24.04。我有 LTS,如果这很重要的话。这不是双启动系统。

当我尝试通过命令行或软件更新程序升级时,出现以下信息:


EFI 系统分区 (ESP) 不可用 您的 EFI 系统分区 (ESP) 未安装在 /boot/efi。请确保其配置正确,然后重试。


我应该等待软件更新程序来修复这个问题还是我现在可以做些什么?我这样说是因为其他用户报告了此升级的问题。

我下一步该怎么做?否则,请告诉我解决方案。

neil@Tensor:~$ [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
UEFI
neil@Tensor:~$ sudo parted -l

Model: ATA ST5000DM000-1FK1 (scsi)
Disk /dev/sda: 5001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  5001GB  5001GB  ext4


Model: ATA KINGSTON SA400M8 (scsi)
Disk /dev/sdb: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system     Name  Flags
 1      2097kB  214GB  214GB   ext4
 2      214GB   240GB  26.2GB  linux-swap(v1)        swap


Model: ATA ST2000DM008-2FR1 (scsi)
Disk /dev/sdc: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  2000GB  2000GB  ext4         primary


Model: Samsung SSD 980 PRO 1TB (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  538MB   537MB   fat32        EFI System Partition  boot, esp
 2      538MB   1000GB  1000GB  ext4


neil@Tensor:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=c976d11c-8cb7-409c-adf9-8d2bbc218331 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
#UUID=9b058488-9eb6-47eb-8bc1-76b4515f776a  /boot/efi       vfat    umask=0077      0       1
# nj /swapfile                                 none            swap    sw              0       0
# nj UUID=79E0-9995  /boot/efi       vfat    defaults      0       1 
#UUID=9b058488-9eb6-47eb-8bc1-76b4515f776a swap swap defaults, noatime 0 
neil@Tensor:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=65863028k,nr_inodes=16465757,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=13180964k,mode=755,inode64)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/nvme0n1p2 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=29429)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /run/qemu type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
/var/lib/snapd/snaps/bare_5.snap on /snap/bare/5 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/canonical-livepatch_264.snap on /snap/canonical-livepatch/264 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/canonical-livepatch_286.snap on /snap/canonical-livepatch/286 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/code_155.snap on /snap/code/155 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/code_165.snap on /snap/code/165 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core_16928.snap on /snap/core/16928 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core_17200.snap on /snap/core/17200 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core20_2318.snap on /snap/core20/2318 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core20_2434.snap on /snap/core20/2434 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core22_1439.snap on /snap/core22/1439 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core22_1722.snap on /snap/core22/1722 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core24_423.snap on /snap/core24/423 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/core24_609.snap on /snap/core24/609 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/firefox_3941.snap on /snap/firefox/3941 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/firefox_3972.snap on /snap/firefox/3972 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/gnome-3-38-2004_140.snap on /snap/gnome-3-38-2004/140 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/gnome-3-38-2004_143.snap on /snap/gnome-3-38-2004/143 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/gnome-42-2204_141.snap on /snap/gnome-42-2204/141 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/gnome-42-2204_172.snap on /snap/gnome-42-2204/172 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/gtk-common-themes_1535.snap on /snap/gtk-common-themes/1535 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/john-the-ripper_675.snap on /snap/john-the-ripper/675 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/john-the-ripper_692.snap on /snap/john-the-ripper/692 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/pdftk_9.snap on /snap/pdftk/9 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/snap-store_1017.snap on /snap/snap-store/1017 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/snap-store_1113.snap on /snap/snap-store/1113 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/snapd_23258.snap on /snap/snapd/23258 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/snapd-desktop-integration_253.snap on /snap/snapd-desktop-integration/253 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/snapd-desktop-integration_83.snap on /snap/snapd-desktop-integration/83 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/var/lib/snapd/snaps/zoom-client_230.snap on /snap/zoom-client/230 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
/dev/nvme0n1p2 on /var/snap/firefox/common/host-hunspell type ext4 (ro,noexec,noatime,errors=remount-ro)
/var/lib/snapd/snaps/zoom-client_242.snap on /snap/zoom-client/242 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,nodev,noexec,relatime,size=13180964k,mode=755,inode64)
nsfs on /run/snapd/ns/canonical-livepatch.mnt type nsfs (rw)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=13180960k,nr_inodes=3295240,mode=700,uid=1000,gid=1000,inode64)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
nsfs on /run/snapd/ns/snapd-desktop-integration.mnt type nsfs (rw)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdc1 on /media/neil/Data type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)
/var/lib/snapd/snaps/snapd_23545.snap on /snap/snapd/23545 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide)
nsfs on /run/snapd/ns/snap-store.mnt type nsfs (rw)

这是 blkid。哪个是 /boot/efi 的正确 UUID?

/dev/nvme0n1p1: UUID="79E0-9995" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="f71578b0-675a-4fc7-a0c1-a7ec62caa1d5"
/dev/nvme0n1p2: UUID="c976d11c-8cb7-409c-adf9-8d2bbc218331" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="95ade6cc-28a6-4cfc-86dc-d39611c182ca"
/dev/sdb2: UUID="9b058488-9eb6-47eb-8bc1-76b4515f776a" TYPE="swap" PARTUUID="773dbdaf-1d73-4748-b0a1-d38163e7de4c"
/dev/sdb1: LABEL="High Speed Disk" UUID="2cba7867-3e9a-406c-8901-f670f2efa071" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="79c834a0-e737-4391-952b-f1a788e6a221"
/dev/sdc1: LABEL="Data" UUID="58169010-144e-4f9c-8762-d9aac2597d95" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="primary" PARTUUID="500b66a1-1f3a-450e-9c8a-29f96191ae30"
/dev/sda1: LABEL="Backups" UUID="9969f95f-bd9e-4ea9-9bb5-207fd1088bbe" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="85510172-3534-4928-8ee3-98e8d29fa9f9"
upgrade
  • 1 个回答
  • 59 Views
Martin Hope
ROODAY
Asked: 2025-01-21 03:33:12 +0800 CST

如何使用 SSH 实际更改 Ubuntu 22.04 上的 DNS 设置

  • 6

我正在尝试明确设置我的 DNS 服务器,因为我想知道我的媒体服务器速度慢是否是由于糟糕的 Verizon DNS 造成的。但是我到处搜索,却找不到任何可行的方法。检查我的 DNS 时显示以下内容:

❯ resolvectl dns
Global: 1.1.1.1 1.0.0.1
Link 2 (eno2): 192.168.1.1

或者

❯ nmcli device show eno2 | grep IP4.DNS
IP4.DNS[1]:                             192.168.1.1

我的理解是我的 DNS 是通过 DHCP 设置的,但尝试使用它来更改resolvetl dns eno2 1.1.1.1它却无法持久,并且将其添加到也无法持久/etc/systemd/resolved.conf.d/dns_servers.conf:

[Resolve]
DNS=1.1.1.1 1.0.0.1

还尝试设置此文件/etc/systemd/network/eno2.network:

[Match]
Name=eno2

[DHCPv4]
UseHostname=no
UseDNS=no
UseNTP=no
UseDomains=no

[DHCPv6]
UseHostname=no
UseDNS=no
UseNTP=no

[Network]
DNS=1.1.1.1 1.0.0.1
Domains=cloudflare-dns.com

但那也不起作用。

我认为这是我的问题:

❯ cat /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

但是我不知道如何覆盖网络管理器。nmcli似乎什么也没做,或者也许我执行了错误的命令:

❯ nmcli con
NAME                UUID                                  TYPE      DEVICE
Wired connection 1  b28835af-2164-37f9-b4df-e185f17a54c4  ethernet  eno2
br-bfaa0d30981b     afe1cb8b-3d6e-454a-97f6-947f546e7114  bridge    br-bfaa0d30981b
docker0             5f24f23d-e6d9-4743-9f7e-2fc81dda21ff  bridge    docker0
Verizon_4M3LTJ      d40366ad-bdb0-49fe-9aa3-168aea6300a5  wifi      --
❯ sudo nmcli con mod "Wired connection 1" ipv4.dns "1.1.1.1 1.0.0.1"
❯ nmcli device show eno2 | grep IP4.DNS
IP4.DNS[1]:                             192.168.1.1
❯ sudo nmcli con mod "Wired connection 1" IP4.DNS "1.1.1.1 1.0.0.1"
Error: invalid or not allowed setting 'IP4': 'IP4' not among [connection, 802-3-ethernet (ethernet), 802-1x, dcb, sriov, ethtool, match, ipv4, ipv6, hostname, tc, proxy].
❯ resolvectl dns
Global: 1.1.1.1 1.0.0.1
Link 2 (eno2): 192.168.1.1

我目前无法物理访问这台机器,因此无法使用 UI 设置 DNS,也没有为 RDP 打开端口。但肯定有某种方法可以仅通过 CLI 进行设置吧?

networking
  • 2 个回答
  • 45 Views
Martin Hope
elect
Asked: 2025-01-21 01:51:15 +0800 CST

选项错误:无法与服务器协商密码

  • 5

完整错误行

OPTIONS ERROR:无法与服务器协商密码。如果要连接到此服务器,请将服务器的密码(“AES-256-CBC”)添加到 --data-ciphers(当前为“AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305”)。

规格:Ubuntu 24.10 x86

OpenVPN 2.6.12 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] [DCO] 库版本:OpenSSL 3.3.1 4 Jun 2024,LZO 2.10

下面/etc/netplan/90-NM-xxx.yml我看到了正确的vpn.cipher: "AES-256-CBC"

GUI 中也一样

在此处输入图片描述

如果我将其更改为vpn.data-cipher并重新启动 NM,那么我会得到:

连接:无法以交互方式连接:'GDBus.Error:org.freedesktop.NetworkManager.VPN.Error.BadArguments:属性“data-cipher”无效或不受支持'

那么它从哪里获取了错误的密码呢?

network-manager
  • 1 个回答
  • 89 Views
上一页
下一页

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve