Sunday, August 6, 2023

No network connection on Kubuntu Plasma Desktop

sudo dhclient

ping 8.8.8.8

ip link

nmcli

nmcli dev status

sudo apt install plasma-nm

sudo apt install network-manager

sudo nano /etc/NetworkManager/NetworkManager.conf // didn't work out

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

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

change the line managed=false to managed=true // no effect

Add following:

[keyfile]

unmanaged-devices=none; OR for multiple devices

unmanaged-devices=none;your-device-name; // device name => ls /sys/class/net || ip link || nmcli

sudo service network-manager restart // didn't work

sudo systemctl restart NetworkManager

Failed to restart network-manager.service: Unit network-manager.service not found.

sudo apt reinstall network-manager

systemctl status NetworkManager

nmcli dev show // make sure device is managed

Reset Network Device Configuration:

sudo ifconfig device-name 0.0.0.0 down // didn't work

sudo ip addr flush dev device-name // didn't work

/etc/network/interfaces && /etc/sysconfig/network-scripts/ // Network Configuration Files

nmcli con show // list all existing NetworkManager connections names

nmcli con mod "Wired connection 1" ipv4.addresses ''
nmcli con mod "Wired connection 1" ipv4.gateway ''
nmcli con mod "Wired connection 1" ipv4.dns ''

nmcli con show 'Wired connection 1'

sudo systemctl restart NetworkManager

nmcli dev show  // look for state change

BEFORE => GENERAL.STATE:                          10 (unmanaged)

NOW => GENERAL.STATE:                          100 (connected (externally))

SOLVED! => NM works and connection is UP from the start

Reinstall drivers on Kubuntu in recovery mode

Ubuntu keyboard and mouse drives fail after upgrade:

sudo apt-get install -y xserver-xorg-input-all // reboot => also may solve other problems


sudo apt install nvidia-settings

If no internet connection in recovery mode or on Plasma Desktop

nmcli dev status

ping 8.8.8.8

sudo dhclient

Troubles with smartphone detection and other USB issues:

sudo apt reinstall mtp-tools

sudo apt reinstall libmtp*

sudo apt reinstall usb*

Network manager problems:

sudo apt install plasma-nm

sudo apt install network-manager

Show current Linux kernel name:

ls /boot

uname -r

uname -r -s -m -p -i -o

Linux 5.15.0-46-generic x86_64 x86_64 x86_64 GNU/Linux 

Reinstall Linux kernel:

sudo apt-get install --reinstall linux-image-$(uname -r)

Remove unused Linux kernel:

dpkg --list | grep linux-image // display a list of installed Linux kernel packages

sudo apt remove linux-image-5.4.0-90-generic // remove unused kernel

sudo apt remove linux-headers-VERSION*

sudo apt remove linux-modules-VERSION*

sudo apt remove linux-extra-VERSION*

Show info about system devices:

lscpu

lsblk

lsusb

lspci

sudo lshw

Saturday, August 5, 2023

Adding Python deadsnakes ppa repository on Kubuntu Linux

apt-cache policy python3

sudo add-apt-repository ppa:deadsnakes/ppa

https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa

MAKE SURE your Linux version is supported: https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/dists/

IF NOT, use latest supported version for ppa


sudo nano /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-jammy.list

deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ focal main
deb-src https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ focal main


sudo apt edit-sources // edit repositories

sudo nano /etc/apt/sources.list // edit repositories

ls /etc/apt/sources.list.d // list additional repositories files


/etc/apt/sources.list.d$ sudo dpkg --force-depends --purge libpython3.10-stdlib
dpkg: libpython3.10-stdlib:amd64: dependency problems, but removing anyway as you requested:
python3.10 depends on libpython3.10-stdlib (= 3.10.7-1ubuntu0.4).

(Reading database ... 254967 files and directories currently installed.)
Removing libpython3.10-stdlib:amd64 (3.10.7-1ubuntu0.4) ...
/etc/apt/sources.list.d$ sudo dpkg --force-depends --purge libpython3.10
dpkg: warning: ignoring request to remove libpython3.10 which isn't installed
/etc/apt/sources.list.d$ sudo dpkg --force-depends --purge libpython3.10-minimal
dpkg: libpython3.10-minimal:amd64: dependency problems, but removing anyway as you requested:
python3.10-minimal depends on libpython3.10-minimal (= 3.10.7-1ubuntu0.4).

