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
    • 最新
    • 标签
主页 / user-843820

xpt's questions

Martin Hope
xpt
Asked: 2024-07-30 02:27:30 +0800 CST

复制包时启动板出错--已发布

  • 4

我正在尝试将我的 Launchpad 包复制到新的 Noble 仓库,

  • 我首先尝试复制二进制包但失败了:
Target series: Noble
my-pkg 1.1.0-1 in jammy (binaries conflicting with the existing ones)
  • 然后我尝试复制源包但仍然失败:
Target series: Noble
my-pkg 1.1.0-1 in focal (same version already has published binaries in the destination archive)

这是错误的,因为第一次复制失败了,当我自己尝试“删除包”时我没有看到它。

我认为这或多或少是启动板内部错误,但我能做些什么呢?

updates
  • 1 个回答
  • 38 Views
Martin Hope
xpt
Asked: 2024-01-15 05:53:48 +0800 CST

Debian 软件包版本对比说明

  • 7

我对 Debian 软件包版本顺序有点困惑。

看看下面两个 Debian 软件包版本,为什么第一个版本<=比第二个版本高?

0-emacs-29.1.90~202401142128~ubuntu20.04.1
0-emacs-28.3-rc1~202302201437~ubuntu20.04.1

我认为 29 > 28 所以第一个应该是最近的,不是吗?

package-management
  • 1 个回答
  • 325 Views
Martin Hope
xpt
Asked: 2023-02-19 14:17:21 +0800 CST

KUbuntu 22.04.1, fcitx 中文输入开箱无法触发

  • 5

第一次使用 KUbuntu (22.04.1 LTS);以前用过Mate & LUbuntu,fcitx中文输入一直没问题。然而,

使用 KUbuntu 22.04.1 LTS,我的fcitx中文输入无法立即使用——我根本无法触发它。

这证明我的fcitx中文输入法安装没问题。

  • 在我的 KUbuntu 22.04.1 启动时,有三个fcitx相关进程(由 标识ps -eaf --width 200 | grep [f]citx):
    • /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --config-file /usr/share/fcitx/dbus/daemon.conf
    • /usr/bin/fcitx-dbus-watcher unix:abstract=/tmp/dbus-tW4A6FKmPk,guid=e64c862b67b86932863ee75863f14a15 5504
    • fcitx
  • 如果我一个一个地杀掉他们,然后fcitx在下面手动重新开始
    LANG=zh_CN.utf8 urxvt -ls &
    ,那么一切都很好。触发热键再次起作用。

更新:IBus Pannel ——我的 KUbuntu 22.04.1 启动时任务栏上也有一个图标,quit每次启动后我都必须手动打开它。

所以这让我怀疑fcitx我的 KDE 启动的设置有误,我正试图修复这个问题。(我的正常(桌面)工作环境是英语,使用LANG=C. Thefcitx仅用于/用于在 LANG='zh_CN.utf8' 环境下/使用 LANG='zh_CN.utf8' 环境启动的任何应用程序,如rxvt-unicodechrome 等)

如何解决?请帮忙。

$ im-config -m
default
missing
ibus

ibus

$ LANG=C im-config -m
default
missing
ibus

ibus

$ LANG=C im-config -m | tail -3 | hexdump -C
00000000  69 62 75 73 0a 0a 69 62  75 73 0a                 |ibus..ibus.|

$ LANG='zh_CN.utf8' im-config -m
default
missing
ibus
fcitx5
ibus

最后更新:

我找到了同时安装 ibus 和 fcitx 的根本原因。这就是为什么首先是一个坏主意的原因:

在此处输入图像描述

我之所以同时安装这两种输入法是因为zoom我需要使用,从这两个页面中我可以看出这样的要求是真的没有必要:

  1. zoom .deb 文件中恼人的 ibus 依赖
  2. 即使在 KDE 和 XFCE 上,Zoom Debian Linux 软件包也需要 ibus

