Difference between revisions of "Ubuntu 20 04 modifications"

From RobotinoWiki
(v2)
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=v1=
 
 
Minimum Ubuntu Desktop install
 
Minimum Ubuntu Desktop install
  
Line 9: Line 8:
  
 
apt install openssh-server vim net-tools
 
apt install openssh-server vim net-tools
 +
 +
apt purge snapd
  
 
vim /etc/ssh/sshd_config
 
vim /etc/ssh/sshd_config
Line 18: Line 19:
 
GRUB_CMDLINE_LINUX_DEFAULT="noresume"
 
GRUB_CMDLINE_LINUX_DEFAULT="noresume"
 
update-grub
 
update-grub
 +
</pre>
  
 +
<pre>
 
cat << EOF > /root/remove_old_kernels.sh
 
cat << EOF > /root/remove_old_kernels.sh
 
#!/bin/bash
 
#!/bin/bash
Line 25: Line 28:
 
rm zu_entfernende_Kernel
 
rm zu_entfernende_Kernel
 
EOF
 
EOF
 +
chmod +x /root/remove_old_kernels.sh
 +
</pre>
  
 +
<pre>
 
e2fsck -f /dev/sda1
 
e2fsck -f /dev/sda1
 
tune2fs -U f6fec0c6-bc88-46d3-b125-e450709f1956 /dev/sda1
 
tune2fs -U f6fec0c6-bc88-46d3-b125-e450709f1956 /dev/sda1
Line 36: Line 42:
 
echo "deb http://packages2.openrobotino.org focal main" > /etc/apt/sources.list.d/openrobotino.list
 
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
 +
apt remove systemd-oomd
 +
</pre>
 +
 +
==cleandist==
 +
<pre>
 +
cat << EOFXX > /root/cleandist.sh
 +
#!/bin/bash
 +
 +
sed -i "/^lasertype=/c\lasertype=fromRGBD" /etc/robotino/smartsoft_slave.conf
 +
sed -i "/^cameratype=/c\cameratype=realsense" /etc/robotino/smartsoft_slave.conf
 +
sed -i "/^RobotinoIP=/c\RobotinoIP=192.168.0.1" /etc/robotino/smartsoft_slave.conf
 +
sed -i "/^SignalDOUT=/c\SignalDOUT=false" /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 << EOF > /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=
 +
method=auto
 +
 +
[ipv4]
 +
method=auto
 +
address1=
 +
dns=
 +
dns-search=
 +
EOF
 +
 +
chmod 600 /etc/NetworkManager/system-connections/eth0
 +
 +
cat << EOF > /etc/NetworkManager/system-connections/eth1
 +
[connection]
 +
id=eth1
 +
uuid=a9c22f98-0184-3d0b-ae3d-4efca5abbad6
 +
type=ethernet
 +
autoconnect-priority=-999
 +
interface-name=eth1
 +
permissions=
 +
 +
[ethernet]
 +
mac-address-blacklist=
 +
 +
[ipv4]
 +
address1=192.168.0.1/24
 +
dns-search=
 +
method=manual
 +
 +
[ipv6]
 +
addr-gen-mode=stable-privacy
 +
dns-search=
 +
method=auto
 +
EOF
 +
 +
chmod 600 /etc/NetworkManager/system-connections/eth1
 +
 +
EOFXX
 +
chmod +x /root/cleandist.sh
 
</pre>
 
</pre>
  
Line 69: Line 173:
 
</pre>
 
</pre>
  
=v2=
 
<pre>
 
apt install vino
 
 
**** run this as user robotino !!!
 
gsettings set org.gnome.Vino require-encryption false
 
 
apt install qdirstat
 
</pre>
 
 
=to be installed=
 
 
==Realsense==
 
==Realsense==
 
<pre>
 
<pre>
Line 85: Line 178:
 
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u
 
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u
  
apt install librealsense2==2.34.0-0~realsense0.2251
+
apt install librealsense2=2.38.1-0~realsense0.3378
 
apt-mark hold librealsense2
 
apt-mark hold librealsense2
  
Line 91: Line 184:
  
 
sudo apt-get install librealsense2-dbg
 
sudo apt-get install librealsense2-dbg
 +
</pre>
 +
 +
==MRPT==
 +
<pre>
 +
add-apt-repository ppa:joseluisblancoc/mrpt-stable
 +
apt install libmrpt-dev
 +
(optional) apt install mrpt-apps
 +
</pre>
 +
 +
==Change Lid Close Action==
 +
<pre>
 +
echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf
 +
systemctl restart systemd-logind.service
 +
</pre>
 +
 +
==Journal gateway==
 +
<pre>
 +
apt-get install systemd-journal-remote
 +
systemctl enable systemd-journal-gatewayd.service
 +
</pre>
 +
 +
==/etc/systemd/journald.conf==
 +
<pre>
 +
SystemMaxUse=100M
 +
</pre>
 +
 +
==COBOTTA==
 +
<pre>
 +
apt install python3-pip python3-psycopg2
 +
python3 -m pip install flask flask_cors
 +
</pre>
 +
 +
==Node-RED==
 +
<pre>
 +
apt update
 +
apt install nodejs
 +
apt install npm
 +
npm install –g --unsafe-perm node-red
 +
</pre>
 +
 +
'''Node-RED Pakete'''
 +
<pre>
 +
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
 +
</pre>
 +
 +
 +
==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.
 +
 +
<pre>
 +
timeout 10;
 +
retry 5;
 +
</pre>
 +
 +
==plymouth==
 +
<pre>
 +
apt remove plymouth
 
</pre>
 
</pre>

Latest revision as of 12:52, 6 March 2024

Minimum Ubuntu Desktop install

sudo su

passwd
dorp6

apt install openssh-server vim net-tools

apt purge 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
apt remove systemd-oomd

cleandist

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

sed -i "/^lasertype=/c\lasertype=fromRGBD" /etc/robotino/smartsoft_slave.conf
sed -i "/^cameratype=/c\cameratype=realsense" /etc/robotino/smartsoft_slave.conf
sed -i "/^RobotinoIP=/c\RobotinoIP=192.168.0.1" /etc/robotino/smartsoft_slave.conf
sed -i "/^SignalDOUT=/c\SignalDOUT=false" /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 << EOF > /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=
method=auto

[ipv4]
method=auto
address1=
dns=
dns-search=
EOF

chmod 600 /etc/NetworkManager/system-connections/eth0

cat << EOF > /etc/NetworkManager/system-connections/eth1
[connection]
id=eth1
uuid=a9c22f98-0184-3d0b-ae3d-4efca5abbad6
type=ethernet
autoconnect-priority=-999
interface-name=eth1
permissions=

[ethernet]
mac-address-blacklist=

[ipv4]
address1=192.168.0.1/24
dns-search=
method=manual

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

chmod 600 /etc/NetworkManager/system-connections/eth1

EOFXX
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