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-231142

Terrance's questions

Martin Hope
Terrance
Asked: 2024-01-11 10:25:03 +0800 CST

Ubuntu 22.04.3、内核 6.5.0-14-generic 和 RTL8111/8168/8411 PCI Express 千兆位以太网控制器

  • 7

今天早上我安装的 2 个 Ubuntu 都22.04.3 LTS运行 HWE 升级到了 Kernel 6.5.0-14-generic。重新启动两个系统后,网卡均未RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller出现。启动到较旧的 6.2.0-39-generic 内核,网卡工作得很好。尝试重新安装r8168-dkms驱动程序后,安装驱动程序版本8.049.02失败。运行时sudo lshw -C network卡显示为UNCLAIMED。

PS 我不会为r8169我的r8168芯片组使用该驱动程序,因为它一开始工作正常,但过了一会儿就会出现不可预测的行为,有些甚至需要硬重启我的系统才能恢复接口。

drivers
  • 2 个回答
  • 526 Views
Martin Hope
Terrance
Asked: 2022-02-18 21:37:26 +0800 CST

启动时解绑和绑定驱动 20.04.3 LTS

  • 2

我的系统正在运行 20.04.3 LTS,我将它用作 Plex 媒体服务器(以及其他服务)。我正在使用绑定网络在系统上进行自适应负载平衡。当系统收到新的内核更新时,我遇到了系统问题。

系统中有2个网卡。一个在插槽中(RTL8169 PCI 千兆以太网控制器),另一个在板载(RTL8111/8168/8411 PCI Express 千兆以太网控制器)。我遇到的问题是 RTL8111/8168/8411 不喜欢 r8169 驱动程序(会发生不可预测的事情,例如无法与互联网通信)所以我必须运行以下命令来取消绑定 r8169 驱动程序并绑定r8168 驱动程序:

address=$(lspci | awk '/8168/ {print "0000:"$1}')
echo $address | sudo tee /sys/bus/pci/drivers/r8169/unbind
echo $address | sudo tee /sys/bus/pci/drivers/r8168/bind

运行这些命令后,驱动程序在lshw命令中正确显示,当为正确的卡设置正确的驱动程序时,我没有任何问题:

terrance@Intrepid:~$ sudo lshw -C network
  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 03
       serial: c8:3a:35:d6:ec:a0
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.048.00-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair slave=yes speed=1Gbit/s
       resources: irq:25 ioport:d800(size=256) memory:fdfff000-fdffffff memory:fdff8000-fdffbfff
  *-network
       description: Ethernet interface
       product: RTL8169 PCI Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 5
       bus info: pci@0000:03:05.0
       logical name: eth1
       version: 10
       serial: bc:5f:f4:79:66:fe
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 66MHz
       capabilities: pm bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.13.0-30-generic duplex=full latency=64 link=yes maxlatency=64 mingnt=32 multicast=yes port=twisted pair slave=yes speed=1Gbit/s
       resources: irq:20 ioport:e800(size=256) memory:febffc00-febffcff memory:febc0000-febdffff
  *-network
       description: Ethernet interface
       physical id: 1
       logical name: bond0
       serial: bc:5f:f4:79:66:fe
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=bonding driverversion=5.13.0-30-generic duplex=full firmware=2 ip=10.0.0.220 link=yes master=yes multicast=yes

这会持续到重新启动,直到下一次内核更新。但是,如果我在脚本中运行那些完全相同的命令,它会告诉我“没有这样的设备”

terrance@Intrepid:~/bin$ sudo ./driver_fix.bsh 
0000:02:00.0
tee: /sys/bus/pci/drivers/r8169/unbind: No such device
0000:02:00.0
tee: /sys/bus/pci/drivers/r8168/bind: No such device

什么是我可以使它永久化的最佳方法,以便它在启动期间进行此更改,或者仅在发生内核更新时更改?

谢谢!

networking
  • 1 个回答
  • 248 Views
Martin Hope
Terrance
Asked: 2021-11-22 10:14:11 +0800 CST

从 crontab 运行的 Firefox 94 声称“已经在运行,但没有响应”。

  • 3

我知道这里有或可能有类似的问题,但这个问题与firejailFirefox 无关,启动时也没有任何延迟。

操作系统信息:

Xubuntu 20.04
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
VERSION_ID="20.04"
$ uname -a
Linux terrance-ubuntu 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

