I uninstalled Python with sudo apt remove python3
and it removed every package that depended on Python (I think).
Now I can't do anything on my system, including opening gnome-terminal. Is there a way to salvage this?
I uninstalled Python with sudo apt remove python3
and it removed every package that depended on Python (I think).
Now I can't do anything on my system, including opening gnome-terminal. Is there a way to salvage this?
The following excerpt from a Python 3 script "myscript" that is meant to detect the screen layout and refresh it using xrandr works fine when run with sudo /usr/local/bin/myscript
or /usr/local/bin/myscript
:
xrandr_cmd = Popen("xrandr", shell=True, stdout=PIPE, stderr=STDOUT)
However, when run as a result of the following udev rule:
ACTION="change", SUBSYSTEM="drm", ENV{HOTPLUG}=="1", RUN+="/usr/local/bin/myscript"
it fails, stating that xrandr has returned 1 with the message "Can't open display".
Does anyone know why xrandr would fail when run from a udev rule?
The full script, for those who are curious:
#! /usr/bin/env python3
import os
from subprocess import Popen, PIPE, STDOUT
def log(s):
home_dir = os.path.expanduser("~")
#with open (f"{home_dir}/monitor_script.log", "a+") as f:
with open (f"/home/vedantroy/monitor_script.log", "a+") as f:
f.write(s)
xrandr = "/usr/bin/xrandr"
xrandr_cmd = Popen(xrandr, shell=True, stdout=PIPE, stderr=STDOUT)
retval = xrandr_cmd.wait()
lines = map(lambda l: l.decode('ascii'), xrandr_cmd.stdout.readlines())
if retval != 0:
nl = "\n"
log(f"xrandr returned {retval} with output:\n{nl.join(lines)}")
else:
layout_cmds = [
# No monitors plugged in
f"{xrandr} --auto",
# Thinkpad T580
# Monitor plugged into HDMI port
# Monitor to right of laptop
f"{xrandr} --output HDMI2 --primary --auto --right-of eDP1"
]
layout = 0
for line in lines:
if "HDMI2 connected" in line:
layout = 1
break
layout_cmd_str = layout_cmds[layout]
layout_cmd = Popen(layout_cmd_str, shell=True)
retval = layout_cmd.wait()
if retval != 0:
log(f"{layout_cmd_str} returnd {retval}")
I am using a Dell XPS 13.
My laptop cannot connect to a wifi network after it disabled its support for b-range wifi and started exclusively using g/n range wifi. This makes me suspect that my laptop can't connect to wifi networks that only use g/n wifi ranges.
How do I enable my laptop to connect to g/n range wifi networks?
From these 2 posts:
Unable to connect to mixed b/g/n wifi network on Ubuntu
Cannot connect to WiFi Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
I suspect I need to update my wifi drivers. Should I do this, and if so, how?
Here is the output of sudo lshw -C network
:
*-network
description: Wireless interface
product: QCA6174 802.11ac Wireless Network Adapter
vendor: Qualcomm Atheros
physical id: 0
bus info: pci@0000:3a:00.0
logical name: wlp58s0
version: 32
serial: 9c:b6:d0:f3:3c:05
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=ath10k_pci driverversion=4.15.0-1018-oem firmware=WLAN.RM.4.4.1-00079-QCARMSWPZ-1 ip=192.168.50.154 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:140 memory:dc000000-dc1fffff
*-network:0 DISABLED
description: Ethernet interface
physical id: 2
logical name: virbr0-nic
serial: 52:54:00:9a:e1:95
size: 10Mbit/s
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s
*-network:1
description: Ethernet interface
physical id: 3
logical name: virbr0
serial: 52:54:00:9a:e1:95
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=192.168.122.1 link=no multicast=yes
I ran the following command:
sudo apt-get install --only-upgrade openssl
and the output was:
openssl is already the newest version (1.1.0g-2ubuntu4.1).
However, when I type openssl version -a
into the terminal, the output is:
OpenSSL 1.0.2o 27 Mar 2018
built on: reproducible build, date unspecified
platform: linux-x86_64
options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: /tmp/build/80754af9/openssl_1522162531585/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I/home/vedantroy/anaconda3/include -fdebug-prefix-map=/tmp/build/80754af9/openssl_1522162531585/work=/usr/local/src/conda/openssl-1.0.2o -fdebug-prefix-map=/home/vedantroy/anaconda3=/usr/local/src/conda-prefix -Wa,--noexecstack -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/home/vedantroy/anaconda3/ssl"
Furthermore, typing which openssl
outputs: /home/vedantroy/anaconda3/bin/openssl
.
It seems my system is using the conda installation of "openssl" instead of the one installed by apt-get
. How do I force my system to use the version of "openssl" that is installed by apt-get
?
I have an issue where my bluetooth randomly cuts out, like so:
I have read some existing Ask Ubuntu posts on this issue.
I followed this post: Bluetooth randomly cutting out in Ubuntu
and ran sudo apt install -y linux-oem
and restarted my computer, but I'm still having the error.
I also looked at this post "No Bluetooth found Plug in a dongle to use Bluetooth"
but the output of rfkill list all
was:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
What other fixes are there to this problem?