以下是一些引述:

  • 用于下载 zoom 的 .deb 文件在“Depends:”字段中随 ibus 一起提供。对于许多 Debian/Ubuntu 用户来说,这是一个问题,我将尝试解释原因。
  • 不用说,到目前为止,我对 Zoom 回应我的请求的方式感到非常失望。
  • 我正在维护 Debian 和 Ubuntu 中使用的工具 (im-config),以便于配置输入法,例如 IBus。正是在这个角色中,我收到了关于 Zoom .deb 文件中 ibus 依赖性的投诉,我就是在这个角色中出现的。
  • 我是 [email protected](我的官方 Debian 联系地址),他是维护 Debian 的 ibus 软件包的核心成员。(Gunnar 也是另一位核心成员。他积极参与 Ubuntu 方面的工作。)
  • 他的请求不仅仅是“用户请求”。这应该被视为 GNU/Linux 发行版对 ZOOM 的要求。
  • 如果 Zoom 为 Debian/Ubuntu (deb-packages) 提供了技术上合理的内容,ZOOM 应该听取我们的意见。
  • 关于这方面的任何更新?刚刚安装了 zoom,也得到了这个。这种依赖很烦人而且毫无价值
  • 这个“在远程机器上进行远程控制”的借口可悲地缺乏理解“Depends:”字段应该如何用于 Debian 软件包。这应该只用于在所有安装环境下都需要的包。针对特定环境执行此操作被认为是粗鲁的工程。
  • 我是一名 Debian 开发人员,因此熟悉 Debian 软件包(又名“.deb”文件)的约定和要求。按照目前的定义,Zoom Debian 包使用关系字段(例如 Depends:)的方式违反了 Debian 打包政策,概述如下:7. 声明包之间的关系 — Debian 政策手册 v4.6.1.1

然而所有的请求都被置若罔闻,1个月后,“这个话题在最后一次回复后30天自动关闭。不再允许新的回复。” 结果来自链接 2 的评论:

  • Zoom Debian Linux 软件包需要 ibus。但 ibus 是 GNOME 桌面的一部分。因此,在 KDE Plasma 下安装 zoom_amd64.deb 会破坏键盘支持,因为 ibus 和相关依赖项在 KDE 下不起作用。
  • 是的,我正在安装新的 Zoom 并突然依赖 ibus、libegl1-mesa、libxcb、python3-ibus、ibus-gtk 和其他几个。我使用的是几个月前的 Linux 发行版,因此没有理由无法安装 Zoom。我不需要 ibus,它会破坏我的设置。这太疯狂了。. . 当像 Zoom 这样价值数十亿美元的巨人聘请低于标准的开发人员来打包他们的软件时,这可以说是软件公司中最重要的工作——他们活该失败!我阅读了关于同一主题的支持论坛,支持人员完全无法理解这个问题的重要性,这令人难以置信。ibus 的 Debian 维护者发帖试图提供帮助,但 Zoom 工作人员忽略了他们。我认为这是 Zoom 的一次巨大失败,也是对各地 Linux 用户的一记耳光。
kubuntu
  • 1 个回答
  • 34 Views
Martin Hope
xpt
Asked: 2023-02-17 10:48:00 +0800 CST

贡献和非免费的 apt 资源从 jammy 消失了吗?

  • 5

我曾经将contrib&添加non-free到我的 apt 资源中,但发现它们已经从 jammy 中消失了:

$ sudo apt update
W: Skipping acquire of configured file 'contrib/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't have the component 'contrib' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't have the component 'non-free' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'contrib/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't have the component 'contrib' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free/binary-amd64/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't have the component 'non-free' (component misspelt in sources.list?)

然后,如何解决常见问题,例如:

E: Package 'rar' has no installation candidate
E: Package 'unrar' has no installation candidate
$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ jammy main contrib non-free restricted universe
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main contrib non-free restricted universe

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
apt
  • 1 个回答
  • 26 Views