在此处输入图像描述

我运行一个脚本crontab,它将启动我的 ADP 登录页面,并在一天中的特定时间让我进出。在 Firefox 94 发布之前,这曾经完美无缺。现在,我了解到对于远程 Mozilla 决定不再使用 X11 而是使用 D-Bus。对于我的生活,我无法弄清楚使用 D-Bus 而不是 X11 意味着什么,除了他们声称它更易于使用。我假设这可能是由于我不使用的 Wayland。

如果我在特定时间从命令行终端运行以下脚本,它会完美运行,但如果我从命令行终端运行脚本,则会crontab收到以下消息:

在此处输入图像描述

脚本(仍在进行中):

#!/bin/bash

#This function checks the path of the app on a Mac.
realpath1() {
        [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}

#This function matches the day of the week and returns 0 if match, 1 if weekend.
function dowcheck(){
case " ${daysofweek[@]} " in
    *\ ${DOW}\ *)
        return 0;;
    *)
        return 1;;
esac
}

#This function matches if the clock in or out time is a match with 0 or 1 if not.
function timecheck(){
case " ${timesofday[@]} " in
    *\ ${HM}\ *)
        return 0;;
    *)
        return 1;;
esac
}

#This function matches days off to today.  If a match return 0 meaning day off, 1 means not a day off.
function daysoffcheck(){
case " ${daysoff[@]} " in
    *\ ${daymdy}\ *)
        return 0;;
    *)
        return 1;;
esac
}