(Reading database ... 254625 files and directories currently installed.)
Removing libpython3.10-minimal:amd64 (3.10.7-1ubuntu0.4) ...
Purging configuration files for libpython3.10-minimal:amd64 (3.10.7-1ubuntu0.4) ...
/etc/apt/sources.list.d$ sudo dpkg --force-depends --purge libpython3.10
dpkg: warning: ignoring request to remove libpython3.10 which isn't installed


/etc/apt/sources.list.d$ sudo apt install python3.10
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3.10 : Depends: python3.10-minimal (= 3.10.12-1+focal1) but 3.10.7-1ubuntu0.4 is to be installed
             Depends: libpython3.10-stdlib (= 3.10.12-1+focal1) but it is not going to be installed
python3.10-minimal : Depends: libpython3.10-minimal (= 3.10.7-1ubuntu0.4) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

sudo apt purge python3.10

sudo apt purge python3.10-minimal


sudo aptitude

https://packages.ubuntu.com/kinetic/libpython3.10-stdlib

sudo dpkg -i libmpdec3_2.5.1-2build2_amd64.deb

sudo dpkg -i libpython3.10-minimal_3.10.7-1ubuntu0.4_amd64.deb

sudo dpkg -i libpython3.10-stdlib_3.10.7-1ubuntu0.4_amd64.deb

sudo apt --fix-broken install


Spent lot't of time and failed...

Change the Python3 default version in Ubuntu

cd /usr/bin

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

sudo update-alternatives --config python // choose python version

python3 --version

Python 3.10.7


sudo apt-get install --reinstall ca-certificates

See Technical details about this PPA => Signing key: => Fingerprint:

https://askubuntu.com/questions/1459362/how-to-resolve-the-key-not-available-error-on-deadsnakes-ppa

https://www.rosehosting.com/blog/how-to-install-and-switch-python-versions-on-ubuntu-20-04/

https://unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu

https://askubuntu.com/questions/1239829/modulenotfounderror-no-module-named-distutils-util

Problems and glitches in Mozilla Firefox

Enter key creates space instead sending prompt in Firefox. On Google search page in search field Enter key enters space. Firefox ESR on Kubuntu Linux. Solution:

In my case disabling AdBlocker extension solved the problem => Disable on this site option.

Remove python3 - Python 3.11 on Ubuntu

ls /usr/bin/python* // list all installed python versions

[Bug]: RuntimeError: Couldn't Install Torch

Stable Diffusion----------------------------------------------------------------------------
./webui.sh --xformers

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on user user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
Python 3.11.4 (main, Jun  9 2023, 07:59:55) [GCC 12.3.0]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Installing torch and torchvision
/home/user/Downloads/stable-diffusion-webui/venv/bin/python3: No module named pip
Traceback (most recent call last):
  File "/home/user/Downloads/stable-diffusion-webui/launch.py", line 39, in <module>
    main()
  File "/home/user/Downloads/stable-diffusion-webui/launch.py", line 30, in main
    prepare_environment()
  File "/home/user/Downloads/stable-diffusion-webui/modules/launch_utils.py", line 311, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "/home/user/Downloads/stable-diffusion-webui/modules/launch_utils.py", line 113, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/home/user/Downloads/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118
Error code: 1
----------------------------------------------------------------------------Stable Diffusion

sudo rm /usr/bin/python3.11
sudo apt purge python3.11
usr/bin$ sudo apt remove python3.11-minimal

sudo find / -xdev -name python3.11*
sudo find / -xdev -name 'python3.11*' -exec rm -r {} \; // remove all found

sudo apt-get purge python3-uno
sudo apt-get install python3-uno

sudo apt-get purge python3.11-minimal python3.11 python3 python3-uno

sudo apt update -y && sudo apt upgrade -y
sudo apt --fix-broken install
sudo apt autoremove --purge *python* // remove all python packages

