Difference between revisions of "Ubuntu 20 04 modifications"

From RobotinoWiki
Line 48: Line 48:
  
 
apt install qdirstat gdebi
 
apt install qdirstat gdebi
 
add-apt-repository ppa:open62541-team/ppa
 
apt install libopen62541-1-dev
 
  
 
sed -i -e 's/enabled=1/enabled=0/g' /etc/default/apport
 
sed -i -e 's/enabled=1/enabled=0/g' /etc/default/apport

Revision as of 09:24, 4 November 2021

Minimum Ubuntu Desktop install

sudo su

passwd
dorp6

apt install openssh-server vim net-tools

apt remove snapd

vim /etc/ssh/sshd_config
PermitRootLogin yes
systemctl restart ssh

vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0 i8042.noaux=1"
GRUB_CMDLINE_LINUX_DEFAULT="noresume"
update-grub
cat << EOF > /root/remove_old_kernels.sh
#!/bin/bash
dpkg -l 'linux-[ihs]*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\([-0-9]*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | tee zu_entfernende_Kernel
cat zu_entfernende_Kernel | xargs sudo apt-get -y purge
rm zu_entfernende_Kernel
EOF
chmod +x /root/remove_old_kernels.sh
e2fsck -f /dev/sda1
tune2fs -U f6fec0c6-bc88-46d3-b125-e450709f1956 /dev/sda1

replace UUID by f6fec0c6-bc88-46d3-b125-e450709f1956 in /boot/grub/grub.cfg

echo "RESUME=none" > /etc/initramfs-tools/conf.d/resume

wget -qO - http://packages.openrobotino.org/keyFile | sudo apt-key add -
echo "deb http://packages2.openrobotino.org focal main" > /etc/apt/sources.list.d/openrobotino.list

apt install vino

**** run this as user robotino !!!
gsettings set org.gnome.Vino require-encryption false

apt install qdirstat gdebi

sed -i -e 's/enabled=1/enabled=0/g' /etc/default/apport

apt-get remove unattended-upgrades
apt-get remove update-notifier

cleandist

cat << EOF > /root/cleandist.sh
#!/bin/bash

sed -i "/^lasertype=/c\lasertype=realsense" /etc/robotino/smartsoft_slave.conf
sed -i "/^RobotinoIP=/c\RobotinoIP=192.168.0.1" /etc/robotino/smartsoft_slave.conf

rm -Rf /var/log/*
apt-get clean

rm -Rf /home/robotino/.cache
rm /root/*.deb

history -c
rm /home/robotino/.bash_history

rm /root/.ssh/authorized_keys
rm /root/.ssh/known_hosts

rm -Rf /opt/smartsoft/data_master/maps
rm -Rf /opt/smartsoft/data/maps

rm -f /etc/NetworkManager/system-connections/*

cat << EOF2 > /etc/NetworkManager/system-connections/eth0
[connection]
id=eth0
uuid=03d1fb6f-efcf-3f57-85e1-85b9cdb9ab9d
type=ethernet
autoconnect-priority=-999
interface-name=eth0
permissions=
secondaries=
timestamp=1547803650

[ethernet]
duplex=full
mac-address=
mac-address-blacklist=

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=auto

[ipv4]
method=auto
address1=
dns=
address2=192.168.0.1/24,0.0.0.0
dns-search=
EOF2
EOF
chmod +x /root/cleandist.sh

gcc

Wenn kein gcc installiert ist

apt install gcc-7 g++-7

Wenn gcc-9 installiert ist:

update-alternatives --remove-all gcc 
update-alternatives --remove-all g++

apt install gcc-7 g++-7 gcc-9 g++-9

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 20

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 20

sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc

sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
update-alternatives --config gcc
update-alternatives --config g++

Realsense

sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u

apt install librealsense2=2.38.1-0~realsense0.3378
apt-mark hold librealsense2

optinal

sudo apt-get install librealsense2-dbg

MRPT

add-apt-repository ppa:joseluisblancoc/mrpt-stable
apt install libmrpt-dev
(optional) apt install mrpt-apps

Change Lid Close Action

echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf
systemctl restart systemd-logind.service

Journal gateway

apt-get install systemd-journal-remote
systemctl enable systemd-journal-gatewayd.service

/etc/systemd/journald.conf

SystemMaxUse=100M

COBOTTA

apt install python3-pip python3-psycopg2
python3 -m pip install flask flask_cors

Node-RED

apt update
apt install nodejs
apt install npm
npm install –g --unsafe-perm node-red

Node-RED Pakete

npm install -g node-red-dashboard
npm install -g --unsafe-perm node-red-contrib-iiot-opcua

Zugriffsrechte für Zertifikate anpassen:
chown -R robotino:robotino /usr/local/lib/node_modules/node-red-contrib-iiot-opcua


DHCLIENT

timeout time ;

The timeout statement determines the amount of time that must pass between the time that the client begins to try to determine its address and the time that it decides that it's not going to be able to contact a server. By default, this timeout is sixty seconds. After the timeout has passed, if there are any static leases defined in the configuration file, or any leases remaining in the lease database that have not yet expired, the client will loop through these leases attempting to validate them, and if it finds one that appears to be valid, it will use that lease's address. If there are no valid static leases or unexpired leases in the lease database, the client will restart the protocol after the defined retry interval.

retry time;

The retry statement determines the time that must pass after the client has determined that there is no DHCP server present before it tries again to contact a DHCP server. By default, this is five minutes.

timeout 10;
retry 5;

plymouth

apt remove plymouth