#Check the OS type.
OS_TYPE=$(uname -a | awk '{print $1}')
if [[ ${OS_TYPE} == "Linux" ]]; then
        OS=$(grep -i ^name= /etc/*release | awk -F= '{print $2}' | sed 's/\"//g')
else
        OS=$(system_profiler SPSoftwareDataType | awk '/System Version:/ {print $3}')
fi
if [ "${OS}" = "CentOS Linux" ]; then
        OS=Fedora
fi

#Set working directories and set Display for running in a CRONJOB.
case $OS in
        macOS) apppath=/Applications/Firefox.app/Contents/MacOS
        export DISPLAY="/private/tmp/com.apple.launchd.*/org.macosforge.xquartz:0"
                PWD=$(dirname $(realpath1 $(which $0)));;
        *) apppath=/usr/bin
        DM=$(/usr/bin/basename $(/bin/cat /etc/X11/default-display-manager))
        case $DM in
            lightdm)
                export DISPLAY=:0;;
            gdm3)
                grep -E "# AutomaticLogin|AutomaticLoginEnable = false" /etc/$DM/*.conf >/dev/null && export DISPLAY=:1 || export DISPLAY=:0;;
            *);;
        esac
                PWD=$(dirname $(realpath $(which $0)));;
esac

#Set variables for matching functions.
DOW=$(date +%a)
HM=$(date +%H:%M)
daymdy=$(date +%m-%d-%Y)
#If today is newer than day off remove last day off.
if [[ "${daymdy}" > "$(head -1 $PWD/daysoff.txt)" ]]; then
    sed -i '1d' $PWD/daysoff.txt
fi

#Declare arrays.
declare -a daysofweek=('Mon' 'Tue' 'Wed' 'Thu' 'Fri')
declare -a timesofday=('08:00' '12:00' '12:30' '16:30')
declare -a inout=('in' 'out for lunch' 'in from lunch' 'out for the day')
declare -a daysoff=($(cat $PWD/daysoff.txt))

#Get in or out.
for i in "${!timesofday[@]}"; do
    if [[ "${timesofday[$i]}" == "${HM}" ]]; then
        inorout="${inout[$i]}";
    fi;
done

#Run functions and return 0 or 1.
daysoffcheck
doff=$?
dowcheck
dow=$?
timecheck
time=$?

#Finish up and send information or launch Firefox if need be.
if [[ $doff != "1" ]]; then
        echo "Today is a day off!  Why are you trying to clock in?"
        exit 1
elif [[ $dow != "0" ]]; then
        echo "It's the weekend!  Why are you trying to clock in?"
        exit 1
elif [[ $time != "0" ]]; then
        echo "It is $DOW at $HM.  It is not time to clock in or out."
        exit 1
else
        echo "It's ${HM}. Time to clock ${inorout}." | mail -s "Time clock" mynumber@tmomail.net
        echo "It's ${HM}. Time to clock ${inorout}." | mail -s "Time clock" myemail@gmail.com 
        xdotool mousemove --sync 677 1011
        $apppath/firefox --new-tab https://workforcenow.adp.com/workforcenow/login.html &
        $PWD/clock_in_out.bsh
        wait
fi

如果有人有任何想法可以让 Firefox 像在 94 版之前的 X11 一样与 D-Bus 一起工作,我将不胜感激!

firefox
  • 1 个回答
  • 296 Views
Martin Hope
Terrance
Asked: 2020-09-11 20:54:18 +0800 CST

Xubuntu 18.04 / 20.04 的 xfce4-weather-plugin 停止工作

  • 11

Xubuntu 18.04 和现在 20.04 的 xfce4-weather-plugin 已停止工作并给出“无数据”。

plugins xfce xubuntu weather
  • 5 个回答
  • 7305 Views
Martin Hope
Terrance
Asked: 2020-01-20 07:30:29 +0800 CST

Ubuntu 18.04.3 LTS 和 NVIDIA 卡低分辨率

  • 0

这是当您在高于 390 驱动程序以及 18.04.3 LTS 时使用图形驱动程序 PPA 时的问答。


我正在运行 Ubuntu 18.04.3,并且我有一个 NVIDIA GeForce GTX 750 Ti。我的视频驱动程序目前是nvidia-driver-440我从Graphics Drivers PPA安装的,我没有使用ubuntu-drivers autoinstall驱动程序。

最近我的内核更新到了5.3.0-26-generic,我的视频分辨率现在停留在 640x480。看起来好像我的视频驱动程序已安装,但没有与内核一起加载。

有没有什么办法解决这一问题?

nvidia kernel 18.04
  • 2 个回答
  • 1713 Views
Martin Hope
Terrance
Asked: 2018-09-21 14:11:25 +0800 CST

如何在 Ubuntu 中安装 NVIDIA 和 CUDA 驱动程序?

  • 54

编辑:我在下面为 Ubuntu 20.04 LTS 和 CUDA 11.1.1 添加了一个新答案。见下文。


我有一个带有 NVIDIA 卡的系统,与https://developer.nvidia.com/cuda-gpus相比,它的计算支持为 3.5+ 。如何在不从 NVIDIA 下载 .deb 文件的情况下在 Ubuntu 中安装 CUDA 和 NVIDIA 驱动程序?

nvidia cuda
  • 5 个回答
  • 134292 Views
Martin Hope
Terrance
Asked: 2018-05-07 10:01:54 +0800 CST

在 Ubuntu 18.04 LTS 中使用 Google Chrome 通过 CUPS 添加打印机时出现“未经授权”错误

  • 32

2019-01-09 更新: 请参阅下面的答案,因为有一种方法可以使用 CUPS 2.2.8 解决此问题。

2020-10-17 更新: 从 18.04 LTS 升级到 20.04 LTS 将修复它,因为它将 CUPS 的版本从 2.2.7(包含错误)升级到没有错误的版本 2.3.1。由于某些用户现在可能无法升级到 20.04 LTS,这对于 18.04 LTS 用户仍然非常有效。


我在这个系统上安装了 Ubuntu 18.04 LTS。当我尝试在 Chrome 浏览器中通过 http://localhost:631 的 CUPS 2.2.7 地址添加打印机时,我无法添加打印机,因为我不断获得未经授权。它从不要求登录。如何使用 Google Chrome 通过 CUPS 添加我的打印机?

顺便说一句,到目前为止,Firefox、Chromium 和其他浏览器似乎都可以在 CUPS 2.2.7 中添加打印机。这似乎是 CUPS 2.2.7 和 Google Chrome 之间的错误。

未经授权:输入您的用户名和密码或root用户名和密码以访问此页面。 如果您使用的是 Kerberos……

configuration printing google-chrome 18.04
  • 4 个回答
  • 16445 Views
Martin Hope
Terrance
Asked: 2015-08-27 22:39:57 +0800 CST

GRUB2 显示 Windows 7 或 Windows 恢复环境而不是 Windows 10

  • 9

这是我最近想出来的一个问答,所以我把答案贴在下面。

安装 Windows 10 后,每次我获得内核更新或运行时,update-grub2它总是显示Windows 7orWindows Recovery Environment而不是Windows 10. 我该如何永久解决这个问题?

14.04
  • 1 个回答
  • 6550 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