Ubuntu 管理心得

搜尋此網誌

2021年1月31日 星期日

LyX + Mathematica on Raspberry rasbian

 ln -s /opt/Wolfram/WolframEngine/12.1/Executables/math /usr/bin

or

 ln -s /opt/Wolfram/WolframEngine/12.1/Executables/math /usr/local/bin

Clone raspberry raspian

sudo dd bs=4M if=/dev/sdb | pv -s 14G | sudo dd of=chiao-pi-20210131.img
sudo dd bs=4M if=chiao-pi-20210131.img | pv -s 14G | sudo dd of=/dev/sdb
 

2021年1月25日 星期一

Find my MAC address

 It can be found in:

/etc/NetworkManager/system-connections/有線連 線\ 1

For example, my kpchiao9600k, it shows:

...

[ethernet]
auto-negotiate=true
mac-address=B4:2E:99:8F:A8:46
mac-address-blacklist=
address1=192.168.1.2/24,192.168.1.1
...

2021年1月24日 星期日

Backspace key cannot keep pressing keyboard

 Sometimes, this is weird happened. The keys cannot keep pressing for repeated keys. 

Try this, 系統設定值-> 鍵盤 unselect 重複按鍵, then select again 重複按鍵

 

 

2021年1月23日 星期六

ThinkCentre MAC address

00:D8:61:22:91:42

 wakeonlan -i 192.168.0.255 00:D8:61:22:91:42

kpci7 MAC address

60:a4:4c:23:7d:33

  eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::62a4:4cff:fe23:7d33  prefixlen 64  scopeid 0x20<link>
        ether 60:a4:4c:23:7d:33  txqueuelen 1000  (Ethernet)

I got it from /etc/udev/rules.d/70-persistent-net.rules

2021年1月20日 星期三

Warning message from ' initramfs-tools configuration sets RESUME '

cf: https://ubuntuforums.org/showthread.php?t=2401012

 

The following warning message comes out while update-grub.

update-initramfs: Generating /boot/initrd.img-4.15.0-134-generic
W: initramfs-tools configuration sets RESUME=UUID=970f542b-b717-470e-aaf1-f9b7de0d017e
W: but no matching swap device is available.

Then, do this:

  1. Find the swap UUID by lsblk, say
    nvme0n1p5 259:5    0   1.1G  0 part [SWAP]
  2. Find UUID by
    sudo blkid /dev/nvme0n1p5
    say,
    /dev/nvme0n1p5: UUID="daa5df9d-4f1d-49cd-9bf8-54befb294691" TYPE="swap" PARTUUID="526d72e6-e43a-492a-bb48-61e361598817"
  3. Replace the UUID with the one shown in the above in /etc/initramfs-tools/conf.d/resume
  4. ATTENTION!! DO NOT save the old resume, e.g. cp it as resume_old. The dir /etc/initramfs-tools/conf.d/ cannot have more than 1 file.
  5. Then,
    sudo update-grub
    or
    sudo update-initramfs -u -k all

2021年1月18日 星期一

Empty Ubuntu Unity Dash no application icons

 cf: https://askubuntu.com/questions/1182199/empty-ubuntu-unity-dash-after-upgrade-to-19-10-and-search-doesnt-do-anything

sudo apt-get install unity-lens-*

warning: 不可能內嵌。GRUB 在本設置中僅能藉由區塊清單來安裝

The following message comes out while  issing 'grub-install' :

 warning: 不可能內嵌。GRUB 在本設置中僅能藉由區塊清單來安裝。然而,使用區塊清單不僅「不可靠」甚至令人挫折。

 It may be caused by the old grub-pc. Then, try to install grub-efi instead.
apt purge grub-pc
apt update
apt install grub-efi
update-grub
grub-install /dev/nvme0n1 

 

2021年1月17日 星期日

Remove duplicated octave icon in unity dash

 Delete the file: /usr/local/share/applications/www.octave.org-octave.desktop

2021年1月16日 星期六