apt-cache policy python3

SOLUTION in my case:
sudo dpkg --force-depends --purge libpython3.11-stdlib
sudo dpkg --force-depends --purge libpython3.11
sudo dpkg --force-depends --purge libpython3.11-minimal
sudo apt --fix-broken install

AVOID creating conflicts by installing different kernel version updates!!!

sudo apt install -f --reinstall python3-minimal
sudo apt install -f --reinstall python3-pip
sudo apt install -f --reinstall python3
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt reinstall plasma-desktop
sudo apt reinstall kwin-x11

https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-ubuntu-22-04
https://askubuntu.com/questions/1402419/cant-remove-python-3-10-from-ubuntu-20-04lts
https://gist.github.com/zhensongren/811dcf2471f663ed3148a272f1faa957
https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/?expand_article=1
https://linuxhint.com/uninstall-python-ubuntu-22-04/
https://www.debugpoint.com/install-python-3-10-ubuntu/

Monday, July 31, 2023

Models are not shown in Stable Diffusion list

Check path to models and symlinks, if you have any.

/home/user/folder/stable-diffusion-webui/models/Stable-diffusion/

Saturday, July 15, 2023

Toshiba DT01ACA200 SMART

smartctl --all /dev/sda                    (Prints all SMART information)

smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.19.0-46-generic] (local build)

Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org


=== START OF INFORMATION SECTION ===

Model Family:     Toshiba 3.5" DT01ACA... Desktop HDD

Device Model:     TOSHIBA DT01ACA200

Serial Number:    #########

LU WWN Device Id: 5 000039 ff3e0f0aa

Firmware Version: MX4OABB0

User Capacity:    2,000,398,934,016 bytes [2.00 TB]

Sector Sizes:     512 bytes logical, 4096 bytes physical

Rotation Rate:    7200 rpm

Form Factor:      3.5 inches

Device is:        In smartctl database 7.3/5319

ATA Version is:   ATA8-ACS T13/1699-D revision 4

SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)

Local Time is:    Sat Jul 15 22:29:35 2023 EEST

SMART support is: Available - device has SMART capability.

SMART support is: Enabled


=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: FAILED!

Drive failure expected in less than 24 hours. SAVE ALL DATA.

See vendor-specific Attribute list for failed Attributes.


General SMART Values:

Offline data collection status:  (0x84) Offline data collection activity

                                        was suspended by an interrupting command from host.

                                        Auto Offline Data Collection: Enabled.

Self-test execution status:      (   0) The previous self-test routine completed

                                        without error or no self-test has ever

                                        been run.

Total time to complete Offline

data collection:                (14822) seconds.

Offline data collection

capabilities:                    (0x5b) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        Offline surface scan supported.

                                        Self-test supported.

                                        No Conveyance Self-test supported.

                                        Selective Self-test supported.

SMART capabilities:            (0x0003) Saves SMART data before entering

                                        power-saving mode.

                                        Supports SMART auto save timer.

Error logging capability:        (0x01) Error logging supported.

                                        General Purpose Logging supported.

Short self-test routine

recommended polling time:        (   1) minutes.

Extended self-test routine

recommended polling time:        ( 247) minutes.

SCT capabilities:              (0x003d) SCT Status supported.

                                        SCT Error Recovery Control supported.

                                        SCT Feature Control supported.

                                        SCT Data Table supported.


SMART Attributes Data Structure revision number: 16

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x000b   070   070   016    Pre-fail  Always       -       181274516

  2 Throughput_Performance  0x0005   139   139   054    Pre-fail  Offline      -       72

  3 Spin_Up_Time            0x0007   127   127   024    Pre-fail  Always       -       296 (Average 299)

  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       3238

  5 Reallocated_Sector_Ct   0x0033   001   001   005    Pre-fail  Always   FAILING_NOW 2005

  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0

  8 Seek_Time_Performance   0x0005   124   124   020    Pre-fail  Offline      -       33

  9 Power_On_Hours          0x0012   096   096   000    Old_age   Always       -       32025

 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       2840

192 Power-Off_Retract_Count 0x0032   097   097   000    Old_age   Always       -       4030