Martin Hope
xpt
Asked: 2022-04-04 13:13:22 +0800 CST

如何在启动时禁用 zram

  • 0

如何在启动时禁用 zram?

我发现的主要是

swapoff -a
rmmod zram

但重启后它又回来了

我发现在不同的地方会问这样的问题,例如,

  • https://forum.garudalinux.org/t/disable-zram/1580/5
  • https://github.com/VR-25/zram-swap-manager/issues/2
  • https://forum.xda-developers.com/t/how-to-disable-zram-permanently-at-boot.2946997/
  • https://www.reddit.com/r/LineageOS/comments/5v1xwl/how_to_disable_zram/

但似乎没有一个能够得到正确的回答。

boot
  • 1 个回答
  • 812 Views
Martin Hope
xpt
Asked: 2021-11-30 12:14:24 +0800 CST

使 fcitx 在 Lubuntu 21.10 下工作

  • 2

跟进让 fcitx 在 Lubuntu 18.04 下工作

我有fcitx我相信的所有包裹:

 fcitx_1:4.2.9.8-3
 fcitx-bin_1:4.2.9.8-3
 fcitx-config-common_0.4.10-3
 fcitx-config-gtk_0.4.10-3
 fcitx-data_1:4.2.9.8-3
 fcitx-frontend-all_1:4.2.9.8-3
 fcitx-frontend-gtk2_1:4.2.9.8-3
 fcitx-frontend-gtk3_1:4.2.9.8-3
 fcitx-frontend-qt5:amd64_1.2.5-1ubuntu2
 fcitx-googlepinyin:amd64_0.1.6-4build1
 fcitx-module-dbus_1:4.2.9.8-3
 fcitx-module-kimpanel_1:4.2.9.8-3
 fcitx-module-lua_1:4.2.9.8-3
 fcitx-module-x11_1:4.2.9.8-3
 fcitx-modules_1:4.2.9.8-3
 fcitx-ui-classic_1:4.2.9.8-3
 fcitx5-module-quickphrase-editor:amd64_1.2.5-1ubuntu2
 libfcitx-config4:amd64_1:4.2.9.8-3
 libfcitx-core0:amd64_1:4.2.9.8-3
 libfcitx-gclient1:amd64_1:4.2.9.8-3
 libfcitx-qt5-1:amd64_1.2.5-1ubuntu2
 libfcitx-qt5-data_1.2.5-1ubuntu2
 libfcitx-utils0:amd64_1:4.2.9.8-3

但我的 fcitx 配置仍然显示空方法:

在此处输入图像描述

我都试过了fcitx-config-gtk3和fcitx-configtool。两者都显示空方法。

因此,使用热键尝试调用/触发fcitx根本没有效果。

有人可以帮忙吗?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:        21.10
Codename:       impish
lubuntu
  • 1 个回答
  • 269 Views
Martin Hope
xpt
Asked: 2021-11-16 15:36:33 +0800 CST

无法更改安装 ntfs 驱动器的所有权

  • 0

为什么我无法更改挂载 ntfs 驱动器的所有权?

我在我的文件中给出uid=1000,gid=1000,了 etc /etc/fstab,但发现它不起作用。所以我在命令行上测试它:

root@host:~# mount | grep /mnt/tmp1 | wc
      0       0       0

root@host:~# mount -o uid=1000 /dev/nvme0n1p4 /mnt/tmp1/

root@host:~# mount | grep /mnt/tmp1
/dev/nvme0n1p4 on /mnt/tmp1 type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

root@host:~# umount /mnt/tmp1

root@host:~# mount -o user_id=1000 /dev/nvme0n1p4 /mnt/tmp1/

root@host:~# mount | grep /mnt/tmp1
/dev/nvme0n1p4 on /mnt/tmp1 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:        21.10
Codename:       impish

