2013年9月27日 星期五

Install ubuntu 14.04/16.04/20.04 and above looks like 10.04

1. update sabertooth z87 bios to latest version in boot setup menu

2. install ubuntu 12.04.5 or 14.04.2
http://releases.ubuntu.com/12.04/
http://old-releases.ubuntu.com/releases/14.04.2/

ubuntu 14.04.2 linux kernel version is 3.16.0-xxx

3. burn iso file in DVD

4. setting DVD first boot in motherboard bios

5. create primary partition assign mount / ([/] = root directory)
My PC: 1Tb Hard disk and 8gb physical ram
size         : 496gb
type         : Primary
use as      : Ext4
Mount point : /

6. create swap partition on logical
size     : 8gb
type     : Logical
use as  : swap area

7. create extend partition on logical (option)
size     : 512gb
type     : Logical
use as  : Ext4
Mount point : (assign later)

Example:
http://ivanblagojevic.com/how-to-install-ubuntu-14-04-lts-on-an-empty-hard-disk-tutorial

8. update
software-properties-gtk -> Other software
enable all [Canonical] check boxes

software-properties-gtk -> Updates
enable all [...updates] check boxes

automatically check for updates: never
when there are security updates: display immediately
when there are other updates: display every two weeks
notify me of a new Ubuntu version: never

~~~close software-properties-gtk without reload

sudo rm /var/lib/apt/lists/lock
sudo apt update

9. change /bin/sh to bash
sudo dpkg-reconfigure dash
select [No] will use bash
ls -al /bin/sh

10. install nvdia driver (option)
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-current-updates
http://www.upubuntu.com/2012/05/how-to-install-nvidia-linux-display_17.html

11. lightdm
ver 16.04/18.04
sudo apt install lightdm
sudo dpkg-reconfigure lightdm  -> select lightdm

12. install gnome metacity
//ver 14.04
sudo apt-get install gnome-session-fallback
//ver 16.04~20.04 must use sudo
sudo apt install gnome-session-flashback

13. enable root login (option)
//set root account
sudo passwd root

//ver 12.04
sudo sh -c 'echo "greeter-show-manual-login=true" >> /etc/lightdm/lightdm.conf'

//ver 14.04
sudo sh -c 'echo "greeter-show-manual-login=true" >> /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf'

//ver 16.04 up
sudo sh -c 'echo "greeter-show-manual-login=true" >> /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf'

14. if gdm3 files exist do comment
sudo gedit /etc/pam.d/gdm-autologin
# auth required pam_succeed_if.so user != root quiet_success

sudo gedit /etc/pam.d/gdm-password
# auth required pam_succeed_if.so user != root quiet_success

15. root login error message fix (option)
sudo gedit /root/.profile
~find
mesg n || true ~~~or~~~ mesg n 2> /dev/null || true
~change to
tty -s && mesg n

16. root auto login
~select (a) or (b)
(a) lightdm
sudo sh -c 'echo "autologin-user=root" >> /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf'

ls -al /etc/lightdm/lightdm.conf
~if file exist then
sudo sh -c 'echo "autologin-user=root" >> /etc/lightdm/lightdm.conf'

reboot

(b) if using gdm3 (option)
gedit /etc/gdm3/custom.conf
//enable
AutomaticLoginEnable = true
AutomaticLogin = root
#save

reboot

17. set root default session (option)
~~check
sudo update-alternatives --config x-session-manager
~~setting for gnome-flashback-metacity must use sudo
//for 16.04/18.04
sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/lib/gnome-flashback/gnome-flashback-metacity 60
//for 16.04/24.04
sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/libexec/gnome-flashback-metacity 60

18. enable frame buffer mode (option for 14.04/16.04)
gedit /etc/default/grub
find [quiet splash]

ver 14.04  
add vga=792
to
quiet splash vga=792
http://pierre.baudu.in/other/grub.vga.modes.html

