Size: 237
Comment:
|
Size: 31177
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
<<TableOfContents(2)>> |
|
Line 6: | Line 8: |
== Systemd example services == === /etc/systemd/system/keycloak.service === {{{ [Unit] Description=keycloak service Before=site.service [Service] User=userx ExecStart=/bin/sh /home/userx/keycloak-x.y.z/bin/standalone.sh [Install] WantedBy=multi-user.target site.service }}} === /etc/systemd/system/moinmoin.service === {{{ [Unit] Description=moinmoin service Before=nginx.service [Service] User=moin ExecStart=/usr/bin/python2.7 /home/moin/moin-x.y.z/wikiserver.py [Install] WantedBy=multi-user.target nginx.service }}} === /etc/systemd/system/site.service === {{{ [Unit] Description=site service Before=nginx.service [Service] User=userx WorkingDirectory=/home/userx/Documents/site/ ExecStart=/home/userx/Documents/site/virtenv/bin/python3.8 main.py [Install] WantedBy=default.target nginx.service }}} {{{#!highlight sh systemctl enable keycloak.service systemctl enable moinmoin.service systemctl enable site.service systemctl list-dependencies systemctl start keycloak.service systemctl start moinmoin.service systemctl start site.service systemctl status keycloak.service systemctl status moinmoin.service systemctl status site.service systemctl status }}} == Sample service blah == File in /etc/init.d/blah with chmod 755: {{{#!highlight bash #!/bin/sh #/etc/init.d/blah # # Some things that run always touch /var/lock/blah # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting script blah " echo "Could do more here" ;; stop) echo "Stopping script blah" echo "Could do more here" ;; *) echo "Usage: /etc/init.d/blah {start|stop}" exit 1 ;; esac exit 0 }}} == Add service == {{{#!highlight bash update-rc.d blah defaults update-rc.d blah defaults 20 80 update-rc.d blah start 20 2 3 4 . start 30 5 . stop 80 0 1 6 . }}} == Remove service == {{{#!highlight bash update-rc.d -f blah remove }}} == Check services status == {{{#!highlight bash service --status-all service blah status }}} == Install Debian Wheezy 32 bit == == Base Install DW (Debian Wheezy) == In Virtualbox * new, * type linux * version debian * name DW * memory size 512 MB, * create virtual hard drive * vdi type * dynamically allocated * 8 GB * power on * choose debian-7.3.0-i386-DVD-1.iso * install * language english * country, other, europe, portugal * locale united states * keyboard portuguese * hostname dw * domain name example.org * root password ******** * Real name Vitor * username for account vitor * password for vitor ******** * timezone Lisbon * Partitioning method, guided, use entire disk and setup LVM * use SCSI3 sda * Separate /home /usr /var and tmp partitions * Write the changes to disk and configure LVM yes * Finish partitioning and write changes to disk * write the changes to disk? yes * scan another dvd or cd? no * use a network mirror? no * participate in the package usage survey? no * software to install: SSH server, standard system utilities, continue * install grub bootloader to the master boot record? yes * installation complete, continue * reboot * login with root user {{{#!highlight bash ifconfig ping www.sapo.pt apt-get update python -V # version 2.7.3 dpkg -l > /tmp/initialPackages.txt }}} == Installation Debian 7.5.0 amd64 (Wheezy) == === Fetch and burn the ISO === {{{#!highlight bash wget http://cdimage.debian.org/debian-cd/7.5.0/amd64/iso-dvd/debian-7.5.0-amd64-DVD-1.iso modprobe sg # fpr cdrecord cdrecord -scanbus #identify the device cdrecord -dev=1,0,0 -pad -data debian-7.5.0-amd64-DVD-1.iso # eject the DVD after burning cd / mount /dev/sr0 /mnt/cdrom #check DVD cd /mnt/cdrom ls cd / umount /mnt/cdrom }}} === Install === * Boot the machine * Insert DVD * select install * language: english * country, other, Europe, Portugal * default locale, United States * keymap: portuguese * load missing firmware from removable media? no * hostname for system: debianWheezy * domain name: bitarus.allowed.org * root pass: ........ * full name new user: vitor * username: vitor * pass: ........ * location: Lisbon * Partition disks, use entire disk and use LVM * SCSI1 * separate /home, /usr , /var, /tmp * write changes to disk and configure LVM: yes * Finish partitioning and write changes to disk * Write changes to disk? yes * install base system * kernel: linux-image-amd64 * Drivers to include in initrd: generic * scan another CD/DVD? no * use network mirror: yes * Debian archive mirror country: Portugal * ftp.pt.debian.org * HTTP proxy: <blank> * Participate in the package usage survey: No * select standard utilities * install GRUB to the MBR? yes * reboot === Install extra packages === {{{#!highlight bash #login as root df -h # check disk usage ifconfig # check network devices ping www.sapo.pt vi /etc/apt/sources.list # comment the line with deb cdrom apt-get install lynx apt-get install links apt-get install xorg apt-get install wmaker startx #starts X if all goes well xterm #open a console apt-get install iceweasel iceweasel & #run firefox with branding apt-get install kdm vi /etc/inittab #change default runlevel to 5 #id:5:initdefault #add line to runlevel 5 #x:5:respawn:/usr/bin/X reboot # after the reboot should appear the KDM login window #login xterm apt-get install vim apt-get install icedove apt-get install wmclockmon # On WindowMaker Clip click with right mouse button and select Attract Icons # On each attracted icon select Keep Icon apt-get install pidgin apt-get install emacs apt-get install netbeans apt-get install mongodb apt-get install monodevelop apt-get install mono-complete apt-get install samba apt-get install cifs-utils }}} === Eclipse === {{{#!highlight bash apt-get install eclipse #eclipse 3.8 eclipse & # create workspace in ~/workspace }}} === Two monitors with digital output === {{{#!highlight bash xrandr #show the current outputs and definitions for X vi /etc/kde4/kdm/Xsetup xrandr --output DP-2 --right-of DP-1 # two monitors setxkbmap pt # portuguese keyboard /usr/bin/xrandr --output HDMI-1 --left-of "eDP-1" }}} === Enable multiarch and install Skype === {{{#!highlight bash dpkg --add-architecture i386 apt-get update wget -O skype-install.deb http://www.skype.com/go/getskype-linux.deb dpkg -i skype-install.deb apt-get -f install dkpg -i skype-install.deb }}} === Resize /home folder === {{{#!highlight bash df -h #check sizes umount /home e2fsck -f /dev/mapper/debianWheezy-home resizefs /dev/mapper/debianWheezy-home 200G lvreduce -L 200G /dev/mapper/debianWheezy-home mount /dev/mapper/debianWheezy-home vgdisplay }}} == Debian 8.6.0 (Jessie) == * wget http://gemmei.acc.umu.se/debian-cd/8.6.0/amd64/iso-dvd/debian-8.6.0-amd64-DVD-1.iso {{{ VMDebian Linux Debian 64 bit 4096MB VDI type dynamic allocation 16 GB create debian-8.6.0-amd64-DVD-1.iso install english location other europe Portugal default local en_us.UTF8 keyboard portuguese hostname debian domain name <empty> root pass new user vitor clock Lisbon Partition, guided user entire disk LVM scsi(0,0,0) sda all in one partition write change yes Finish partitioning scan other cd dvd no use net mirrors yes portugal ftp.pt.debian.org package survey no software to install desktop kde lxde ssh web server print server standard utils displaymanager kdm install grub in MBR yes /dev/sda Finish installation continue VBoxManage setextradata "VMDebian" "CustomVideoMode1" "1366x768x32" Use 2 cpu cores in the VM run guest additions /etc/apt/sources.list # sid deb http://ftp.pt.debian.org/debian/ sid main contrib deb-src http://ftp.pt.debian.org/debian/ sid main contrib apt-get update }}} == Install debian 10 - buster on external HDD with USB adapter == * dd if=debian-live-10.1.0-amd64-standard.iso of=/dev/sda bs=512k # write ISO file to USB pen drive (8GB) * boot the pen with UEFI support (Esc and F9 to access Boot menu on HP) * after boot change the layout to pt in the file /etc/default/keyboard and then run setupcon * Boot the pen again and choose Debian installer (console) * Select portuguese language and configure the locale accordingly * Use guided partinioning, whole disk, scsi5 , sdc with 500 GB * 3 partitions were created, ESP, root / with ext4 and a swap partition * Don't use network mirrors * Define root password and add a user * Go through all the steps and reboot * Use the pen again to configure extra EFI definitions inside the ESP partition * Mount the ESP partition and inside the EFI folder create the BOOT folder * copy all files inside the debian folder to the BOOT folder * Go to the BOOT folder and copy the shimx64.efi to BOOTx64.efi * Boot using the HDD disk * If an error appears saying "/dev/sdX doesn't exist" with means grub didn't write the right HDD device name. It's required to acces grub options before boot and change the device name * After a proper boot is made into the HDD we need to run the command update-grub to update the grub with the right device name * To use WiFI we need the firmware-iwlwifi_20190114-2_all.deb to be installed, download it * Install using dpkg -i firmware-iwlwifi_20190114-2_all.deb * The WiFI device detected is wlp2s0 * ip a; iwconfig; ip link set wlp2s0 up; iwlist scan * An conf file in /etc/wpa_supplicant/wpa_supplicant.conf is required {{{ ap_scan=1 ctrl_interface=/var/run/wpa_supplicant network={ ssid="?????????" scan_ssid=1 proto=RSN WPA key_mgmt=WPA-PSK group=CCMP TKIP pairwise=CCMP TKIP psk="???????" } }}} * Run command wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -i wlp2s0 * Update the file /etc/apt/sources.list and comment cdrom entry {{{ deb http://ftp.pt.debian.org/debian/ buster main contrib non-free deb-src http://ftp.pt.debian.org/debian/ buster main contrib non-free }}} * apt update * apt install xorg wmaker xterm lightdm firefox-esr alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 htop wmclockmon vim openjdk-11-jdk docker.io * /sbin/usermod -a <user> -G docker * Test X using startx command * service lightdm start * Inside /etc/lightdm/lightdm.conf in [Seat:*] add display-setup-script=setxkbmap pt * To control the sound use the alsamixer command. The m key mutes and unmutes the master sound control * end the current session and start a new one to be able to use docker (docker ps) {{{ cd /boot/efi/EFI/ mv BOOT BOOT_bak cp -R debian BOOT cd BOOT mv shimx64.efi bootx64.efi }}} * Configure keyboard after login with ibus-setup. == Debian 10 (Buster) in VirtualBox VM == * 4GB RAM, 1 CPU, 16GB disk {{{#!highlight bash wget https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.1.0-amd64-standard.iso # run virtualbox # new vm # name Debian buster type linux, version debian 64 bit # ram 4096 GB # create virtual vdi 16GB dynamically allocated #settings storage, ide, choose virtual optical drive, attach iso debian-live-10.1.0-amd64-standard.iso to VM # start VM # choose debian installer # language: english # country other, europe, portugal, default locale en_us # keyboard portuguese # hostname debian # domain name "" # root pass: # new user: vitor # username: vitor # pwd: # configure clock: Lisbon # partition disks: guided - use entire disk and set up LVM # use scsi3, sda # all files in one partition # write changes and configure lvm: yes # volume group to use for guided partition: 16.9 GB # write changes to disk: yes # use network mirror: yes, portugal, deb.debian.org # proxy info: blank # install grub2 in MBR: yes # install in /dev/sda # install complete, continue # reboot # choose debian gnu/linux # login with root:toor apt update apt install xorg wmaker xterm lightdm firefox-esr htop wmclockmon vim docker.io /sbin/usermod -a vitor -G docker service lightdm start # Inside /etc/lightdm/lightdm.conf in [Seat:*] add display-setup-script=setxkbmap pt add greeter-setup-script=setxkbmap pt add session-setup-script=setxkbmap pt [LightDM] add display-setup-script=setxkbmap pt add greeter-setup-script=setxkbmap pt add session-setup-script=setxkbmap pt # In ~/.xsessionrc add /usr/bin/setxkbmap pt & /usr/bin/xterm & # Devices, insert guest additions cd image mount /dev/cdrom /mnt cd /mnt ./VBoxLinuxAdditions.run # window maker workspace, appearance, background, styles, green workspace, appearance, background, solid, black workspace, appearance, save theme, MyTheme # https://wiki.debian.org/Keyboard#How_to_switch_a_keyboard_layout_in_X11_.2F_graphical_desktop_environment # The keyboard setup dialog in GNOME 3 will modify IBus's configuration directly, # but for users of other X environments, # you can use the ibus-setup command to modify the settings for IBus. To force it # to defer to the settings # from /etc/default/keyboard, run ibus-setup, go to the Advanced tab, and check # Use system keyboard layout. # ibus-setup # input method # add portuguese cd C:\Program Files\Oracle\VirtualBox VBoxManage setextradata "Debian buster" "CustomVideoMode1" "1366x768x32" xrandr --output Virtual1 --mode 1360x768 cat .xsessionrc /usr/bin/setxkbmap pt& /usr/bin/xterm & xrandr --output Virtual1 --mode 1360x768 & #### get jdk8 from https://adoptopenjdk.net/ apt install net-tools openssh-server ntp ntpsec-ntpdate # add host port 2222 to vm guest port 22 /sbin/usermod -a vitor -G vboxfs # shared folder virtualbox wget https://archive.eclipse.org/technology/epp/downloads/release/luna/SR2/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz cd /opt tar xvzf eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz chgrp users eclipse/ chgrp users eclipse/* -R /opt/eclipse/eclipse.ini -startup plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316 -product org.eclipse.epp.package.java.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile --launcher.appendVmargs -vm /opt/jdk8u222-b10/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m # run_eclipse.sh /opt/eclipse/eclipse apt install thunar mousepad wmmon xrandr --output Virtual1 --mode 1366x768 mousepad oblivion theme monospace regular 12 cat lightdm.conf | grep -v "^#" /etc/lightdm/lightdm.conf [LightDM] display-setup-script = setxkbmap pt greeter-setup-script = setxknmap pt session-setup-script = setxkbmap pt [Seat:*] [XDMCPServer] [VNCServer] #### apt install xfce4-terminal apt install wmmon apt install wmix apt install mono apt install python-pip apt install cowsay apt install unzip apt install libxml2-utils apt install gimp apt install xmlsec1 xrandr --output Virtual1 --mode 1366x768 apt install curl zip unzip /sbin/dhclient enp0s3 # install openjdk 11 cd ~ wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz tar xvzf openjdk-11.0.2_linux-x64_bin.tar.gz # add ~/jdk-11.0.2/bin to ~/.bashrc # get eclipse with open jdk 11 support cd ~ wget http://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2019-09/R/eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz tar xvzf eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz # copy paste In virtualbox choose general, advanced, shared clipboard, bidirectional }}} === Add LVM disk debian buster === * Virtualbox * Settings VM, storage, controller sata, add hard disk, create new disk, vdi, next, fixed size, 8GB, create {{{#!highlight bash fdisk /dev/sdb # n, partition , 2st sector 2048, last sector 16777215, w pvcreate /dev/sdb1 # pvcreate - initialize a disk or partition for use by LVM vgdisplay # vgdisplay - display attributes of volume groups pvscan # pvscan - scan all disks for physical volumes vgextend debian-vg /dev/sdb1 # vgextend - add physical volumes to a volume group pvscan # pvscan - scan all disks for physical volumes lvdisplay # lvdisplay - display attributes of a logical volume lvextend /dev/debian-vg/root /dev/sdb1 # lvextend - extend the size of a logical volume vgdisplay # vgdisplay - display attributes of volume groups resize2fs /dev/debian-vg/root # resize2fs - ext2/ext3/ext4 file system resizer # other disk fdisk -l fdisk /dev/sdc pvcreate /dev/sdc1 vgextend debian-vg /dev/sdc1 lvextend /dev/debian-vg/root /dev/sdc1 resize2fs /dev/debian-vg/root df -h # other disk /dev/sdd 8 GB fdisk /dev/sdd pvcreate /dev/sdd1 vgextend debian-vg /dev/sdd1 lvextend /dev/debian-vg/root /dev/sdd1 resize2fs /dev/debian-vg/root df -h # other disk /dev/sde 8GB fdisk -l fdisk /dev/sde # n, partition , 2st sector 2048, last sector 16777215, w pvcreate /dev/sde1 vgextend debian-vg /dev/sde1 lvextend /dev/debian-vg/root /dev/sde1 resize2fs /dev/debian-vg/root df -h # other disk /dev/sdf 8GB fdisk -l fdisk /dev/sdf # n, partition , 2st sector 2048, last sector 16777215, w pvcreate /dev/sdf1 vgextend debian-vg /dev/sdf1 lvextend /dev/debian-vg/root /dev/sdf1 resize2fs /dev/debian-vg/root df -h }}} == Alsa and Pulseaudio == {{{#!highlight bash apt purge pulseaudio pulseaudio-utils xfce4-pulseaudio-plugin pavumeter pavucontrol apt install alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 /sbin/alsactl init aplay /usr/share/sounds/alsa/Noise.wav }}} == Sandbox == * Settings * shared folders * Machine folders * Name: sandbox * Path: c:\users\userx\sandbox Access: * Full Automount: yes * At:/sandbox {{{#!highlight bash /sbin/usermod -a userx -G vboxsf ln -s /sandbox/ sandbox }}} == Skype for Linux (deb) == * https://repo.skype.com/latest/skypeforlinux-64.deb {{{#!highlight bash apt --fix-broken install dpkg -i skypeforlinux-64.deb # debian buster }}} == Restart clipboard copy paste in VirtualBox VM == {{{#!highlight bash sudo killall VBoxClient sudo VBoxClient-all }}} == .xsessionrc with xfce-terminal and wider screen (1920x1080) == {{{#!highlight bash /usr/bin/setxkbmap pt& /usr/bin/xfce4-terminal & #/usr/bin/xterm & #xrandr --output Virtual-1 --mode 1360x768 #xrandr --output Virtual-1 --mode 1920x1080 xrandr --output Virtual-1 --mode 1680x1050 }}} == Remove package == {{{#!highlight bash sudo dpkg -P package_name }}} == Install in Lenovo Yoga 300 == * Resize ntfs drive to have space for debian about 120 GB {{{#!highlight bash # Fn+F2 to go to BIOS and change to legacy mode to support USB boot without UEFI # Legacy boot USB # Fn+F12 select boot device, USB pen with Debian 10 buster # Debian graphical installer # english, other, europe, Portugal, US, portuguese, no firmware, user vitor, use # largest continuous space, one partition, no package manager, install GRUB # search and install firmware-realtek-20190114-2_all.deb dpkg -i firmware-realtek_20190114-2_all.deb dpkg-reconfigure console-setup # UTF8 Latin1 TerminusBus 16x32 apt update apt upgrade apt install -y firefox-esr leafpad mousepad htop lxdm lxterminal apt install -y alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 apt install -y openjdk-11-jdk docker.io docker-compose /sbin/usermod -a vitor -G docker # In preferences, IBus preferences choose keyboard pt ibus-setup # timezone apt install -y ntp ntpsec-ntpdate ntpdate /sbin/ntpdate pt.pool.ntp.org /sbin/service ntp start timedatectl set-timezone Europe/Lisbon /sbin/service ntp start /sbin/usermod -aG sudo vitor # add to sudoers apt install net-tools gimp libreoffice inxi mupdf apt install curl curl -sfL https://get.k3s.io | sh - # right mouse button on bottom, add/remove panel items, add "manage networks", "battery monitor" inxi -Fxz # if issues of rfkill appear run the following echo 1 > /sys/class/rfkill/rfkill0/state sudo apt upgrade --fix-missing sudo apt update --fix-missing sudo apt install thunderbird sudo apt install wmbattery wclockmon wmix wmmon # sudo apt autoremove sudo apt upgrade --fix-missing sudo apt autoremove sudo apt upgrade --fix-missing sudo os-prober sudo vi /etc/default/grub # add entry to grub file to enable prober # GRUB_DISABLE_OS_PROBER=false sudo update-grub # install gcc sudo apt install build-essential manpages-dev }}} === /etc/apt/sources.list === {{{ deb http://ftp.pt.debian.org/debian/ buster main contrib non-free deb-src http://ftp.pt.debian.org/debian/ buster main contrib non-free deb http://ftp.pt.debian.org/debian/ sid main contrib deb-src http://ftp.pt.debian.org/debian/ sid main contrib }}} === /etc/xdg/lxsession/LXDE/autostart === {{{ @lxpanel --profile LXDE @pcmanfm --desktop --profile LXDE @xscreensaver -no-splash @/usr/bin/setxkbmap pt }}} == ~/GNUstep/Library/WindowMaker/autostart == {{{ /usr/bin/xscreensaver -no-splash & }}} * chmod 755 ~/GNUstep/Library/WindowMaker/autostart == Lock screen == {{{#!highlight sh sudo apt install xscreensaver xscreensaver & cd ~/GNUstep/Defaults mv WMRootMenu WMRootMenu.old cp /etc/GNUstep/Defaults/plmenu.Debian WMRootMenu # Lock command xscreensaver-command -lock # Window maker preferences, Applications Menu Definitions, Run program # Drag it and set caption and command }}} == Install Debian 11 bullseye in Asus A540S == * New Mitsai charger 90 Watts, M30 connector 4*1,35*11mm {{{#!highlight bash # Esc to go to BIOS and change to legacy mode to support USB boot without UEFI # Legacy boot USB # Esc select boot device, USB pen with Debian 10 buster # Debian graphical installer # english, other, europe, Portugal, US, portuguese, no firmware, user vitor, use # largest continuous space, one partition, no package manager, install GRUB apt update apt upgrade apt install xorg lxterminal alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 ntp ntpdate firefox-esr wmaker xterm lightdm htop wmclockmon vim docker.io pcmanfm -y startx reboot usermod -a vitor -G docker service lightdm start /sbin/usermod -aG sudo vitor /sbin/ntpdate pt.pool.ntp.org /sbin/service ntp start timedatectl set-timezone Europe/Lisbon apt install mousepad net-tools gimp libreoffice inxi mupdf curl wmclockmon wmmon wmix -y cd /etc/apt/ cat sources.list # add contrib and non-free iwlist inxi inxi -i ip a iwconfig iwlist scan cd /etc/wpa_supplicant/ nano wpa_supplicant.conf wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -i wlp3s0 dhclient -4 -i wlp3s0 }}} == Upgrade from buster to bullseye == {{{#!highlight bash sudo apt update sudo apt upgrade sudo apt full-upgrade sudo apt autoremove cd /etc/apt sudo cp sources.list sources.list.buster sudo nano sources.list cat /etc/apt/sources.list | grep -v "#" #deb http://deb.debian.org/debian/ bullseye main contrib #deb-src http://deb.debian.org/debian/ bullseye main #deb http://security.debian.org/debian-security bullseye-security/updates main #deb-src http://security.debian.org/debian-security bullseye-security/updates main sudo apt update sudo apt upgrade sudo apt full-upgrade sudo apt autoremove sudo reboot lsb_release -a #VirtualBox, access shared folder, Devices, insert guest additions cd image mount /dev/cdrom /mnt cd /mnt ./VBoxLinuxAdditions.run }}} == Switch java version == {{{#!highlight java sudo apt install -y openjdk-11-jdk sudo apt install -y openjdk-17-jdk sudo update-alternatives --list java sudo update-alternatives --config java # select 1 - version 11 }}} == HDMI sound == {{{#!highlight sh aplay -l # list cards and subdevices speaker-test -D plughw:0,3 -c 2 # test audio on HDMI # set subdevice nano ~/.asoundrc pcm.!default { type hw card 0 device 3 } }}} == Message Job dev-disk-by taking too long == * https://wiki.debian.org/Swap Check file /etc/fstab to verify if the defined devices or files are being mounted. With cfdisk check if the mentioned Filesystem UUID are the right ones in /etc/fstab == Upgrade to Debian 12 - bookworm in Lenovo Yoga 300 == === /etc/apt/sources.list === {{{ deb http://deb.debian.org/debian/ bookworm main contrib deb-src http://deb.debian.org/debian/ bookworm main deb http://security.debian.org/debian-security bookworm-security/updates main deb-src http://security.debian.org/debian-security bookworm-security/updates main }}} === Steps === {{{#!highlight sh apt update apt upgrade apt full-upgrade apt autoremove cd /etc/apt nano sources.list apt update apt upgrade apt full-upgrade apt autoremove update-grub reboot # choose older kernel in grub 5.10.0-13-amd64 apt install linux-image-amd64 # 6.1.0-13 lsb_release -a update-grub2 reboot uname -r # 6.1.0-13-amd64 cd /boot mv *5.10.0* /root/ mv *6.1.11* /root/ update-grub2 reboot apt install gvfs-backends apt install kde-baseapps okteta apt install python3-pip python3.11-venv python3 -m venv testmoin2 apt install openjdk-17-jdk maven }}} == Install debian 12 bookworm in external HDD == HP ProBook keys: * Esc startup menu * F9 Boot menu * F10 Bios setup * Advanced, secure boot config, Legacy support enable and secure boot disable * save changes and exit {{{#!highlight sh cd /tmp wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.6.0-amd64-netinst.iso sudo dmesg # check device for USB pen dd if=debian-12.6.0-amd64-netinst.iso of=/dev/sdb bs=512k # boot the pen with UEFI support (Esc and F9 to access Boot menu on HP) # install debian to /dev/sdc if it is the external HDD # select locale to Portugal # Guided partition # 3 partitions were created, ESP (sdc1) , root / with ext4 sdc2 and a swap partition sdc3 # input wifi info # select "debian desktop environment", "xfce", utils standard # Don't use network mirrors # Define root password and add a user # Go through all the steps and reboot # Use the pen again to configure extra EFI definitions inside the ESP partition # Mount the ESP partition and inside the EFI folder create the BOOT folder # copy all files inside the debian folder to the BOOT folder # Go to the BOOT folder and copy the shimx64.efi to BOOTx64.efi cd /boot/efi/ cd EFI/ PATH=$PATH:/sbin:/usr/sbin cp debian/* boot/ cp debian/shimx64.efi boot/bootx64.efi update-grub # create symbolic links for kernel and initrd cd /boot ln -s vmlinuz-6.1.0-23-amd64 vmlinuz ln -s initrd.img-6.1.0-23-amd64 initrd.img # Boot using the HDD disk (Esc F9 boot select) cat /home/vitor/scripts/hdmi-left.sh # xrandr --output HDMI-1 --left-of eDP-1 # /etc/lightdm/lightdm.conf [LightDM] display-setup-script = /home/vitor/scripts/hdmi-left.sh [Seat] display-setup-script=/home/vitor/scripts/hdmi-left.sh [Seat:*] display-setup-script=/home/vitor/scripts/hdmi-left.sh [XDMCPServer] [VNCServer] }}} === Boot partition via USB pen (netinst) with grub command line === * Boot with pen * Select grub command line (C) option {{{#!highlight sh ls ls (hd1,gpt2)/ set root=(hd1,gpt2) linux /boot/vmlinuz root=/dev/sdb2 initrd initrd.img boot }}} == Connect to WiFi automatically == {{{#!highlight sh # get interface name sudo dmesg | grep -i wlan [ 55.557371] rtl8723be 0000:02:00.0 wlp2s0: renamed from wlan0 # setup WiFi network nano /etc/wpa_supplicant/wpa_supplicant.conf ap_scan=1 ctrl_interface=/var/run/wpa_supplicant network={ ssid="SSID" psk="pwd" } # edit wlan interface match nano /etc/systemd/network/25-wlan.network [Match] Name=wlp2s0 [Network] DHCP=ipv4 # copy wpa conf to interface card wlp2s0 cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf systemctl enable wpa_supplicant@wlp2s0.service systemctl enable systemd-networkd.service systemctl restart systemd-networkd.service systemctl restart wpa_supplicant@wlp2s0.service systemctl disable networking.service # disable net for eth0 systemd-analyze blame 2min 47.143s vboxdrv.service 1min 32.174s systemd-networkd-wait-online.service 40.721s e2scrub_reap.service 39.375s docker.service 14.854s containerd.service 13.766s dev-sda8.device 13.355s ifupdown-pre.service 10.802s systemd-journal-flush.service 9.219s udisks2.service 7.091s ModemManager.service 3.344s cups.service 2.969s systemd-udevd.service 2.962s polkit.service 2.871s lvm2-monitor.service 2.865s avahi-daemon.service 2.784s bluetooth.service 2.719s dbus.service 2.705s iio-sensor-proxy.service 2.675s systemd-logind.service 2.197s systemd-networkd.service 2.160s apt-daily-upgrade.service systemctl disable vboxdrv.service systemctl disable systemd-networkd-wait-online.service systemctl disable docker.service systemctl disable containerd.service systemctl disable ModemManager.service reboot }}} == WiFi connect auto debian 12 bookworm == {{{#!highlight sh dmesg | grep -i wlan cat /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf update_config=1 ap_scan=1 ctrl_interface=/var/run/wpa_supplicant network={ ssid="SSIDX" scan_ssid=1 proto=RSN WPA key_mgmt=WPA-PSK group=CCMP TKIP pairwise=CCMP TKIP psk="???????????" } ps uax | grep wpa ps uax | grep dhclient systemctl list-units --type=service --state=active | grep wlp systemctl list-units --type=service --state=active | grep wpa }}} == Upgrade to Debian 12 - bookworm in Asus A540S == {{{#!highlight sh sudo bash cp /etc/apt/sources.list /etc/apt/sources.list.old nano /etc/apt/sources.list deb http://deb.debian.org/debian/ bookworm main contrib deb-src http://deb.debian.org/debian/ bookworm main deb http://security.debian.org/debian-security bookworm-security/updates main deb-src http://security.debian.org/debian-security bookworm-security/updates main apt update # libwacom9 : Depends: libwacom-common (= 2.6.0-1) but 1.8-2 is to be installed apt install libwacom-common apt update apt upgrade apt full-upgrade apt autoremove cd /etc/apt nano sources.list apt update apt upgrade apt full-upgrade apt autoremove update-grub reboot # choose older kernel in grub 5.10.0-13-amd64 uname -a # Linux debian 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux nano /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf update-grub2 reboot sudo apt install mplayer }}} |
Contents
-
Debian
- All packages list
- Systemd example services
- Sample service blah
- Add service
- Remove service
- Check services status
- Install Debian Wheezy 32 bit
- Base Install DW (Debian Wheezy)
- Installation Debian 7.5.0 amd64 (Wheezy)
- Debian 8.6.0 (Jessie)
- Install debian 10 - buster on external HDD with USB adapter
- Debian 10 (Buster) in VirtualBox VM
- Alsa and Pulseaudio
- Sandbox
- Skype for Linux (deb)
- Restart clipboard copy paste in VirtualBox VM
- .xsessionrc with xfce-terminal and wider screen (1920x1080)
- Remove package
- Install in Lenovo Yoga 300
- ~/GNUstep/Library/WindowMaker/autostart
- Lock screen
- Install Debian 11 bullseye in Asus A540S
- Upgrade from buster to bullseye
- Switch java version
- HDMI sound
- Message Job dev-disk-by taking too long
- Upgrade to Debian 12 - bookworm in Lenovo Yoga 300
- Install debian 12 bookworm in external HDD
- Connect to WiFi automatically
- WiFi connect auto debian 12 bookworm
- Upgrade to Debian 12 - bookworm in Asus A540S
Debian
Debian is a free operating system (OS) for your computer. An operating system is the set of basic programs and utilities that make your computer run.
All packages list
http://packages.debian.org/stable/allpackages
Systemd example services
/etc/systemd/system/keycloak.service
[Unit] Description=keycloak service Before=site.service [Service] User=userx ExecStart=/bin/sh /home/userx/keycloak-x.y.z/bin/standalone.sh [Install] WantedBy=multi-user.target site.service
/etc/systemd/system/moinmoin.service
[Unit] Description=moinmoin service Before=nginx.service [Service] User=moin ExecStart=/usr/bin/python2.7 /home/moin/moin-x.y.z/wikiserver.py [Install] WantedBy=multi-user.target nginx.service
/etc/systemd/system/site.service
[Unit] Description=site service Before=nginx.service [Service] User=userx WorkingDirectory=/home/userx/Documents/site/ ExecStart=/home/userx/Documents/site/virtenv/bin/python3.8 main.py [Install] WantedBy=default.target nginx.service
1 systemctl enable keycloak.service
2 systemctl enable moinmoin.service
3 systemctl enable site.service
4 systemctl list-dependencies
5 systemctl start keycloak.service
6 systemctl start moinmoin.service
7 systemctl start site.service
8 systemctl status keycloak.service
9 systemctl status moinmoin.service
10 systemctl status site.service
11 systemctl status
Sample service blah
File in /etc/init.d/blah with chmod 755:
1 #!/bin/sh
2 #/etc/init.d/blah
3 #
4 # Some things that run always
5 touch /var/lock/blah
6
7 # Carry out specific functions when asked to by the system
8 case "$1" in
9 start)
10 echo "Starting script blah "
11 echo "Could do more here"
12 ;;
13 stop)
14 echo "Stopping script blah"
15 echo "Could do more here"
16 ;;
17 *)
18 echo "Usage: /etc/init.d/blah {start|stop}"
19 exit 1
20 ;;
21 esac
22
23 exit 0
Add service
Remove service
1 update-rc.d -f blah remove
Check services status
Install Debian Wheezy 32 bit
Base Install DW (Debian Wheezy)
In Virtualbox
- new,
- type linux
- version debian
- name DW
- memory size 512 MB,
- create virtual hard drive
- vdi type
- dynamically allocated
- 8 GB
- power on
- choose debian-7.3.0-i386-DVD-1.iso
- install
- language english
- country, other, europe, portugal
- locale united states
- keyboard portuguese
- hostname dw
- domain name example.org
- root password ********
- Real name Vitor
- username for account vitor
- password for vitor ********
- timezone Lisbon
- Partitioning method, guided, use entire disk and setup LVM
- use SCSI3 sda
- Separate /home /usr /var and tmp partitions
- Write the changes to disk and configure LVM yes
- Finish partitioning and write changes to disk
- write the changes to disk? yes
- scan another dvd or cd? no
- use a network mirror? no
- participate in the package usage survey? no
- software to install: SSH server, standard system utilities, continue
- install grub bootloader to the master boot record? yes
- installation complete, continue
- reboot
- login with root user
Installation Debian 7.5.0 amd64 (Wheezy)
Fetch and burn the ISO
1 wget http://cdimage.debian.org/debian-cd/7.5.0/amd64/iso-dvd/debian-7.5.0-amd64-DVD-1.iso
2 modprobe sg # fpr cdrecord
3 cdrecord -scanbus #identify the device
4 cdrecord -dev=1,0,0 -pad -data debian-7.5.0-amd64-DVD-1.iso
5 # eject the DVD after burning
6 cd /
7 mount /dev/sr0 /mnt/cdrom #check DVD
8 cd /mnt/cdrom
9 ls
10 cd /
11 umount /mnt/cdrom
Install
- Boot the machine
- Insert DVD
- select install
- language: english
- country, other, Europe, Portugal
- default locale, United States
- keymap: portuguese
- load missing firmware from removable media? no
- hostname for system: debianWheezy
- domain name: bitarus.allowed.org
- root pass: ........
- full name new user: vitor
- username: vitor
- pass: ........
- location: Lisbon
- Partition disks, use entire disk and use LVM
- SCSI1
- separate /home, /usr , /var, /tmp
- write changes to disk and configure LVM: yes
- Finish partitioning and write changes to disk
- Write changes to disk? yes
- install base system
- kernel: linux-image-amd64
- Drivers to include in initrd: generic
- scan another CD/DVD? no
- use network mirror: yes
- Debian archive mirror country: Portugal
- ftp.pt.debian.org
HTTP proxy: <blank>
- Participate in the package usage survey: No
- select standard utilities
- install GRUB to the MBR? yes
- reboot
Install extra packages
1 #login as root
2 df -h # check disk usage
3 ifconfig # check network devices
4 ping www.sapo.pt
5 vi /etc/apt/sources.list # comment the line with deb cdrom
6 apt-get install lynx
7 apt-get install links
8 apt-get install xorg
9 apt-get install wmaker
10 startx #starts X if all goes well
11 xterm #open a console
12 apt-get install iceweasel
13 iceweasel & #run firefox with branding
14 apt-get install kdm
15 vi /etc/inittab
16 #change default runlevel to 5
17 #id:5:initdefault
18 #add line to runlevel 5
19 #x:5:respawn:/usr/bin/X
20 reboot # after the reboot should appear the KDM login window
21 #login
22 xterm
23 apt-get install vim
24 apt-get install icedove
25 apt-get install wmclockmon
26 # On WindowMaker Clip click with right mouse button and select Attract Icons
27 # On each attracted icon select Keep Icon
28 apt-get install pidgin
29 apt-get install emacs
30 apt-get install netbeans
31 apt-get install mongodb
32 apt-get install monodevelop
33 apt-get install mono-complete
34 apt-get install samba
35 apt-get install cifs-utils
Eclipse
Two monitors with digital output
Enable multiarch and install Skype
Resize /home folder
Debian 8.6.0 (Jessie)
VMDebian Linux Debian 64 bit 4096MB VDI type dynamic allocation 16 GB create debian-8.6.0-amd64-DVD-1.iso install english location other europe Portugal default local en_us.UTF8 keyboard portuguese hostname debian domain name <empty> root pass new user vitor clock Lisbon Partition, guided user entire disk LVM scsi(0,0,0) sda all in one partition write change yes Finish partitioning scan other cd dvd no use net mirrors yes portugal ftp.pt.debian.org package survey no software to install desktop kde lxde ssh web server print server standard utils displaymanager kdm install grub in MBR yes /dev/sda Finish installation continue VBoxManage setextradata "VMDebian" "CustomVideoMode1" "1366x768x32" Use 2 cpu cores in the VM run guest additions /etc/apt/sources.list # sid deb http://ftp.pt.debian.org/debian/ sid main contrib deb-src http://ftp.pt.debian.org/debian/ sid main contrib apt-get update
Install debian 10 - buster on external HDD with USB adapter
- dd if=debian-live-10.1.0-amd64-standard.iso of=/dev/sda bs=512k # write ISO file to USB pen drive (8GB)
- boot the pen with UEFI support (Esc and F9 to access Boot menu on HP)
- after boot change the layout to pt in the file /etc/default/keyboard and then run setupcon
- Boot the pen again and choose Debian installer (console)
- Select portuguese language and configure the locale accordingly
- Use guided partinioning, whole disk, scsi5 , sdc with 500 GB
- 3 partitions were created, ESP, root / with ext4 and a swap partition
- Don't use network mirrors
- Define root password and add a user
- Go through all the steps and reboot
- Use the pen again to configure extra EFI definitions inside the ESP partition
- Mount the ESP partition and inside the EFI folder create the BOOT folder
- copy all files inside the debian folder to the BOOT folder
- Go to the BOOT folder and copy the shimx64.efi to BOOTx64.efi
- Boot using the HDD disk
- If an error appears saying "/dev/sdX doesn't exist" with means grub didn't write the right HDD device name. It's required to acces grub options before boot and change the device name
- After a proper boot is made into the HDD we need to run the command update-grub to update the grub with the right device name
- To use WiFI we need the firmware-iwlwifi_20190114-2_all.deb to be installed, download it
- Install using dpkg -i firmware-iwlwifi_20190114-2_all.deb
- The WiFI device detected is wlp2s0
- ip a; iwconfig; ip link set wlp2s0 up; iwlist scan
- An conf file in /etc/wpa_supplicant/wpa_supplicant.conf is required
ap_scan=1 ctrl_interface=/var/run/wpa_supplicant network={ ssid="?????????" scan_ssid=1 proto=RSN WPA key_mgmt=WPA-PSK group=CCMP TKIP pairwise=CCMP TKIP psk="???????" }
- Run command wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -i wlp2s0
- Update the file /etc/apt/sources.list and comment cdrom entry
deb http://ftp.pt.debian.org/debian/ buster main contrib non-free deb-src http://ftp.pt.debian.org/debian/ buster main contrib non-free
- apt update
- apt install xorg wmaker xterm lightdm firefox-esr alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 htop wmclockmon vim openjdk-11-jdk docker.io
/sbin/usermod -a <user> -G docker
- Test X using startx command
- service lightdm start
- Inside /etc/lightdm/lightdm.conf in [Seat:*] add display-setup-script=setxkbmap pt
- To control the sound use the alsamixer command. The m key mutes and unmutes the master sound control
- end the current session and start a new one to be able to use docker (docker ps)
cd /boot/efi/EFI/ mv BOOT BOOT_bak cp -R debian BOOT cd BOOT mv shimx64.efi bootx64.efi
- Configure keyboard after login with ibus-setup.
Debian 10 (Buster) in VirtualBox VM
- 4GB RAM, 1 CPU, 16GB disk
1 wget https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.1.0-amd64-standard.iso
2 # run virtualbox
3 # new vm
4 # name Debian buster type linux, version debian 64 bit
5 # ram 4096 GB
6 # create virtual vdi 16GB dynamically allocated
7 #settings storage, ide, choose virtual optical drive, attach iso debian-live-10.1.0-amd64-standard.iso to VM
8 # start VM
9 # choose debian installer
10 # language: english
11 # country other, europe, portugal, default locale en_us
12 # keyboard portuguese
13 # hostname debian
14 # domain name ""
15 # root pass:
16 # new user: vitor
17 # username: vitor
18 # pwd:
19 # configure clock: Lisbon
20 # partition disks: guided - use entire disk and set up LVM
21 # use scsi3, sda
22 # all files in one partition
23 # write changes and configure lvm: yes
24 # volume group to use for guided partition: 16.9 GB
25 # write changes to disk: yes
26 # use network mirror: yes, portugal, deb.debian.org
27 # proxy info: blank
28 # install grub2 in MBR: yes
29 # install in /dev/sda
30 # install complete, continue
31 # reboot
32 # choose debian gnu/linux
33 # login with root:toor
34 apt update
35 apt install xorg wmaker xterm lightdm firefox-esr htop wmclockmon vim docker.io
36 /sbin/usermod -a vitor -G docker
37 service lightdm start
38 # Inside /etc/lightdm/lightdm.conf in [Seat:*]
39 add display-setup-script=setxkbmap pt
40 add greeter-setup-script=setxkbmap pt
41 add session-setup-script=setxkbmap pt
42
43 [LightDM]
44 add display-setup-script=setxkbmap pt
45 add greeter-setup-script=setxkbmap pt
46 add session-setup-script=setxkbmap pt
47
48 # In ~/.xsessionrc add
49 /usr/bin/setxkbmap pt &
50 /usr/bin/xterm &
51
52 # Devices, insert guest additions cd image
53 mount /dev/cdrom /mnt
54 cd /mnt
55 ./VBoxLinuxAdditions.run
56 # window maker
57 workspace, appearance, background, styles, green
58 workspace, appearance, background, solid, black
59 workspace, appearance, save theme, MyTheme
60
61 # https://wiki.debian.org/Keyboard#How_to_switch_a_keyboard_layout_in_X11_.2F_graphical_desktop_environment
62 # The keyboard setup dialog in GNOME 3 will modify IBus's configuration directly, # but for users of other X environments,
63 # you can use the ibus-setup command to modify the settings for IBus. To force it # to defer to the settings
64 # from /etc/default/keyboard, run ibus-setup, go to the Advanced tab, and check # Use system keyboard layout.
65 # ibus-setup
66 # input method
67 # add portuguese
68
69 cd C:\Program Files\Oracle\VirtualBox
70 VBoxManage setextradata "Debian buster" "CustomVideoMode1" "1366x768x32"
71
72 xrandr --output Virtual1 --mode 1360x768
73
74 cat .xsessionrc
75 /usr/bin/setxkbmap pt&
76 /usr/bin/xterm &
77 xrandr --output Virtual1 --mode 1360x768 &
78
79 #### get jdk8 from https://adoptopenjdk.net/
80 apt install net-tools openssh-server ntp ntpsec-ntpdate
81 # add host port 2222 to vm guest port 22
82 /sbin/usermod -a vitor -G vboxfs # shared folder virtualbox
83
84 wget https://archive.eclipse.org/technology/epp/downloads/release/luna/SR2/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz
85
86 cd /opt
87 tar xvzf eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz
88 chgrp users eclipse/
89 chgrp users eclipse/* -R
90
91 /opt/eclipse/eclipse.ini
92 -startup
93 plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
94 --launcher.library
95 plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316
96 -product
97 org.eclipse.epp.package.java.product
98 --launcher.defaultAction
99 openFile
100 -showsplash
101 org.eclipse.platform
102 --launcher.XXMaxPermSize
103 256m
104 --launcher.defaultAction
105 openFile
106 --launcher.appendVmargs
107 -vm
108 /opt/jdk8u222-b10/bin/java
109 -vmargs
110 -Dosgi.requiredJavaVersion=1.6
111 -XX:MaxPermSize=256m
112 -Xms40m
113 -Xmx512m
114
115 # run_eclipse.sh
116 /opt/eclipse/eclipse
117
118 apt install thunar mousepad wmmon
119 xrandr --output Virtual1 --mode 1366x768
120 mousepad oblivion theme monospace regular 12
121
122 cat lightdm.conf | grep -v "^#"
123 /etc/lightdm/lightdm.conf
124 [LightDM]
125
126 display-setup-script = setxkbmap pt
127 greeter-setup-script = setxknmap pt
128 session-setup-script = setxkbmap pt
129 [Seat:*]
130
131 [XDMCPServer]
132
133 [VNCServer]
134
135 ####
136 apt install xfce4-terminal
137 apt install wmmon
138 apt install wmix
139 apt install mono
140 apt install python-pip
141 apt install cowsay
142 apt install unzip
143 apt install libxml2-utils
144 apt install gimp
145 apt install xmlsec1
146
147 xrandr --output Virtual1 --mode 1366x768
148
149 apt install curl zip unzip
150 /sbin/dhclient enp0s3
151
152 # install openjdk 11
153 cd ~
154 wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
155 tar xvzf openjdk-11.0.2_linux-x64_bin.tar.gz
156 # add ~/jdk-11.0.2/bin to ~/.bashrc
157 # get eclipse with open jdk 11 support
158 cd ~
159 wget http://mirror.dkm.cz/eclipse/technology/epp/downloads/release/2019-09/R/eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz
160 tar xvzf eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz
161
162 # copy paste
163 In virtualbox choose general, advanced, shared clipboard, bidirectional
Add LVM disk debian buster
- Virtualbox
- Settings VM, storage, controller sata, add hard disk, create new disk, vdi, next, fixed size, 8GB, create
1 fdisk /dev/sdb # n, partition , 2st sector 2048, last sector 16777215, w
2 pvcreate /dev/sdb1 # pvcreate - initialize a disk or partition for use by LVM
3 vgdisplay # vgdisplay - display attributes of volume groups
4 pvscan # pvscan - scan all disks for physical volumes
5 vgextend debian-vg /dev/sdb1 # vgextend - add physical volumes to a volume group
6 pvscan # pvscan - scan all disks for physical volumes
7 lvdisplay # lvdisplay - display attributes of a logical volume
8 lvextend /dev/debian-vg/root /dev/sdb1 # lvextend - extend the size of a logical volume
9 vgdisplay # vgdisplay - display attributes of volume groups
10 resize2fs /dev/debian-vg/root # resize2fs - ext2/ext3/ext4 file system resizer
11 # other disk
12 fdisk -l
13 fdisk /dev/sdc
14 pvcreate /dev/sdc1
15 vgextend debian-vg /dev/sdc1
16 lvextend /dev/debian-vg/root /dev/sdc1
17 resize2fs /dev/debian-vg/root
18 df -h
19 # other disk /dev/sdd 8 GB
20 fdisk /dev/sdd
21 pvcreate /dev/sdd1
22 vgextend debian-vg /dev/sdd1
23 lvextend /dev/debian-vg/root /dev/sdd1
24 resize2fs /dev/debian-vg/root
25 df -h
26 # other disk /dev/sde 8GB
27 fdisk -l
28 fdisk /dev/sde # n, partition , 2st sector 2048, last sector 16777215, w
29 pvcreate /dev/sde1
30 vgextend debian-vg /dev/sde1
31 lvextend /dev/debian-vg/root /dev/sde1
32 resize2fs /dev/debian-vg/root
33 df -h
34
35 # other disk /dev/sdf 8GB
36 fdisk -l
37 fdisk /dev/sdf # n, partition , 2st sector 2048, last sector 16777215, w
38 pvcreate /dev/sdf1
39 vgextend debian-vg /dev/sdf1
40 lvextend /dev/debian-vg/root /dev/sdf1
41 resize2fs /dev/debian-vg/root
42 df -h
Alsa and Pulseaudio
Sandbox
- Settings
- shared folders
- Machine folders
- Name: sandbox
- Path: c:\users\userx\sandbox Access:
- Full Automount: yes
At:/sandbox
Skype for Linux (deb)
Restart clipboard copy paste in VirtualBox VM
.xsessionrc with xfce-terminal and wider screen (1920x1080)
Remove package
1 sudo dpkg -P package_name
Install in Lenovo Yoga 300
- Resize ntfs drive to have space for debian about 120 GB
1 # Fn+F2 to go to BIOS and change to legacy mode to support USB boot without UEFI
2 # Legacy boot USB
3 # Fn+F12 select boot device, USB pen with Debian 10 buster
4 # Debian graphical installer
5 # english, other, europe, Portugal, US, portuguese, no firmware, user vitor, use # largest continuous space, one partition, no package manager, install GRUB
6 # search and install firmware-realtek-20190114-2_all.deb
7 dpkg -i firmware-realtek_20190114-2_all.deb
8 dpkg-reconfigure console-setup
9 # UTF8 Latin1 TerminusBus 16x32
10 apt update
11 apt upgrade
12 apt install -y firefox-esr leafpad mousepad htop lxdm lxterminal
13 apt install -y alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0
14 apt install -y openjdk-11-jdk docker.io docker-compose
15 /sbin/usermod -a vitor -G docker
16 # In preferences, IBus preferences choose keyboard pt
17 ibus-setup
18 # timezone
19 apt install -y ntp ntpsec-ntpdate ntpdate
20 /sbin/ntpdate pt.pool.ntp.org
21 /sbin/service ntp start
22 timedatectl set-timezone Europe/Lisbon
23 /sbin/service ntp start
24 /sbin/usermod -aG sudo vitor # add to sudoers
25 apt install net-tools gimp libreoffice inxi mupdf
26 apt install curl
27 curl -sfL https://get.k3s.io | sh -
28 # right mouse button on bottom, add/remove panel items, add "manage networks", "battery monitor"
29 inxi -Fxz
30 # if issues of rfkill appear run the following
31 echo 1 > /sys/class/rfkill/rfkill0/state
32 sudo apt upgrade --fix-missing
33 sudo apt update --fix-missing
34 sudo apt install thunderbird
35 sudo apt install wmbattery wclockmon wmix wmmon
36 #
37 sudo apt autoremove
38 sudo apt upgrade --fix-missing
39 sudo apt autoremove
40 sudo apt upgrade --fix-missing
41 sudo os-prober
42 sudo vi /etc/default/grub
43 # add entry to grub file to enable prober
44 # GRUB_DISABLE_OS_PROBER=false
45 sudo update-grub
46 # install gcc
47 sudo apt install build-essential manpages-dev
/etc/apt/sources.list
deb http://ftp.pt.debian.org/debian/ buster main contrib non-free deb-src http://ftp.pt.debian.org/debian/ buster main contrib non-free deb http://ftp.pt.debian.org/debian/ sid main contrib deb-src http://ftp.pt.debian.org/debian/ sid main contrib
/etc/xdg/lxsession/LXDE/autostart
@lxpanel --profile LXDE @pcmanfm --desktop --profile LXDE @xscreensaver -no-splash @/usr/bin/setxkbmap pt
~/GNUstep/Library/WindowMaker/autostart
/usr/bin/xscreensaver -no-splash &
- chmod 755 ~/GNUstep/Library/WindowMaker/autostart
Lock screen
1 sudo apt install xscreensaver
2 xscreensaver &
3 cd ~/GNUstep/Defaults
4 mv WMRootMenu WMRootMenu.old
5 cp /etc/GNUstep/Defaults/plmenu.Debian WMRootMenu
6 # Lock command xscreensaver-command -lock
7 # Window maker preferences, Applications Menu Definitions, Run program
8 # Drag it and set caption and command
9
Install Debian 11 bullseye in Asus A540S
- New Mitsai charger 90 Watts, M30 connector 4*1,35*11mm
1 # Esc to go to BIOS and change to legacy mode to support USB boot without UEFI
2 # Legacy boot USB
3 # Esc select boot device, USB pen with Debian 10 buster
4 # Debian graphical installer
5 # english, other, europe, Portugal, US, portuguese, no firmware, user vitor, use # largest continuous space, one partition, no package manager, install GRUB
6 apt update
7 apt upgrade
8 apt install xorg lxterminal alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0 ntp ntpdate firefox-esr wmaker xterm lightdm htop wmclockmon vim docker.io pcmanfm -y
9 startx
10 reboot
11 usermod -a vitor -G docker
12 service lightdm start
13 /sbin/usermod -aG sudo vitor
14 /sbin/ntpdate pt.pool.ntp.org
15 /sbin/service ntp start
16 timedatectl set-timezone Europe/Lisbon
17 apt install mousepad net-tools gimp libreoffice inxi mupdf curl wmclockmon wmmon wmix -y
18 cd /etc/apt/
19 cat sources.list # add contrib and non-free
20 iwlist
21 inxi
22 inxi -i
23 ip a
24 iwconfig
25 iwlist scan
26 cd /etc/wpa_supplicant/
27 nano wpa_supplicant.conf
28 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -i wlp3s0
29 dhclient -4 -i wlp3s0
Upgrade from buster to bullseye
1 sudo apt update
2 sudo apt upgrade
3 sudo apt full-upgrade
4 sudo apt autoremove
5 cd /etc/apt
6 sudo cp sources.list sources.list.buster
7 sudo nano sources.list
8 cat /etc/apt/sources.list | grep -v "#"
9 #deb http://deb.debian.org/debian/ bullseye main contrib
10 #deb-src http://deb.debian.org/debian/ bullseye main
11 #deb http://security.debian.org/debian-security bullseye-security/updates main
12 #deb-src http://security.debian.org/debian-security bullseye-security/updates main
13 sudo apt update
14 sudo apt upgrade
15 sudo apt full-upgrade
16 sudo apt autoremove
17 sudo reboot
18 lsb_release -a
19
20 #VirtualBox, access shared folder, Devices, insert guest additions cd image
21 mount /dev/cdrom /mnt
22 cd /mnt
23 ./VBoxLinuxAdditions.run
Switch java version
HDMI sound
Message Job dev-disk-by taking too long
Check file /etc/fstab to verify if the defined devices or files are being mounted. With cfdisk check if the mentioned Filesystem UUID are the right ones in /etc/fstab
Upgrade to Debian 12 - bookworm in Lenovo Yoga 300
/etc/apt/sources.list
deb http://deb.debian.org/debian/ bookworm main contrib deb-src http://deb.debian.org/debian/ bookworm main deb http://security.debian.org/debian-security bookworm-security/updates main deb-src http://security.debian.org/debian-security bookworm-security/updates main
Steps
1 apt update
2 apt upgrade
3 apt full-upgrade
4 apt autoremove
5 cd /etc/apt
6 nano sources.list
7
8 apt update
9 apt upgrade
10 apt full-upgrade
11 apt autoremove
12 update-grub
13 reboot # choose older kernel in grub 5.10.0-13-amd64
14 apt install linux-image-amd64 # 6.1.0-13
15 lsb_release -a
16 update-grub2
17 reboot
18 uname -r # 6.1.0-13-amd64
19 cd /boot
20 mv *5.10.0* /root/
21 mv *6.1.11* /root/
22 update-grub2
23 reboot
24 apt install gvfs-backends
25 apt install kde-baseapps okteta
26 apt install python3-pip python3.11-venv
27 python3 -m venv testmoin2
28 apt install openjdk-17-jdk maven
Install debian 12 bookworm in external HDD
HP ProBook keys:
- Esc startup menu
- F9 Boot menu
- F10 Bios setup
- Advanced, secure boot config, Legacy support enable and secure boot disable
- save changes and exit
1 cd /tmp
2 wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.6.0-amd64-netinst.iso
3 sudo dmesg # check device for USB pen
4 dd if=debian-12.6.0-amd64-netinst.iso of=/dev/sdb bs=512k
5 # boot the pen with UEFI support (Esc and F9 to access Boot menu on HP)
6 # install debian to /dev/sdc if it is the external HDD
7 # select locale to Portugal
8 # Guided partition
9 # 3 partitions were created, ESP (sdc1) , root / with ext4 sdc2 and a swap partition sdc3
10 # input wifi info
11 # select "debian desktop environment", "xfce", utils standard
12 # Don't use network mirrors
13 # Define root password and add a user
14 # Go through all the steps and reboot
15 # Use the pen again to configure extra EFI definitions inside the ESP partition
16 # Mount the ESP partition and inside the EFI folder create the BOOT folder
17 # copy all files inside the debian folder to the BOOT folder
18 # Go to the BOOT folder and copy the shimx64.efi to BOOTx64.efi
19 cd /boot/efi/
20 cd EFI/
21 PATH=$PATH:/sbin:/usr/sbin
22 cp debian/* boot/
23 cp debian/shimx64.efi boot/bootx64.efi
24 update-grub
25 # create symbolic links for kernel and initrd
26 cd /boot
27 ln -s vmlinuz-6.1.0-23-amd64 vmlinuz
28 ln -s initrd.img-6.1.0-23-amd64 initrd.img
29 # Boot using the HDD disk (Esc F9 boot select)
30
31 cat /home/vitor/scripts/hdmi-left.sh
32 # xrandr --output HDMI-1 --left-of eDP-1
33
34 # /etc/lightdm/lightdm.conf
35 [LightDM]
36 display-setup-script = /home/vitor/scripts/hdmi-left.sh
37 [Seat]
38 display-setup-script=/home/vitor/scripts/hdmi-left.sh
39 [Seat:*]
40 display-setup-script=/home/vitor/scripts/hdmi-left.sh
41 [XDMCPServer]
42 [VNCServer]
Boot partition via USB pen (netinst) with grub command line
- Boot with pen
- Select grub command line (C) option
Connect to WiFi automatically
1 # get interface name
2 sudo dmesg | grep -i wlan
3 [ 55.557371] rtl8723be 0000:02:00.0 wlp2s0: renamed from wlan0
4 # setup WiFi network
5 nano /etc/wpa_supplicant/wpa_supplicant.conf
6 ap_scan=1
7 ctrl_interface=/var/run/wpa_supplicant
8 network={
9 ssid="SSID"
10 psk="pwd"
11 }
12 # edit wlan interface match
13 nano /etc/systemd/network/25-wlan.network
14 [Match]
15 Name=wlp2s0
16
17 [Network]
18 DHCP=ipv4
19 # copy wpa conf to interface card wlp2s0
20 cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf
21 systemctl enable wpa_supplicant@wlp2s0.service
22 systemctl enable systemd-networkd.service
23 systemctl restart systemd-networkd.service
24 systemctl restart wpa_supplicant@wlp2s0.service
25 systemctl disable networking.service # disable net for eth0
26
27 systemd-analyze blame
28 2min 47.143s vboxdrv.service
29 1min 32.174s systemd-networkd-wait-online.service
30 40.721s e2scrub_reap.service
31 39.375s docker.service
32 14.854s containerd.service
33 13.766s dev-sda8.device
34 13.355s ifupdown-pre.service
35 10.802s systemd-journal-flush.service
36 9.219s udisks2.service
37 7.091s ModemManager.service
38 3.344s cups.service
39 2.969s systemd-udevd.service
40 2.962s polkit.service
41 2.871s lvm2-monitor.service
42 2.865s avahi-daemon.service
43 2.784s bluetooth.service
44 2.719s dbus.service
45 2.705s iio-sensor-proxy.service
46 2.675s systemd-logind.service
47 2.197s systemd-networkd.service
48 2.160s apt-daily-upgrade.service
49
50 systemctl disable vboxdrv.service
51 systemctl disable systemd-networkd-wait-online.service
52 systemctl disable docker.service
53 systemctl disable containerd.service
54 systemctl disable ModemManager.service
55
56 reboot
WiFi connect auto debian 12 bookworm
1 dmesg | grep -i wlan
2 cat /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf
3 update_config=1
4 ap_scan=1
5 ctrl_interface=/var/run/wpa_supplicant
6 network={
7 ssid="SSIDX"
8 scan_ssid=1
9 proto=RSN WPA
10 key_mgmt=WPA-PSK
11 group=CCMP TKIP
12 pairwise=CCMP TKIP
13 psk="???????????"
14 }
15
16 ps uax | grep wpa
17 ps uax | grep dhclient
18
19 systemctl list-units --type=service --state=active | grep wlp
20 systemctl list-units --type=service --state=active | grep wpa
Upgrade to Debian 12 - bookworm in Asus A540S
1 sudo bash
2 cp /etc/apt/sources.list /etc/apt/sources.list.old
3 nano /etc/apt/sources.list
4 deb http://deb.debian.org/debian/ bookworm main contrib
5 deb-src http://deb.debian.org/debian/ bookworm main
6 deb http://security.debian.org/debian-security bookworm-security/updates main
7 deb-src http://security.debian.org/debian-security bookworm-security/updates main
8
9 apt update
10 # libwacom9 : Depends: libwacom-common (= 2.6.0-1) but 1.8-2 is to be installed
11 apt install libwacom-common
12 apt update
13 apt upgrade
14 apt full-upgrade
15 apt autoremove
16 cd /etc/apt
17 nano sources.list
18 apt update
19 apt upgrade
20 apt full-upgrade
21 apt autoremove
22 update-grub
23 reboot # choose older kernel in grub 5.10.0-13-amd64
24 uname -a
25 # Linux debian 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux
26 nano /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf
27 update-grub2
28 reboot
29 sudo apt install mplayer