$ apt-cache policy mount
mount:
  Installed: 2.36.1-8ubuntu1
  Candidate: 2.36.1-8ubuntu2
  Version table:
     2.36.1-8ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu impish-updates/main amd64 Packages
 *** 2.36.1-8ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu impish/main amd64 Packages
        100 /var/lib/dpkg/status

我错过了什么吗?(这是 Ubuntu 21.10 impish)
为什么我不能更改挂载 ntfs 驱动器的所有权?

permissions
  • 2 个回答
  • 523 Views
Martin Hope
xpt
Asked: 2021-05-03 09:25:07 +0800 CST

如何在预置文件中使用类

  • 0

跟进可能在预置文件中使用变量?和https://help.ubuntu.com/lts/installation-guide/s390x/apbs02.html,其中说:

除了指定 url,您还可以指定不直接影响 debian-installer 本身行为的设置,但可以传递给使用 preseed/run 在加载的 preseed 文件中指定的脚本。目前,唯一的例子是 auto-install/classes,它有一个别名 classes。这可以这样使用:

auto url=example.com classes=class_A;class_B

例如,这些类可以表示要安装的系统类型或要使用的本地化。

所以假设我在引导提示符下输入了以下内容:

auto url=example.com classes=class_A;class_B

如何利用传入classes的我的预置文件?

system-installation
  • 1 个回答
  • 196 Views
Martin Hope
xpt
Asked: 2020-06-07 21:03:20 +0800 CST

如何判断 snap 将安装哪些软件包

  • 1

我刚刚发现 chromium 在我的 Ubuntu 20.04 中作为 snap 包发布,我想知道还有什么是这样的。所以,

如何判断哪些包来自 snap?即,我想要一个在尝试使用 APT 安装时实际安装 Snaps 的软件包列表。

package-management apt snap
  • 1 个回答
  • 342 Views
Martin Hope
xpt
Asked: 2019-08-08 19:51:32 +0800 CST

如何在 Ubuntu 18+ 中重启 Sudo 服务

  • 5

从“ sudoers 添加用户后是否需要重启? ” 可以看出重启sudo服务是必要的,还是重启。但是,适用于 Ubuntu 14.04 的推荐方式不再适用于 Ubuntu 18+:

$ sudo service sudo restart
Failed to restart sudo.service: Unit sudo.service is masked.

解决方案?

sudo 18.04
  • 2 个回答
  • 9854 Views
Martin Hope
xpt
Asked: 2019-08-08 19:22:39 +0800 CST

配置 sudo 以保留 SSH_AUTH_SOCK

  • 1

sudo配置以保留SSH_AUTH_SOCK环境变量的正确方法是什么?

我在互联网上遵循一些指南,但它对我不起作用:

$ printenv | grep SSH
SSH_AUTH_SOCK=/tmp/ssh-Zy2v8uDtJxPw/agent.2628
SSH_AGENT_PID=2629

$ sudo printenv | grep SSH | wc 
      0       0       0

我以为我需要重新启动sudo服务,但是 如何在 Ubuntu 16.10 上重新启动 Sudo 服务说不需要。

ssh sudo environment-variables
  • 1 个回答
  • 1096 Views
Martin Hope
xpt
Asked: 2019-07-29 13:48:53 +0800 CST

grub-install:错误:不会继续使用阻止列表

  • 6

按照@mook765,跟进将 Grub2 安装到 PBR,并打开一个新问题以提供引导信息摘要的链接:

http://paste.ubuntu.com/p/SnT6Tcdmqk/

问题又来了:

% grub-install /dev/sdc5
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists

即,grub-install拒绝继续使用阻止列表,说“文件系统'ext2'不支持嵌入”。但是,我的不是ext2文件系统,而是ext4,它不需要 fsck:

$ mount | grep /dev/sdc5
/dev/sdc5 on /mnt/osp type ext4 (rw,noatime,nodiratime,data=ordered)

% umount /dev/sdc5
umount: /dev/sdc5: not mounted.