ver 16.04
add nomodeset
to
quiet splash nomodeset
plus 2 lines
GRUB_GFXMODE=1024x768
GRUB_GFXPAYLOAD_LINUX=keep

gedit /etc/modprobe.d/blacklist-framebuffer.conf
blacklist vesafb
to
#blacklist vesafb

update-grub
reboot

19. aptitude install can fixed depends problem
sudo apt install aptitude

20. install tools depends lib
sudo apt install build-essential

21. right click open terminal in folder
apt-get install nautilus-open-terminal
nautilus -q

22. show trash icon on desktop
gsettings set org.gnome.nautilus.desktop trash-icon-visible true

23. show right click menu icon
gsettings set org.gnome.desktop.interface menus-have-icons true

24. menu icon change press Alt + mouse-R

25. add/remove shortcut on Nautilus file browser
mkdir $HOME/Downloads //no need to make Desktop
gedit ~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"

gedit /etc/xdg/user-dirs.defaults //prevent restore from system restart
DESKTOP=Desktop
DOWNLOAD=Downloads
nautilus -q

26. add/remove bookmark of Nautilus files browser
gedit ~/.config/gtk-3.0/bookmarks

27. change printscreen save path
gsettings set "org.gnome.gnome-screenshot" "auto-save-directory" "file:///$USER/Desktop"

28. disable overlay scroll bars to normal
gsettings set com.canonical.desktop.interface scrollbar-mode normal

29. terminal screen repeat key
gsettings set org.gnome.settings-daemon.peripherals.keyboard repeat true

30. big-5 code input
~must use sudo
sudo software-properties-gtk -> enable all canonical
sudo apt install gcin
sudo /usr/bin/gnome-language-selector -> gcin
applications->pereferences->gcin tools-> face setting
disable popup input window
disable gcin window position use
edit area select both show
disable tray
reboot

ps: gcin can not use in snap install app, must install app as deb.

31.
If boot ubuntu meet - tsc: Fast TSC calibration failed
cat /sys/devices/system/clocksource/clocksource0/available_clocksource
show [tsc hpet acpi_pm] and we select acpi_pm

gedit /etc/default/grub
change
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792 clocksource=acpi_pm"
update-grub
reboot

32.
If task bar disappear or gsettings -> Using the 'memory' GSettings backend
mv /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/xi386-linux-gnu.conf
ldconfig
reboot

33. samba share file
apt install samba
gedit /etc/samba/smb.conf

//after
# with the net usershare command.
//add
usershare owner only = false

//modify
usershare allow guests = no
//to
usershare allow guests = yes

//add account and password in last line
[upload]
path = /mnt/upload
browseable = yes
read only = no
writable = yes
valid users = root
~~save

smbpasswd -a root

ubuntu 16.04
/etc/init.d/samba restart
ubuntu 18.04
sudo service smbd restart

34. root enable audio
pulseaudio -D

35.enable /etc/rc.local
gedit /etc/systemd/system/rc-local.service
~~~add
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
~~~save

gedit /etc/rc.local
#!/bin/bash
echo "hello test" > /var/log/test.log
exit 0
~save

chmod 755 /etc/rc.local

sudo systemctl daemon-reload
sudo systemctl enable rc-local.service
sudo systemctl restart rc-local.service
sudo systemctl status rc-local.service

refer to:
https://www.freedesktop.org/software/systemd/man/systemd.service.html

36. firefox install as deb
sudo snap remove firefox
sudo install -d -m 0755 /etc/apt/keyrings

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla

sudo apt update && sudo apt install firefox

refer to: https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

37. notepadqq
//notepad need qt 5.4.2 under ubuntu 14.04
http://download.qt.io/archive/qt/5.4/5.4.2/qt-opensource-linux-x64-5.4.2.run
sudo chmod +x qt-opensource-linux-x64-5.4.2.run
sudo ./qt-opensource-linux-x64-5.4.2.run
specify install folder /opt/Qt