193 Load_Cycle_Count        0x0012   097   097   000    Old_age   Always       -       4030

194 Temperature_Celsius     0x0002   240   240   000    Old_age   Always       -       25 (Min/Max 14/52)

196 Reallocated_Event_Count 0x0032   001   001   000    Old_age   Always       -       2598

197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0


SMART Error Log Version: 1

ATA Error Count: 4

        CR = Command Register [HEX]

        FR = Features Register [HEX]

        SC = Sector Count Register [HEX]

        SN = Sector Number Register [HEX]

        CL = Cylinder Low Register [HEX]

        CH = Cylinder High Register [HEX]

        DH = Device/Head Register [HEX]

        DC = Device Command Register [HEX]

        ER = Error register [HEX]

        ST = Status register [HEX]

Powered_Up_Time is measured from power on, and printed as

DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,

SS=sec, and sss=millisec. It "wraps" after 49.710 days.


Error 4 occurred at disk power-on lifetime: 32022 hours (1334 days + 6 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 50 30 cd 73 08  Error: UNC at LBA = 0x0873cd30 = 141806896


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 50 28 30 cd 73 40 08      00:01:48.986  READ FPDMA QUEUED

  60 08 20 08 cd 73 40 08      00:01:45.998  READ FPDMA QUEUED

  60 08 68 00 cd 73 40 08      00:01:42.921  READ FPDMA QUEUED

  60 08 60 00 54 5a 40 08      00:01:42.861  READ FPDMA QUEUED

  60 08 58 f8 cc 73 40 08      00:01:39.840  READ FPDMA QUEUED


Error 3 occurred at disk power-on lifetime: 32022 hours (1334 days + 6 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 08 f0 cc 73 08  Error: UNC at LBA = 0x0873ccf0 = 141806832


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 08 68 f0 cc 73 40 08      00:01:32.621  READ FPDMA QUEUED

  ef 10 02 00 00 00 a0 08      00:01:32.600  SET FEATURES [Enable SATA feature]

  27 00 00 00 00 00 e0 08      00:01:32.600  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

  ec 00 00 00 00 00 a0 08      00:01:32.597  IDENTIFY DEVICE

  ef 03 46 00 00 00 a0 08      00:01:32.597  SET FEATURES [Set transfer mode]


Error 2 occurred at disk power-on lifetime: 32022 hours (1334 days + 6 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 08 f0 cc 73 08  Error: UNC at LBA = 0x0873ccf0 = 141806832


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 08 a8 f0 cc 73 40 08      00:01:28.814  READ FPDMA QUEUED

  ef 10 02 00 00 00 a0 08      00:01:28.814  SET FEATURES [Enable SATA feature]

  27 00 00 00 00 00 e0 08      00:01:28.814  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

  ec 00 00 00 00 00 a0 08      00:01:28.812  IDENTIFY DEVICE

  ef 03 46 00 00 00 a0 08      00:01:28.812  SET FEATURES [Set transfer mode]


Error 1 occurred at disk power-on lifetime: 32022 hours (1334 days + 6 hours)

  When the command that caused the error occurred, the device was active or idle.


  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 30 00 cd 73 08  Error: UNC at LBA = 0x0873cd00 = 141806848


  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  60 40 48 f0 cc 73 40 08      00:01:18.230  READ FPDMA QUEUED

  60 08 20 68 f1 ad 40 08      00:01:18.216  READ FPDMA QUEUED

  60 00 18 18 5f bd 40 08      00:01:17.959  READ FPDMA QUEUED

  60 00 10 18 5e bd 40 08      00:01:17.958  READ FPDMA QUEUED

  60 00 08 18 5d bd 40 08      00:01:17.958  READ FPDMA QUEUED


SMART Self-test log structure revision number 1

No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1

 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS

    1        0        0  Not_testing

    2        0        0  Not_testing

    3        0        0  Not_testing

    4        0        0  Not_testing

    5        0        0  Not_testing

Selective self-test flags (0x0):

  After scanning selected spans, do NOT read-scan remainder of disk.

If Selective self-test is pending on power-up, resume after 0 minute delay.