% fsck.ext4 /dev/sdc5
e2fsck 1.44.1 (24-Mar-2018)
osp: clean, 115049/513072 files, 897251/2048287 blocks

为了您的方便,这里是 boot-info-summary 中的相关部分:

sdc5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  Grub2 (v1.99-2.00)
    Boot sector info:  Grub2 (v1.99-2.00) is installed in the boot sector of 
                       sdc5 and looks at sector 34172346 of the same hard 
                       drive for core.img, but core.img can not be found at 
                       this location.
    Operating System:  Ubuntu 18.04.2 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab 
                       /boot/extlinux/extlinux.conf 
                       /boot/grub/i386-pc/core.img

修正:

好吧,让我解释一下我的配置。

  • 我不用lilo来启动我的系统。我放入 mbr 的唯一原因lilo是,它具有能够直接从扩展分区引导的优点,而不是仅从主分区引导。
  • 是的,我有 4 个 MBR,即 4 个 HD,但所有 HD 的设置都相同——它将从活动分区启动,*在fdisk -l输出中显示为“”,这要归功于 mbr 中的 lilo。事实上,任何普通的 MBR 都可以,因为我所有的活动分区都是主分区,而不是扩展分区。但我只是保持我的选择开放。
  • 任何 HD 的活动分区都由extlinux. 从那里,我从它的启动菜单链接加载我想要启动的任何内容。
  • 正常的 Linux 分区也可以通过 引导extlinux,但不知怎的,我无法通过/dev/sdc5引导extlinux,所以我切换到grub2,它之前一直可以正常引导。
  • 当我尝试使 USB 分区可引导时,问题就开始了,在我之前的问题中,“将 grub2 作为引导加载程序从分区 B 中的操作系统安装到分区 A 上的操作系统”。
  • 现在分区 B 和分区 A 都不能再启动了。
  • 为了全面披露,分区 B 和分区 A 都是从我仔细安装和修剪的 LUbuntu 系统恢复的。这种“恢复”是我无法通过 启动它的主要原因extlinux,我怀疑,但无法证明。
  • Legacy grub 是一个陈旧的分区/操作系统,我已经多年甚至 10 多年没有接触过,但是,
  • grub4dos 是我在 USB 磁盘上新安装的。它是可引导的,它允许我使用我理解的简单语法将引导链接到我想要的任何东西。即,它与我当前的系统启动方式无关,因为我可能随时将其分离。
grub2 boot partitioning
  • 2 个回答
  • 18232 Views
Martin Hope
xpt
Asked: 2019-06-30 09:01:16 +0800 CST

如何删除系统语言环境

  • 7

如何删除系统语言环境,与如何删除不必要的语言环境??

我最近收到以下错误:

locale: Cannot set LC_ALL to default locale: No such file or directory

我系统中唯一的语言环境: en