//un-install if need
folder location -> /opt/Qt
/opt/Qt/MaintenanceTool

sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq

//for root
gedit /usr/share/applications/notepadqq.desktop
Exec=notepadqq %U
to
Exec=notepadqq %U --allow-root

//for root
gedit /usr/bin/notepadqq
~after 
SCRIPTPATH="$(dirname "$(readlink -f "$0")")"
~add
export QTWEBENGINE_DISABLE_SANDBOX=1

38.view all package
apt-get install synaptic

39. change close button to right
change it to the right run
gsettings set org.gnome.desktop.wm.preferences button-layout :minimize,maximize,close
change it to the left run
gsettings set org.gnome.desktop.wm.preferences button-layout close,minimize,maximize:

40. show hidden files permanently
gsettings set org.gtk.Settings.FileChooser show-hidden true

41. list view permanently
gsettings set org.gnome.nautilus.preferences default-folder-viewer 'list-view'
#restore
gsettings set org.gnome.nautilus.preferences default-folder-viewer 'icon-view'

42. find filename in zip directory recursively
find . -name "classes.zip" | xargs -I{} sh -c 'echo searching in {}; zipgrep "StringHelper" {}'

43. beep enable
gedit /etc/modprobe.d/blacklist.conf
~comment
#blacklist pcspkr
~then
apt install beep
reboot

44. disable nautilus typeahead search
gsettings set org.gnome.nautilus.preferences enable-interactive-search false
~or
apt install dconf-editor
dconf-editor -> org -> gnome -> nautilus -> preferences
[enable-interactive-search] uncheck

45. disable boot grub timeout select a. or b.
(a)
gedit /boot/grub/grub.cfg
~comment
#if [ "${timeout}" = 0 ]; then
#  set timeout=10
#fi
~save & reboot

(b)
gedit /etc/grub.d/30_os-prober
~comment
#if [ "\${timeout}" = 0 ]; then
#  set timeout=10
#fi
~save & continue

gedit /etc/default/grub
GRUB_TIMEOUT=0
~save & continue

update-grub
reboot

46. adobe reader
apt install gdebi libxml2:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386 libatk-adaptor:i386 overlay-scrollbar-gtk2:i386 unity-gtk2-module:i386
wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
gdebi ./AdbeRdr9.5.5-1_i386linux_enu.deb
acroread

47. chrome
wget --continue https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
gdebi ./google-chrome-stable_current_amd64.deb
sudo gedit /usr/bin/google-chrome
~find
exec -a "$0" "$HERE/chrome" "$@"
~change to
exec -a "$0" "$HERE/chrome" "$@" --no-sandbox

49. thunderbird install as deb
sudo snap remove --purge thunderbird
sudo apt remove thunderbird
sudo add-apt-repository ppa:mozillateam/ppa

echo '
Package: thunderbird*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
Package: thunderbird*
Pin: release o=Ubuntu
Pin-Priority: -1
' | sudo tee /etc/apt/preferences.d/mozillateamppa

sudo apt update && sudo apt install thunderbird

refer to: https://ubuntuhandbook.org/index.php/2024/03/install-thunderbird-deb-ubuntu-2404

50. svn client gui
#must gtk2 because gtk3 will generate an overlay wrong window
rm -f /usr/lib/libwx_gtk3*.*

sudo apt install libgtk2* libapr1-dev libaprutil1-dev libsvn-dev mesa-common-dev freeglut3-dev
CPU_NUM=$(grep -c processor /proc/cpuinfo)

wget --continue https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.tar.bz2
git clone --recursive https://github.com/RapidSVN/RapidSVN

tar -xvf ./wxWidgets-3.2.6.tar.bz2
cd $HOME/wxWidgets-3.2.6
ACLOCAL_PATH=/usr/share/aclocal ./autogen.sh
./configure --prefix=/usr --with-gtk=2 --with-opengl
make -j$CPU_NUM && make install

