-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUbuntu_Live_Persistent_USB_16thJun2021.txt
2836 lines (2380 loc) · 168 KB
/
Ubuntu_Live_Persistent_USB_16thJun2021.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
------------------------------
Author : Twrcha AD
email : [email protected]
version: 1.2.0
created: 28th April 2021
updated: 16th June 2021
disply : 1920 x 1080
------------------------------
@@@ DISCLAIMER: this file is a collection of best practises and know-how gathered from various sources, tested and verified by this document author within the subject linux environment for the best of the author's knowldage during the document dated period. meanwhile there are few un-verified commands/procedures which are highlighted/marked by the auther, however discrepancy still may occurs, due to the fact of no 100% matched environments. @@@
###############################################################################################################################################
# Create a Persistent (live) USB storage with a full Linux OS (Ubuntu 20.04-LTS-Focal-Fossa) #
# Create an Independent Bootable Portable OS on a USB3.x disk that works in both UEFI & MBR BIOS modes HW #
# WSL2 version: (CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.222.0_x64) #
# Kernel version (Linux 5.4.0.73-generic & 5.4.72-microsoft-standard-WSL2) #
###############################################################################################################################################
## (LSB) Linux Standard Base: is a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure,
including the Filesystem Hierarchy Standard used in the Linux kernel. ##
## (GiB) Gibibytes: is a standard unit used in the field of data processing and transmission and is defined as base 1024 rather than base 1000. ##
## There are different tools that can be used to create a bootable USB device, here are few opensource utilities/commands (dd command & Mkusb toolset) as linux CLI commands, while
there are many GUI utilities with various capabilities and OS/filesystem support. for example (Rufus, UNetbootin, Universal-USB-Installer, Multi-writer, etc.). ##
## The “static-hostname" is the traditional hostname, which can be chosen by the user.
The “pretty-hostname" is a free-form UTF8 host name for presentation to the user. ##
## Note that while DNS allows domain name up to 255 characters, the hostname in Linux is limited to 64 characters only. ##
## The static-hostname is stored in "/etc/hostname" file, while pretty-hostname and icon-name are stored in the "/etc/machine-info" file. ##
lsb_release -a # check your LSB core version & distro release.
hostnamectl # returns the Kernel version, OS/Distro, Architecture, Hostname(Static&Pretty), Icon-name, chassis and IDs.
hostnamectl --static # returns the static-hostname of your system.
hostnamectl --pretty # returns the pretty-hostname of your system.
uname -r # returns the Kernel version, "Generic" means Desktop edition otherwise "Server" for server edition.
uname -a # for more details.
hostname # check the "Static-hostname", the "Pretty-hostname"="ComputerName" in the GUI mode.
cat /etc/hostname # returns static-hostname.
cat /etc/machine-info # returns the pretty-hostname, the "machine-info" file is created after setting the hostname from the GUI.
sudo hostnamectl set-hostname <TheNewHostName> # set the static-hostname.
## to have two different hostnames (static-hostname & Pretty-hostname),set the static hostname after setting the hostname from the GUI,
## two methods to change the deviceName/ComputerName from the GUI.
GUI > Settings > Sharing > ComputerName.
GUI > Settings > About > DeviceName. ##
--------------------------------------------------------
$ hostnamectl
Static hostname: bananagap
Pretty hostname: BananaGap
Icon name: computer-laptop
Chassis: laptop
Machine ID: d34d11fb687d4784be6b02c3db8c15f8
Boot ID: 65bce81f0b0741d68df13d3cc5f177f2
Operating System: Ubuntu 20.04.2 LTS
Kernel: Linux 5.8.0-43-generic
Architecture: x86-64
$
--------------------------------------------------------
Sources:
--------
https://www.58bits.com/blog/2020/02/28/how-create-truly-portable-ubuntu-installation-external-usb-hdd-or-ssd
https://askubuntu.com/questions/1217832/how-to-create-a-full-install-of-ubuntu-20-04-to-usb-device-step-by-step
https://itectec.com/ubuntu/ubuntu-how-to-create-a-full-install-of-ubuntu-19-10-to-usb-device-step-by-step/
https://www.dionysopoulos.me/making-a-portable-full-installation-of-ubuntu-on-a-usb-hdd.html
https://gparted.org/display-doc.php?name=help-manual&lang=C#gparted-fix-grub-boot-problem
https://askubuntu.com/questions/1332371/creating-a-pc-boot-able-ubuntu-installation/1332619#1332619
#(1)# https://ubuntu.com/tutorials/create-a-usb-stick-on-windows#1-overview (Create a bootable USB stick on Windows)
## GParted: is the GNOME Partition Editor for creating, reorganizing, and deleting disk partitions. GParted enables you to change the partition organization while preserving the partition contents. ##
## Creating an ISO image from a physical disc or from a set of files is very easy to do through the use of a CD burning application, such as the freely available "InfraRecorder" or "CDBurnerXP". ##
http://infrarecorder.org/
https://cdburnerxp.se/
http://www.iometer.org/
########################################################
# Rufus bootable USB creation tool for Windows & Linux #
########################################################
## (Rufus) is a GPL3 standalone tiny digitlly signed opensource free utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.
and it is recommended by Ubuntu.
# Rufus is missing two syslinux files (idlinux.sys & idlinux.bss) download them from the link below:
https://silentdragon.com/download/Rufus/rufus_files/syslinux-6.03/
https://www.youtube.com/watch?v=URBPzlU13Ls
https://www.linuxuprising.com/2019/08/rufus-creating-persistent-storage-live.html#:~:text=Starting%20with%20Rufus%20version%203.7%2C%20the%20application%20has,Live%20ISOs%20created%20after%201st%20of%20August%2C%202019.
# if you are using a USB disk (HDD or SSD) make sure to enable Disk listing, as it is not enable by default.
@@@ USB with ExFat filesystem format is detected however not supported as the target filesystem for the bootable USB (only FAT32 & NTFS). @@@
https://rufus.ie/en/
https://pete.akeo.ie/
git clone git://github.com/pbatard/rufus #
It can be especially useful for cases where:
you need to create USB installation media from bootable ISOs (Windows, Linux, UEFI, etc.).
you need to work on a system that doesn't have an OS installed.
you need to flash a BIOS or other firmware from DOS.
you want to run a low-level utility.
What is persistent partition:
-----------------------------
https://searchstorage.techtarget.com/definition/Persistent-storage
https://usbubuntu.wordpress.com/make-it-persistent/
Persistent storage is any data storage device that retains data after power to that device is shut off. It is also sometimes referred to as non-volatile storage. Magnetic media, such as hard disk drives and tape are common types of persistent storage, as are the various forms of optical media such as DVD. Persistent storage systems can be in the form of file, block or object storage.
For the most part, storage persistence is a given, the very basic requirement of any storage system, whether it refers to a single drive, a shared networked storage system or a cloud storage service. Because persistence is assumed, it is rare that it is even mentioned among the technical specifications for storage devices and systems.
Persistent storage and containerization
There is, however, one exception related to recent developments in virtualized computing that has helped raise storage persistence as an issue. In recent years, containerization has become a popular way to bundle applications with their operating systems into discreet, transportable modules that be created and destroyed as often as needed. But containers initially didn’t support persistent storage which meant that the data created with a containerized app would disappear when the app finished its work and the container was destroyed.
Recently, however, a number of software and storage vendors have developed methods to retain the data created by container applications and maintain it in familiar storage volumes. Storage volumes are usually associated with stateful applications such as databases that remain available even if the application is shut down or finishes its processing. These advances in storage for containers solve the problem of retaining the more ephemeral storage volumes that live and die with the stateless apps that are run from containers.
#########################
# Multi-Writer utility #
#########################
sudo apt install gnome-multi-writer
#############################
# UNetbootin a GUI utility #
#############################
wget unetbootin.sourceforge.net/unetbootin-linux-latest
chmod +x ./unetbootin-linux-* # ??? may not be necessary ???
sudo apt-get install p7zip-full
sudo ./unetbootin-linux-* # ???? Not working ????
#######################################
# Startup-Disk-Creator a GUI utility #
#######################################
sudo apt install usb-creator-gtk
###################################
# USB-Image-Writer a GUI utility #
###################################
###################################
# UUByte-LiteBoot a GUI utility #
###################################
###############################
# dus command a GUI utility #
###############################
## run dus GUI and select the Restore Persistent-live Home and follow the instructions.
####################################################
# Mkusb a GUI bootable USB creation tool for Linux #
####################################################
## mkusb tool v12.4.3 or later (includes mkusb-plug v2.5.5 or later, that supports "persistent partition"):
# mkusb can create persistent live drives that work in both UEFI and BIOS mode. The persistence storage partition created by mkusb uses casper-rw,
so it can have a size of more than 4 GB, unlike some other similar tools.
# This tool can not only create persistent storage live USB drives, but also regular bootable live USBs of Linux distributions, wipe a device, and more.
The only downside of mkusb is its user interface, which uses Zenity and can be a bit confusing, but other than that the application works great.
https://help.ubuntu.com/community/mkusb
https://help.ubuntu.com/community/mkusb/plug
https://phillw.net/isos/linux-tools/mkusb/
https://ubuntuforums.org/showthread.php?t=1958073
https://www.linuxuprising.com/2019/03/create-persistent-storage-live-usb-with.html#:~:text=The%20persistence%20storage%20partition%20created%20by%20mkusb%20uses,of%20Linux%20distributions%2C%20wipe%20a%20device%2C%20and%20more.
sudo apt install ntfs-3g # support for NTFS & ExFat filesystem format.
sudo apt install zenity # Zenity is command line GUI creator, that is pre-installed on most versions of Linux, including Raspberry PI’s. it is also available for MacOS and Windows.
sudo add-apt-repository ppa:mkusb/ppa #
sudo apt install mkusb #
sudo apt install usb-pack-efi # for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files.
mkusb-plug -h # check the supported OS's, distro's, .img & .iso images.
--------------------------------------------------------------------
$ mkusb-plug -h
Tool to create boot drive, typically a live USB drive
Usage: mkusb-plug [source file]
Examples:
mkusb-plug linux.iso # make live drive
mkusb-plug linux.img # clone image file
mkusb-plug ubuntu-19.10+.iso # make persistent live
mkusb-plug debian-10+.iso # make persistent live
mkusb-plug -v # version
mkusb-plug -h # help
$
--------------------------------------------------------------------
## With Ubuntu-20.04-LTS_Focal-Fossa, the default label of the partition for persistence is changed from casper-rw to writable.
This is implemented in mkusb-plug version 2.5.5, (which is bundled with mkusb version 12.4.3 in the PPA).
## Where can mkusb-plug work?
# mkusb-plug needs a graphical user interface (desktop environment or window manager).
# All features of mkusb-plug work in Ubuntu 18.04.x LTS, Debian 10 and newer versions.
# In Ubuntu 16.04.x LTS the tool 'fdisk' is packaged in util-linux, while it is in an own package in 18.04 and newer versions.
For this reason the PPA is configured so that you cannot install mkusb-plug from PPA. You can install mkusb-plug version 2.5.0 and newer versions from the tarball and use it.
# mkusb-plug does not work in Ubuntu 15.10 and older versions. Use mkusb-dus (or mkusb-bas if it is a very old version).
Cloning works in all linux distros with a fairly new version of Linux with for example 'lsblk' and a modern version of 'dd'.
It means that you can create standard live-only boot drives from hybrid iso files. But the installer in the tarball is using apt to install some standard linux programs,
that mkusb-plug depends on, and in linux distros that use other tools (than apt), you have to install those programs manually.
## mkusb-plug - plug-in to identify target:
# mkusb-plug is a wrapper shellscript for the plug-in method using
# xorriso-dd-target to indentify the correct target device, which is a very safe way to identify the target device,
# and creates input for mkusb-sedd 'sed and dd', which is developed from mkusb-minp. mkusb-sedd has better monitoring of the progress and there are several minor improvements and bugfixes. mkusb-sedd uses zenity when available, but it can also work as a stand-alone tool in text mode (but mkusb-plug needs graphics mode and zenity).
# and creates input for mkusb-tow 'TO Windows', which is developed from iso2usb/diy/windows-installer-for-big-files, mkusb-tow can manage current Windows 10 iso files with a file 'install.wim', that exceeds 4 GiB. mkusb-tow uses zenity when available, but it can also work as a stand-alone tool in text mode (but mkusb-plug needs graphics mode and zenity).
# watch-flush helps watching the progress, when the iso file is flashed via sed or xzcat or extracted via rsync to the target device.
## What can mkusb-plug do?
# clone from a hybrid iso file to a standard live (live-only) boot drive in a removable drive.
# clone from a general image file (for example an image of a Raspberry Pi installed system).
# create live drives with a usbdata partition for storage with all linux distros that provide hybrid iso files.
# create a persistent live drive with Ubuntu-19.10 or Debian-live-10 or later.
# and newer versions of Ubuntu and Ubuntu family flavours as well as Debian and some but not all linux distros created from them create a 'nopersistent' live drive,
where no logs are saved past shutdown/reboot .
# create an installer drive for Windows implemented in version 2.6.0.
##################################################
# dd command for bootable USB creation on Linux #
##################################################
@@@ WARNING:
The dd command is a very powerful command, such that if you are not careful you can wipe out all data on your computer or other devices very easily. Please read and follow all commands in this tutorial carefully. @@@
## Even if the USB device is not mounted after formatting it the lsblk command will still list all block devices on the system, including the USB device. pipe the output to grep so you can cut out the noise of the “loop” devices and just see anything that matches a /dev/sdX device. ##
## Ubuntu should have automatically mounted the USB device after dd was finished. You can check to see if it’s mounted with the df command. ##
## Since Ubuntu creates a “snap partition” for every Snap application installed, filter out that noise by piping to grep with a negative (-v) case insensitive (-i) search for snap. ##
lsblk | grep -i sd #
sudo dd bs=4M if=~/download/ubuntu-20.04.2.0-desktop-amd64.iso of=/dev/sdb status=progress oflag=sync # $$$ Don't use, unless you know what UR doing $$$
df -h | grep -i -v snap #
Breakdown of the above dd command:
----------------------------------
bs=4M: Specify that a 4 MB block size should be used
if=ubuntu-18.04.2-desktop-amd64.iso: Input file we want to copy
of=/dev/sdb: Output file (device) that we want to write to
status=progress: Show the progress of the dd command
oflag=sync: Sync after each output block. This can slow down our write time to our device, but it ensures that all data gets effectively “synced” to our USB device as it’s being written.
## You may omit disabling the hard drive in BIOS boot if after partitioning you choose to install grub to the root of the USB drive you are installing Ubuntu to, (ie sdx not sdx1). Be cautious, many people have overwritten the HDD MBR as default location for boot loader is sda, any items in the internal drive's grub will be added to the USB's grub. You may do an update-grub later. If you leave the HDD plugged in with UEFI install, fstab may use the HDD's UUID for /boot/efi. In this case # or delete the /boot/efi.UUID line in fstab. ##
#############################################
# Activate the Wifi adapter on Ubuntu 20.x #
#############################################
## The default netplan configuration files in Ubuntu Core leave management of networking devices to networkd. But, when network-manager is installed,
it creates new netplan configuration files, setting itself as the default network renderer and taking control of all devices.
It is possible to control this behavior with the defaultrenderer snap option. It is set by default to true , but if we set it to false ,
network-manager reverts the netplan configuration and networkd takes control of the devices again. Note however that networkd will take control only of devices explicitly configured
by netplan configuration files, which is usually only ethernet or wifi devices. To do that: ##
sudo snap install network-manager # install linux Network-Manager GUI utility.
snap set network-manager defaultrenderer=false # handover network management back to the default built-in Netplan-networkd.
# All necessary plugs and slots will be automatically connected within the installation process. You can verify this with:
------------------------------------------------------------
$ snap connections
Interface Plug Slot Notes
lxd-support lxd:lxd-support :lxd-support -
network lxd:network :network -
network-bind lxd:network-bind :network-bind -
system-observe lxd:system-observe :system-observe -
$
-----------------------------------------------------------
sudo systemctl status ufw # ubuntu firewall
sudo systemctl enable ufw
sudo systemctl start ufw
sudo ufw enable
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw allow https
sudo ufw allow from IP
sudo ufw deny IP
sudo ufw deafult deny incoming
sudo apt install gufw # GUI for ubuntu built-in firewall.
sudo apt install golang-github-vmware-govmomi-dev # to enable the VMWare "networks" command.
snap connections #
lshw -C network # show only the network adapters and status.
lsusb # show all the HW devices connected to the system USB bus.
lspci # show all the HW devices connected to the system PCIe bus.
tail -f /var/log/messages # for PCMCIA wifi adapters run this command then connect the adapter to be detected.
nmcli dev wifi # list available Wifi hotspots to connect to.
nmcli dev wifi connect [essid_name] password [insert your password] #
sudo cp /lib/firmware/rtlwifi/rtl8822befw.bin /lib/firmware/rtw88/ # copy the RealTek wifi driver to that folder.
sudo mv /lib/firmware/rtw88/rtl8822befw.bin /lib/firmware/rtw88/rtw8822b_fw.bin # rename the driver file to be loaded after restart.
pv # to monitor a running activity like disk format, disk encryption, running script, etc. .
rfkill # show RF devices in the system.
lspci -knn # shows more details.
lspci -knn | grep Net -A3; rfkill list #
sudo nmcli networking off # Turn the network adapter off and then on instead of restarting the system.
sudo nmcli networking on #
iwconfig # display the wireless interfaces on your system and check their status
iw dev # to list wireless interfaces only.
iw dev <interface_name> link # check whether the interface is connected to any wireless device.
sudo iwlist <wifi_adapter> scan | grep -i ESSID # search/scan for available wifi hotspot to connect to.
nano /etc/netplan/01-network-manager-all.yaml # this where you can manually configure your network interfaces.
sudo netplan generate #
sudo netplan apply #
reboot #
## If NetworkManager is enabled it will takeover this file "/etc/netplan/01-network-manager-all.yaml" with the below input:
--------------------------------------------------------
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
--------------------------------------------------------
---------------------
Manual configuration:
-----------------------------------------------------------
network:
version: 2
renderer: networkd
ethernets:
en01:
dhcp4: true
dhcp6: true
optional: true
wifis:
wlp6s0:
dhcp4: true
dhcp6: true
access-points:
"YourWifiNetworkName":
password: "WifiNetworkPassword"
--------------------------------------------------------##
---------------------------------------------------------------------------------------------
$ sudo lshw -C network
*-usb
description: Wireless interface
product: 802.11 bg WLAN
vendor: Ralink
physical id: 1
bus info: usb@2:1.1
logical name: wlx7844767a910a
version: 0.01
serial: 78:44:76:7a:91:0a
capabilities: usb-2.00 ethernet physical wireless
configuration: broadcast=yes driver=rt73usb driverversion=5.8.0-43-generic firmware=1.7 ip=192.168.1.148 link=yes maxpower=300mA multicast=yes speed=480Mbit/s wireless=IEEE 802.11
*-network UNCLAIMED
description: Network controller
product: BCM43142 802.11b/g/n
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:08:00.0
version: 01
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress cap_list
configuration: latency=0
resources: memory:b5500000-b5507fff
*-network
description: Ethernet interface
product: RTL810xE PCI Express Fast Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:09:00.0
logical name: eno1
version: 08
serial: 8c:dc:d4:70:e8:6c
capacity: 100Mbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.8.0-43-generic firmware=rtl8106e-2_0.0.1 04/23/13 latency=0 link=no multicast=yes port=MII
resources: irq:19 ioport:4000(size=256) memory:b5404000-b5404fff memory:b5400000-b5403fff
*-network DISABLED
description: Ethernet interface
physical id: 3
logical name: mpqemubr0-dummy
serial: 52:54:00:c2:fc:17
capabilities: ethernet physical
configuration: broadcast=yes driver=dummy driverversion=5.8.0-43-generic
$
--------------------------------------------------------------------------------------------------
$ sudo iwlist wlx7844767a910a scan | grep -i ESSID
ESSID:"KOKASF"
ESSID:"\x00\x00\x00\x00\x00\x00\x00\x00\x00"
ESSID:"SKY56FSA"
ESSID:"DIRECT-XODESKTOP-UTM93U1msCE"
ESSID:"SKYBINLH"
ESSID:"BTWi-fi"
ESSID:"SKY56FSA"
ESSID:"BTWi-fi"
ESSID:"SKYBINLH"
ESSID:"SKY56FSA"
$
--------------------------------------------------------------------------
from pwsh:
----------
netstat # list the current used ports (real-time).
netstat -an # lists the available network ports and the process, application or service occupying it.
netstat -aon # this will in addtion shows the Process-ID (PID).
## $$WARNING$$ tools and softwares from Nirsoft can be triggered as HackTools and may containe Trojans & Malwares due to its nature and use it on your own responsibility in an isolated environment.
## you can downlaod and use "Nirsoft CurrPorts" to View What is Listening on a Port, https://www.nirsoft.net/ ##
############################################
# Install/Upgrade & Manage System Drivers #
############################################
## FFmpeg is a free and open-source collection of tools for handling multimedia files. It contains a set of shared audio and video libraries such as libavcodec, libavformat, and libavutil. With FFmpeg, you can convert between various video and audio formats, set sample rates, capture streaming audio/video, and resize videos. ##
sudo apt install ffmpeg # this will install the FFMPEG Audio & Video codec managaement package which includes the following three libraries: (libavcodec, libavformat, libavutil).
sudo apt install wireless-tools #
sudo apt install ubuntu-drivers-common # enable the "ubuntu-drivers" command.
ubuntu-drivers devices #
sudo ubuntu-drivers autoinstall # this will install the recommended default driver for your distro.
apt search nvidia-driver
sudo apt install xserver-xorg-video-nvidia-440 # install a specific driver.
dpkg -l | grep -i nvidia # check the installed nvidia packages.
sudo apt remove --purge '^nvidia-.*' # remove & purge the nvidia driver, data & settings.
sudo apt install ubuntu-desktop # in case removing the nvidia driver stops the desktop mode.
sudo add-apt-repository --remove ppa:<ppa-repository-name>/ppa # remove a PPA repository source.
#########################################################
# WSL2 "Ext4.VHDX" disk/image cleanup & optimisation #
#########################################################
from pwsh:
----------
wsl --shutdown
Get-AppxPackage -Name "Ubuntu-20.4" | Select <PackageFamilyName> # for example CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc
optimize-vhd -Path D:\wsl -Mode full
# optimize-vhd command does not exist on Windows Home Edition only Pro & Enteprise instead follow the below procedure to get the same results:
diskpart
select vdisk file="D:\WSL\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit
###############################################################
# Windows10 repaire upgrade (No data, app or setting loss) #
###############################################################
## https://www.catalog.update.microsoft.com/home.aspx ##
## https://www.tenforums.com/tutorials/16397-repair-install-windows-10-place-upgrade.html ##
## https://www.tenforums.com/windows-10-news/168239-kb4586853-cu-windows-10-v2004-build-19041-662-v20h2-19042-662-a.html ##
@@@ WARNINGS @@@
## Make sure your Windows build is at or higher than, Windows-10-version-20H2-build-19042.662 with (KB4586853) installed, to be able to do a repair install and keep everything. ##
## Disable or uninstall any 3rd party AV or security program you have installed first to prevent it from interfering with the upgrade to Windows 10. You can enable or reinstall it after Windows 10 has finished installing. ##
## if Windows is encrypted by BitLocker, then you will need to either suspend or turn off BitLocker for the Windows drive before doing a repair install. Once installation has finished, you can resume or turn on BitLocker again. ##
## Before you get started doing a repair install of Windows 10, be sure that you also temporarily disable Secure Boot in your UEFI firmware settings. Once installation has finished, you can enable Secure Boot again if you like. ##
## Do not use the Media Creation Tool to do a repair install with if you have an older build of Windows 10 installed and wish to retain it since the Media Creation Tool will not include support for older builds. You will be upgraded to the latest build provided by the Media Creation Tool. ##
## Some users are having the repair install fail when using an USB in Windows 10 version 1903. If this happens to you, you can use an ISO instead. ##
## Do the step below depending on what you are using to do a repair install of Windows 10 with.
a): To do a repair install of Windows 10 with an ISO file (Recommended)
or
b): To do a repair install of Windows 10 with USB installation media
or
c): To do a repair install of Windows 10 with Media Creation Tool.
# mount the ISO image, the run the setup.exe,
# discard the need for downloading drivers and update and uncheck the Windows improvment feedback program,
# select the option to keep all your data, apps and setting.
# start the repair update.
##############################################
# Replace python2.7 with python3.8 #
##############################################
whereis python3.8 #
sudo apt install python-is-python3 # this package will move your system dependancy from python2.7 to python3.8.
sudo apt build-dep python-is-python3 #
## this will hold python2.7 and prevent it from becoming a dependency for any other application. ##
sudo apt-mark hold python2 python2-minimal python2.7 python2.7-minimal libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib #
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 #
sudo update-alternatives --force --install /usr/bin/python python /usr/bin/python3 10 #
sudo update-alternatives --config python #
cd /usr/lib/python3.8 # (no configure file).
sudo ./configure ––enable–optimizations #
pip install python-gnutls # (Not supported) anymore (get the new python3 version).
-------------------------------------------------------------------------------------------------------------------------------------
$ sudo apt-mark hold python2 python2-minimal python2.7 python2.7-minimal libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib
python2 set on hold.
python2-minimal set on hold.
python2.7 set on hold.
python2.7-minimal set on hold.
libpython2-stdlib set on hold.
libpython2.7-minimal set on hold.
libpython2.7-stdlib set on hold.
$
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode
$
$ sudo update-alternatives --config python
There is only one alternative in link group python (providing /usr/bin/python): /usr/bin/python3
Nothing to configure.
$
$ whereis python3
python3: /usr/bin/python3.8 /usr/bin/python3.9 /usr/bin/python3 /usr/bin/python3.8-config /usr/lib/python3.8 /usr/lib/python3.9 /usr/lib/python3 /etc/python3.8 /etc/python3.9 /etc/python3 /usr/local/lib/python3.8 /usr/local/lib/python3.9 /usr/include/python3.8 /usr/share/python3 /mnt/c/Programdata/anaconda3/python3.dll /mnt/c/Programdata/anaconda3/python38.dll /mnt/c/Programdata/anaconda3/python38.pdb /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python36/python3.dll /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python36/python36.dll /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python39/python3.dll /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python39/python39.dll /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python39/python39.pdb /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python38/python3.dll /mnt/c/Users/ardal/AppData/Local/Programs/Python/Python38/python38.dll /mnt/c/Users/ardal/AppData/Local/Microsoft/WindowsApps/python3.exe /usr/share/man/man1/python3.1.gz
$
$
lrwxrwxrwx 1 root root 9 Mar 13 2020 python3 -> python3.8
lrwxrwxrwx 1 root root 16 Mar 13 2020 python3-config -> python3.8-config
-rwxr-xr-x 1 root root 152 Apr 9 2020 python3-pbr
-rwxr-xr-x 2 root root 5203064 May 3 03:51 python3.6
-rwxr-xr-x 2 root root 5203064 May 3 03:51 python3.6m
-rwxr-xr-x 2 root root 5488624 May 3 03:44 python3.7
-rwxr-xr-x 2 root root 5488624 May 3 03:44 python3.7m
-rwxr-xr-x 1 root root 5486384 Jan 27 15:41 python3.8
lrwxrwxrwx 1 root root 33 Jan 27 15:41 python3.8-config -> x86_64-linux-gnu-python3.8-config
-rwxr-xr-x 1 root root 5389488 May 5 03:20 python3.9
lrwxrwxrwx 1 root root 10 Mar 13 2020 pyvenv -> pyvenv-3.8
$
--------------------------------------------------------------------------------------------------------------------------------------
######################################################################################################
# Fixing Python-setuptools & Python-pkg-resources wrong library/python version installation erros #
######################################################################################################
@@@@ $$$$ CAUTION $$$$ the PPA repository below installs an old version of "python-pkg-resources" and scripts which leads to "Python-setuptools" setup failure and starts a domino effect that dystroies the Python3 & pip on your environment. to resolve first remove the bad PPA repository then try to remove the old packages and restore the latest available from your distros offical repository. @@@@
## https://towardsdatascience.com/building-python-from-source-on-ubuntu-20-04-2ed29eec152b ##
## https://www.python.org/ftp/python/ ##
sudo add-apt-repository --remove ppa:nilarimogard/webupd8
sudo apt reinstall Python-setuptools
sudo apt install Python3-setuptools
sudo apt install --reinstall python-pkg-resources
sudo apt install --reinstall python3-pkg-resources
sudo apt-mark hold python-gi cython python-pytest gyp matplotlib 3.4.2
python -m pip install --upgrade
sudo pip install --upgrade --pre -f <online-repository-URL> <packageName>
sudo dpkg -r --force-depends python-pkg-resources # (important step to root out the faulty stuck packages that cant be installed or uninstalled).
sudo dpkg --force-depends --configure -a # (not required)
cd /var/lib/dpkg/info # the following three steps are the problem solver then setup pyenv.
sudo rm /var/lib/dpkg/info/<FaultyPackageName>*
sudo dpkg --configure -D 777 <FaultyPackageName>
sudo apt -f install
sudo sed -i 's/2.7/3.8/g' <FaultyPackageName>.list # (Not required)
--------------------------------------------------------------#
$ pipenv
Usage: pipenv [OPTIONS] COMMAND [ARGS]...
Options:
--where Output project home information.
--venv Output virtualenv information.
--py Output Python interpreter information.
--envs Output Environment Variable options.
--rm Remove the virtualenv.
--bare Minimal output.
--completion Output completion (to be eval'd).
--man Display manpage.
--three / --two Use Python 3/2 when creating virtualenv.
--python TEXT Specify which version of Python virtualenv should use.
--site-packages Enable site-packages for the virtualenv.
--version Show the version and exit.
-h, --help Show this message and exit.
Usage Examples:
Create a new project using Python 3.6, specifically:
$ pipenv --python 3.6
Install all dependencies for a project (including dev):
$ pipenv install --dev
Create a lockfile containing pre-releases:
$ pipenv lock --pre
Show a graph of your installed dependencies:
$ pipenv graph
Check your installed dependencies for security vulnerabilities:
$ pipenv check
Install a local setup.py into your virtual environment/Pipfile:
$ pipenv install -e .
Use a lower-level pip command:
$ pipenv run pip freeze
Commands:
check Checks for security vulnerabilities and against PEP 508 markers
provided in Pipfile.
clean Uninstalls all packages not specified in Pipfile.lock.
graph Displays currently–installed dependency graph information.
install Installs provided packages and adds them to Pipfile, or (if none
is given), installs all packages.
lock Generates Pipfile.lock.
open View a given module in your editor.
run Spawns a command installed into the virtualenv.
shell Spawns a shell within the virtualenv.
sync Installs all packages specified in Pipfile.lock.
uninstall Un-installs a provided package and removes it from Pipfile.
update Runs lock, then sync.
$
-----------------------------------------------------------------------#
########################################################################
# Setup (pyenv) Python Global Environment, (PYTHONHOME & PYTHONPATH) #
########################################################################
## (pyenv) Python-Environment setup: make sure system is first choice in global configuration: "pyenv global system" or set the python version for the current shell with
"pyenv shell system". If you use global you only have set it once. ##
## https://askubuntu.com/questions/1259914/playonlinux-not-working-with-on-wxpython-4-1-0-importerror-no-module-named-wx ##
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$ pyenv init
# (The below instructions are intended for common
# shell setups. See the README for more guidance
# if they don't apply and/or don't work for you.)
# Add pyenv executable to PATH and
# enable shims by adding the following
# to ~/.profile:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# If your ~/.profile sources ~/.bashrc,
# the lines need to be inserted before the part
# that does that. See the README for another option.
# If you have ~/.bash_profile, make sure that it
# also executes the above lines -- e.g. by
# copying them there or by sourcing ~/.profile
# Load pyenv into the shell by adding
# the following to ~/.bashrc:
eval "$(pyenv init -)"
# Make sure to restart your entire logon session
# for changes to profile files to take effect.
$
$ pyenv --version
pyenv 2.0.1-5-gbbcecc75
$
$ pyenv local system # (Dont use this).
$ pyenv shell system # set the pyenv on the user level, one user.
Or
$ pyenv global system # (recommended) set the pyenv on the system level all users.
Other commands & settings:
--------------------------
python3 -m venv env
unset PYTHONHOME
unset PYTHONPATH
pipenv shell
pycompile
pyclean
/usr/share/playonlinux/bash/find_python
/usr/share/playonlinux/python/check_python.py
playonlinux # is based on Python 2.7
python-wxgtk3.0
python-wxversion
$ cat ~/.bash_profile
------------------------------------
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
source ~/.bashrc
source ~/.xsessionrc
#source ~/.profile
export PATH="$PATH:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.dotnet/dotnet:/snap/bin:/usr/bin/snap:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/python3/dist-p>echo "PYTHONHOME=$PYENV_ROOT"
eval $(ssh-agent)
-----------------------------------
update-alternatives --install /usr/lib/wx/python/wx.pth wx.pth /usr/lib/wx/python/wx3.0.pth
--------------------------------------------------
(pyenv) & Python version related issues & Errors:
--------------------------------------------------------------------------------------------------------
python-setuptools python-pkg-resources /var/cache/apt/archives/python-pkg-resources_44.0.0-2_all.deb
$ playonlinux
Looking for python... 3.8.5 - skipped
Looking for python2.7... 2.7.9 - Traceback (most recent call last):
File "/usr/share/playonlinux/python/check_python.py", line 1, in <module>
import os, wxversion
ImportError: No module named wxversion
failed tests
Looking for python2.6...
Looking for python2...
Please install python before trying to run this program
$
$ whereis python2.7
python2: /usr/bin/python2 /usr/bin/python2.7 /usr/lib/python2.7 /etc/python2.7 /usr/local/bin/python2.7-config /usr/local/bin/python2 /usr/local/bin/python2.7 /usr/local/lib/python2.7 /usr/share/man/man1/python2.1.gz
$
$ pipenv shell
Spawning environment shell (/bin/bash). Use 'exit' to leave.
. /home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L/bin/activate
$ . /home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L/bin/activate
(twrcha-DekPzk4L) twrcha@PineGap:~$
$ sudo dpkg --configure python2.7
Setting up python2.7 (2.7.18-1~20.04.1) ...
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
/usr/bin/python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [Errno 2] No such file or directory
dpkg: error processing package python2.7 (--configure):
installed python2.7 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
python2.7
$
$ sudo apt reinstall python-pkg-resources -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0 B/129 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 481679 files and directories currently installed.)
Preparing to unpack .../python-pkg-resources_44.0.0-2_all.deb ...
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: warning: old python-pkg-resources package pre-removal script subprocess returned error exit status 1 <---
dpkg: trying script from the new package instead ...
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing archive /var/cache/apt/archives/python-pkg-resources_44.0.0-2_all.deb (--unpack):
new python-pkg-resources package pre-removal script subprocess returned error exit status 1
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error while cleaning up:
installed python-pkg-resources package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/python-pkg-resources_44.0.0-2_all.deb <---
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo dpkg --configure python-setuptools
Setting up python-setuptools (44.0.0-2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package python-setuptools (--configure):
installed python-setuptools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
python-setuptools
$
$ cd /var/lib/dpkg/info/
$ sudo dpkg --configure -D 777 libpaper1
D000001: ensure_diversions: new, (re)loading
D000001: process queue pkg libpaper1:amd64 queue.len 0 progress 1, try 1
dpkg: error processing package libpaper1:amd64 (--configure): <---
package libpaper1:amd64 is already installed and configured
Errors were encountered while processing: <---
libpaper1:amd64
$
$ pip
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
$
$ pipenv shell
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.8.5) to create virtualenv…
⠋created virtual environment CPython3.8.5.final.0-64 in 692ms
creator CPython3Posix(dest=/home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/twrcha/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Virtualenv location: /home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L
Creating a Pipfile for this project…
Spawning environment shell (/bin/bash). Use 'exit' to leave.
. /home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L/bin/activate
twrcha@PineGap:~$ . /home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L/bin/activate
(twrcha-DekPzk4L) twrcha@PineGap:~$ pipenv --venv
/home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L
(twrcha-DekPzk4L) twrcha@PineGap:~$
#if you run any python or pip commands you will get the below insted of the command syntex
$
Python path configuration:
PYTHONHOME = '/home/twrcha/.local/lib/python3.8/site-packages'
PYTHONPATH = '/home/twrcha/.local/lib/python3.8/site-packages:/usr/lib/python3.8/site-packages:/usr/local/lib/python3.8/dist-packages:/home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L'
program name = '/usr/bin/python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3'
sys.base_prefix = '/home/twrcha/.local/lib/python3.8/site-packages'
sys.base_exec_prefix = '/home/twrcha/.local/lib/python3.8/site-packages'
sys.executable = '/usr/bin/python3'
sys.prefix = '/home/twrcha/.local/lib/python3.8/site-packages'
sys.exec_prefix = '/home/twrcha/.local/lib/python3.8/site-packages'
sys.path = [
'/home/twrcha/.local/lib/python3.8/site-packages',
'/usr/lib/python3.8/site-packages',
'/usr/local/lib/python3.8/dist-packages',
'/home/twrcha/.local/share/virtualenvs/twrcha-DekPzk4L',
'/home/twrcha/.local/lib/python3.8/site-packages/lib/python38.zip',
'/home/twrcha/.local/lib/python3.8/site-packages/lib/python3.8',
'/home/twrcha/.local/lib/python3.8/site-packages/lib/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f8e283b5740 (most recent call first):
<no Python frame>
$
-------------------------------------------------------------------------------------------------------------------------------
#################################################################
# How to compile a new kernel version and upgrade your Ubuntu #
#################################################################
# https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules
# https://falco.org/blog/falco-wsl2-custom-kernel/
# https://github.com/darlinghq/darling/issues/260
# (https://ostechnix.com/different-methods-upgrade-ubuntu-latest-version/)
# (https://ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/)
## the i386 libraries are all dependent on the old and demoted python2.7. ##
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
sudo apt install libc6-dev:i386 libfreetype6-dev:i386 libfreetype6:i386 libfreetype-dev:i386 libc6:i386 libc-dev:i386 zlib1g-dev:i386 libz-dev:i386 libpng-dev:i386 libcrypt-dev:i386 linux-libc-dev:i386 libc-dev-bin:i386
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# install the below prerequisites:
sudo apt install g++ gcc git make cmake clang bison flex nasm linux-headers-generic pkg-config
sudo dpkg --add-architecture i386 # add system support for 32bit/i386 libraries to your amd64 ubuntu distro.
sudo dpkg --print-architecture # output should be "amd64".
sudo apt install libc6-dev-i386-x32-cross # install this library for i386 support in python3.
sudo apt build-dep libc6-dev-i386-x32-cross #
sudo apt install aptitude #
sudo apt build-dep aptitude # aptitude command is an advance apt with auto dependency solving capability.
sudo apt install g++-10 #
sudo apt build-dep g++-10 # (Not working, dependency problem).
sudo aptitude install gcc-10-multilib #
sudo aptitude build-dep gcc-10-multilib #
sudo apt install linux-generic # upgrade to the latest kernal libraries.
sudo apt install linux-virtual # upgrade to the latest kernel.
sudo update-grub # this will update the grup config file and environment setting.
dpkg -l | grep linux-image
/boot/grub/grub.cfg
/etc/default/grub
sudo cp /etc/default/grub /etc/default/grub.bak
grep -A100 submenu /boot/grub/grub.cfg |grep menuentry
uname -r
sudo vim /etc/default/grub
# by editing the grub file switch to this kernel version by setting the GRUB_DEFAULT value to the below kernel value (With Quotes):
menuentry_id_option "gnulinux-5.4.0-73-generic-advanced-3255683f-53a2-4fdf-91cf-b4c1041e2a62"
save and exit the terminal
sudo update-grub
sudo reboot
-----------------------------------------------------------
$ uname -r
5.4.72-microsoft-standard-WSL2
$
$ dpkg -l | grep linux-image
ii linux-image-5.4.0-72-generic 5.4.0-72.80 amd64 Signed kernel image generic
ii linux-image-5.4.0-73-generic 5.4.0-73.82 amd64 Signed kernel image generic
ii linux-image-generic 5.4.0.73.76 amd64 Generic Linux kernel image
ii linux-image-virtual 5.4.0.73.76 amd64 Virtual Linux kernel image
$
$ grep -A100 submenu /boot/grub/grub.cfg |grep menuentry
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-3255683f-53a2-4fdf-91cf-b4c1041e2a62' {
menuentry 'Ubuntu, with Linux 5.4.0-73-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-73-generic-advanced-3255683f-53a2-4fdf-91cf-b4c1041e2a62' {
menuentry 'Ubuntu, with Linux 5.4.0-73-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-73-generic-recovery-3255683f-53a2-4fdf-91cf-b4c1041e2a62' {
menuentry 'Ubuntu, with Linux 5.4.0-72-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-72-generic-advanced-3255683f-53a2-4fdf-91cf-b4c1041e2a62' {
menuentry 'Ubuntu, with Linux 5.4.0-72-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-72-generic-recovery-3255683f-53a2-4fdf-91cf-b4c1041e2a62' {
$
$ sudo update-grub
[sudo] password for twrcha:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-73-generic