$ grep -r en /var/lib/locales/supported.d/*
/var/lib/locales/supported.d/local: en_US ISO-8859-1
/var/lib/locales/supported.d/local: en_US.UTF-8 UTF-8

$ locale -a | grep en
en_US
en_US.iso88591
en_US.utf8

但不是en,正如抱怨的那样perl:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LC_MEASUREMENT = "en",
        LC_PAPER = "en",
        LC_MONETARY = "en",
        LC_NAME = "en",
        LC_ADDRESS = "en",
        LC_NUMERIC = "en",
        LC_TELEPHONE = "en",
        LC_IDENTIFICATION = "en",
        LC_TIME = "en",
        LANG = "C"

所以我通过以下方式添加语言环境 en:

% locale-gen en
Generating locales (this might take a while)...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8...^C

我不想要上述任何语言环境(仅en_US),但现在我无法摆脱它们——我按照 https://serverfault.com/questions/394610/remove-a-locale-in-中的步骤操作ubuntu

但是当谈到最后一步时,我仍然得到:

% locale-gen
Generating locales (this might take a while)...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8...^C

如何删除所有上述语言环境并仅保留en_US?

结论与补充

/etc/locale.gen感谢 Gunnar 的回答,对于那些额外的语言环境,它确实是由 , 中的条目引起的。只是 FTR,这就是发生locale-gen en的变化/etc/locale.gen:

$ sed '/^#/d; /en/p;' /etc/locale.gen


en_AG UTF-8
en_AG UTF-8
en_AU.UTF-8 UTF-8
en_AU.UTF-8 UTF-8
en_BW.UTF-8 UTF-8
en_BW.UTF-8 UTF-8
en_CA.UTF-8 UTF-8
en_CA.UTF-8 UTF-8
en_DK.UTF-8 UTF-8
en_DK.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
en_HK.UTF-8 UTF-8
en_HK.UTF-8 UTF-8
en_IE.UTF-8 UTF-8
en_IE.UTF-8 UTF-8
en_IL UTF-8
en_IL UTF-8
en_IN UTF-8
en_IN UTF-8
en_NG UTF-8
en_NG UTF-8
en_NZ.UTF-8 UTF-8
en_NZ.UTF-8 UTF-8
en_PH.UTF-8 UTF-8
en_PH.UTF-8 UTF-8
en_SC.UTF-8 UTF-8
en_SC.UTF-8 UTF-8
en_SG.UTF-8 UTF-8
en_SG.UTF-8 UTF-8
en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8
en_ZA.UTF-8 UTF-8
en_ZA.UTF-8 UTF-8
en_ZM UTF-8
en_ZM UTF-8
en_ZW.UTF-8 UTF-8
en_ZW.UTF-8 UTF-8

作为比较,这是默认的样子(即,没有上述任何额外的语言环境):

$ sed '/^#/d;' /etc/locale.gen; echo ---


---
configuration system locale removing
  • 3 个回答
  • 3779 Views
Martin Hope
xpt
Asked: 2019-06-25 14:06:51 +0800 CST

使用 debootstrap 安装更多软件包

  • 2

debootstrap是将 Debian/Ubuntu 基础系统安装到另一个已安装系统的子目录中的工具。

安装日志结束如下:

. . . 
I: Validating xxd 2:8.1.0320-1ubuntu3
I: Validating xz-utils 5.2.4-1
I: Validating zlib1g 1:1.2.11.dfsg-1ubuntu2
I: Chosen extractor for .deb packages: dpkg-deb
I: Extracting base-files...

所以在我看来,唯一的包debootstrap提取是base-files,对吧?

有没有办法debootstrap提取/安装更多的包?特别是,我发现debootstrap根本没有安装 linux 内核。我可以以某种方式让debootstrap安装 linux 内核吗?

system-installation kernel debootstrap
  • 1 个回答
  • 2499 Views
Martin Hope
xpt
Asked: 2019-03-04 15:21:19 +0800 CST

NetworkManager 不更新 /var/run/networkmanager/resolv.conf

  • 0

我的 NetworkManager 没有写入/var/run/networkmanager/resolv.conf并且NetworkManager 没有填充 resolv.conf不是我的情况的答案,因为我不使用resolvconf. 更多详情如下:

我将管理我的以太网从 NetworkManager 切换/etc/network/interfaces到了 NetworkManager,它以某种方式永远不会写入/var/run/networkmanager/resolv.conf:

$ nmcli d  
DEVICE  TYPE      STATE      CONNECTION  
eth0    ethernet  connected  Wired connection 1
lo      loopback  unmanaged  --          

$ ls /var/run/NetworkManager/resolv.conf
ls: cannot access '/var/run/NetworkManager/resolv.conf': No such file or directory

$ ls /var/run/nm-dns-dnsmasq.conf
ls: cannot access '/var/run/nm-dns-dnsmasq.conf': No such file or directory

当我/etc/network/interfaces使用resolv.conf.

这是我的NetworkManager.conf:

cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
dns=dnsmasq

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

有些答案说我应该dns=dnsmasq在那里,但有些人说我不应该。总而言之,我仍然对如何更新 NetworkManager 感到困惑/var/run/networkmanager/resolv.conf。

更新,更多信息:

$ resolvectl status | grep DNS
-su: resolvectl: command not found

$ dpkg -l '*dns*' | grep 'ii *dns'
ii  dns-root-data  2018013001   all          DNS root data including root zone
ii  dnsmasq        2.79-1       all          Small caching DNS proxy and DHCP/
ii  dnsmasq-base   2.79-1       amd64        Small caching DNS proxy and DHCP/
ii  dnsutils       1:9.11.3+dfs amd64        Clients provided with BIND

$ dpkg -l '*resolv*' | grep ii || echo no resolvconf
no resolvconf

$ ls -al /etc/resolv.conf
-rw-r--r-- 1 root root 79 2019-03-03 18:42 /etc/resolv.conf

$ host 8.8.8.8 
8.8.8.8.in-addr.arpa domain name pointer google-public-dns-a.google.com.

$ host www.ebay.com
www.ebay.com is an alias for slot9428.ebay.com.edgekey.net.
slot9428.ebay.com.edgekey.net is an alias for e9428.b.akamaiedge.net.
e9428.b.akamaiedge.net has address 104.93.181.25

$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

更新2。

  • 这不是普通的 Ubuntu 安装,而是我自定义的全新安装(不是从以前版本的升级)。我删除了resolvconf自己,因为我正在使用/etc/network/interfaces,并且不希望我/etc/resolv.conf一直在改变。也许这就是罪魁祸首,NetworkManager 不能没有resolvconf?
  • 我的全部意图是“用 dnsmasq 替换 systemd-resolved ”(我使用 18.04 LiveCD 练习过,它有resolvconf),并将其用于我的 LAN DNS 服务器。嗯,也许在那种情况下,我不需要 NetworkManager 一直在改变我/etc/resolv.conf的。

无论如何,以下是进一步调查的信息:

$ dpkg -l '*resolv*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  resolvconf     <none>       <none>       (no description available)

$ cat /run/resolvconf/resolv.conf
cat: /run/resolvconf/resolv.conf: No such file or directory

$ cat /run/systemd/resolve/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
. . . 
nameserver 64.71.255.204
nameserver 64.71.255.198
search hitronhub.home

$ cat /etc/netplan/*.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    eth0:
      addresses: [192.168.0.11/24, 192.168.0.10/24]
      gateway4: 192.168.0.1

$ ps auxc | grep resolv
systemd+ 23890  0.0  0.0  70608  1520 ?        Ss   Mar01   0:00 systemd-resolve

$ sudo lsof -i tcp:53
COMMAND     PID            USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
systemd-r 23890 systemd-resolve   13u  IPv4 47127798      0t0  TCP 127.0.0.53:domain (LISTEN)
dnsmasq   29822         dnsmasq    5u  IPv4 47935969      0t0  TCP 192.168.0.10:domain (LISTEN)
dnsmasq   29822         dnsmasq    7u  IPv4 47935971      0t0  TCP 192.168.0.11:domain (LISTEN)
dnsmasq   29822         dnsmasq    9u  IPv4 47935973      0t0  TCP localhost.myhost.org:domain (LISTEN)
dnsmasq   29822         dnsmasq   11u  IPv6 47935975      0t0  TCP [fe80::xxxx]:domain (LISTEN)
dnsmasq   29822         dnsmasq   13u  IPv6 47935977      0t0  TCP [2607:fea8:xxxx]:domain (LISTEN)
dnsmasq   29822         dnsmasq   15u  IPv6 47935979      0t0  TCP [fd00:xxxx]:domain (LISTEN)
dnsmasq   29822         dnsmasq   17u  IPv6 47935981      0t0  TCP ip6-localhost:domain (LISTEN)
networking network-manager dns ethernet
  • 1 个回答
  • 3992 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