cd $HOME/RapidSVN
sed -i 's|3.0.\*|3.[0-9].\*|g' ./configure.ac
sed -i 's|OnButtonToggle(event);|//OnButtonToggle(event);|g' ./librapidsvn/src/commit_dlg.cpp
ACLOCAL_PATH=/usr/share/aclocal ./autogen.sh
./configure --prefix=/opt/rapidsvn
make -j$CPU_NUM && make install

#option
cp -f $HOME/RapidSVN/rapidsvn/res/rapidsvn.ico /opt/rapidsvn/bin

51. remote desktop control
download bin
https://github.com/rustdesk/rustdesk/releases

gedit /etc/gdm3/custom.conf
#WaylandEnable=false
~uncomment to
WaylandEnable=false
https://rustdesk.com/docs/en/client/linux/#login-screen

reboot

52. nautilus in root mode open very slow fixed
sudo apt install meson ninja-build libgirepository1.0-dev libportal-gtk4-dev libtracker-sparql-3.0-dev libcloudproviders-dev tracker-test-utils libxml2-utils

wget --continue https://github.com/GNOME/nautilus/archive/refs/tags/45.2.1.tar.gz
tar -xvf ~/nautilus-45.2.1.tar.gz
cd ~/nautilus-45.2.1
sed -i 's|sleep|//sleep|g' ./src/nautilus-main.c
meson build --prefix=/usr --localedir=/usr/share/locale
cd build
ninja
cp -f ~/nautilus-45.2.1/build/libnautilus-extension/libnautilus-extension.so* /usr/lib/x86_64-linux-gnu
cp -f ~/nautilus-45.2.1/build/extensions/image-properties/libnautilus-image-properties.so* /usr/lib/x86_64-linux-gnu/nautilus/extensions-4
cp -f ~/nautilus-45.2.1/build/extensions/audio-video-properties/libtotem-properties-page.so* /usr/lib/x86_64-linux-gnu/nautilus/extensions-4
cp -f ~/nautilus-45.2.1/build/src/nautilus /usr/bin
/usr/bin/nautilus -q

~~~ if build error ~~~
File "/usr/bin/g-ir-scanner"
No module named 'distutils.msvccompiler'
~~then
wget --continue https://download.gnome.org/sources/gobject-introspection/1.81/gobject-introspection-1.81.4.tar.xz
tar -xvf ./gobject-introspection-1.81.4.tar.xz
cd ~/gobject-introspection-1.81.4
meson build --prefix=/usr
cd build
ninja
cp -rf ~/gobject-introspection-1.81.4/build/giscanner/* /usr/lib/x86_64-linux-gnu/gobject-introspection/giscanner
cp -f ~/gobject-introspection-1.81.4/build/tools/g-ir-annotation-tool /usr/bin
cp -f ~/gobject-introspection-1.81.4/build/tools/g-ir-compiler /usr/bin
cp -f ~/gobject-introspection-1.81.4/build/tools/g-ir-doc-tool /usr/bin
cp -f ~/gobject-introspection-1.81.4/build/tools/g-ir-generate /usr/bin
cp -f ~/gobject-introspection-1.81.4/build/tools/g-ir-inspect /usr/bin
cp -f ~/gobject-introspection-1.81.4/build/tools/g-ir-scanner /usr/bin

53. set PYTHONUSERBASE for pip3 install path
gedit /etc/environment
PYTHONUSERBASE="/usr/lib/python3/dist-packages"
reboot
~~ubuntu 24.04 need assign target path
pip3 install --break-system-packages --force-reinstall --upgrade --target=/usr/lib/python3/dist-packages

1 則留言:

  1. I trace env variable $DESKTOP_SESSION
    It set in lightdm in source https://github.com/canonical/lightdm
    ~in seat.c
    session_set_env (session, "DESKTOP_SESSION", session_name);

    回覆刪除