Update drupal 9

  1. composer update (YES, simply run this command. That's good enough. It will update everything including core drupal 9.1.5.)
  2. If this not works, then try the followings:
  3. Update from web site:
    http://localhost/~chiao/drupal9/web/update.php 
  4. cd public_html/drupal9, then issue the following commands:
    1. Put drupal site into maintenance  mode
    2. composer outdated 'drupal/*'
    3.  composer update drupal/core 'drupal/core-*' --with-all-dependencies

2021年1月15日 星期五

Ubuntu cannot boot hang stuck at UBUNTU logo

 Probably caused by gdm. 

sudo dpkg-reconfigure gdm3 

Then, select lightdm. 

Boot again !

2021年1月13日 星期三

Add ubuntu to preinstalled windows 10 in efi gpt disk

  1. Assume the disk contains the efi partition, say /dev/sda2, and windows partition, say /dev/sda3 
  2. Use Ubuntu live USB to boot up the computer
    ATTENTION: Boot the usb drive (e.g, My 64GB Jetflash)
    MUST! MUST! select the
    UEFI: JetFlashTranscend 64GB 1100, Partition 3
    to boot
    Otherwise, the efi will not work!
    (Chiao, 2020-4-25)
  3. Using vmware to install ubuntu for uefi bios, make sure this


  4. Resize windows partition /dev/sda3:
    • get 100GB space for /dev/sda4, format sda4 as ext4, mount /dev/sda4 to /mnt/4, 
    • get 1GB for /dev/sda5, format sda5 as Linux SWAP
  5. Untar (or rsync) the required ubuntu system completely to /mnt/4
  6. cd /mnt/4
    sudo mount -B /dev dev
    sudo mount -B /dev/pts dev/pts
    sudo mount -B /proc proc
    sudo mount -B /sys sys
    sudo mount -B /run run
    cd /
    sudo chroot /mnt/4
    vim /etc/hosts, add this line:
    140.110.240.80 tw.archive.ubuntu.com 
    mount /dev/sda2 /boot/efi
    apt purge grub-pc
    apt update
    apt install grub-efi
    (Yes! Do not use aptitude to install grub-efi*. )
    update-grub
    grub-install
  7. If grub-install failed, try purge all grub2:
    apt purge grub2*
    then install again:
    apt install grub-efi
  8. Also, try this:
     grub-install --target=x86_64-efi --efi-directory=/boot/efi
  9. Edit /etc/fstab for root, swap, and /boot/efi
    Use blkid for efi:/dev/sda2, root:/dev/sda5, swap:/dev/sda6
    Then replace the blkids' in /etc/fstab
  10. umount /boot/efi
  11. exit
  12. sudo umount /mnt/4/dev/pts
    sudo umount /mnt/4/dev
    sudo umount /mnt/4/proc
    sudo umount /mnt/4/sys
    sudo umount /mnt/4/run
  13. (20210623)In case of bios not being able to change boot order for ubuntu, try this inside Windows cmd shell (administrator mode):
    bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

    (cf: https://askubuntu.com/questions/485261/change-boot-order-using-efibootmgr)
    Enter into asus uefi bios setting. The 'ubuntu' is still not at the first order. However, when  at startup, the ubuntu will show up instead of  Windows. Damn good! Oh My!
  14. (20220504) If the error message:
    mount: /var/lib/grub/esp: special device /dev/disk/by-id/nvme-ADATA_SX8200PNP_2J5220164962-part1 does not exist.
    comes out at step "apt purge grub-pc", then
    sudo ln -s /dev/disk/by-id/ata-VMware_Virtual_SATA_CDRW_Drive_01000000000000000001 /dev/disk/by-id/nvme-ADATA_SX8200PNP_2J5220164962-part1
  15. However, after following the above steps, there may not be back to the exact same PC as before because no grub boot menu is shown when reboot.  As a last resort, it needs to create a new partition and install a new ubuntu on it. I think the installation process will safely and totally find the windows partition and list in the grub menu. (20221216)
  16. YES! boot order in bios must be changed for ubuntu being the first one.
  17. (20240903) In case of using static IP in old server, make sure to change it to dhcp after reboot the clone server. 
  18. Under vmware, two important things,
    Select Ubuntu 64bit for guest OS.
    Change to UEFI in Options->Advanced
    Before starting to create Ubuntu guest OS (2024-10-12)


網誌存檔