Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
debian_common [2020/07/10 18:32] – [Disable Hardware Acceleration] Júne Park | debian_common [2021/07/14 10:13] – [Enable SSH] Júne Park | ||
---|---|---|---|
Line 19: | Line 19: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
+ | * [[: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 31: | Line 32: | ||
===== Initial steps ===== | ===== Initial steps ===== | ||
- | === Enable SSH === | + | ==== Enable SSH ==== |
- | Genesis step for all {{fa>linux}} Linux works. | + | Genesis step for all {{mdi>debian?2x}} Linux works. |
---- | ---- | ||
Line 53: | Line 54: | ||
Append '' | Append '' | ||
- | === Enable colorful terminal === | + | --- |
+ | |||
+ | === SSH Key to ED25519 === | ||
+ | |||
+ | <code bash> | ||
+ | ssh-keygen -o -a 100 -t ed25519 -f ~/ | ||
+ | </ | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | --- | ||
+ | |||
+ | ==== Enable colorful terminal | ||
Comment out **'' | Comment out **'' | ||
Line 62: | Line 77: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== User aliases command ==== | ||
+ | |||
+ | If you don't have '' | ||
+ | <code bash> | ||
+ | touch .bash_aliases | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | <code bash> | ||
+ | alias backup_nginx=' | ||
+ | </ | ||
---- | ---- | ||
Line 287: | Line 317: | ||
---- | ---- | ||
- | ===== Disable suspend mode ===== | + | ===== Disable unused settings ===== |
+ | |||
+ | ==== Disable suspend mode ==== | ||
Disable / Ignore '' | Disable / Ignore '' | ||
Line 310: | Line 342: | ||
---- | ---- | ||
- | ===== Disable Hardware Acceleration | + | ==== Disable Hardware Acceleration ==== |
<code bash> | <code bash> | ||
Line 321: | Line 353: | ||
---- | ---- | ||
- | ==== Debugging service ==== | ||
- | |||
- | <code bash> | ||
- | sudo service stop sshd # ssd daemon for example | ||
- | / | ||
- | </ | ||
- | |||
- | Find problem from messages in debugging mode. | ||
- | |||
- | ---- | ||
- | |||
- | |||
==== Disable power wireless off ==== | ==== Disable power wireless off ==== | ||
Line 365: | Line 385: | ||
---- | ---- | ||
- | ==== User defined command alias ==== | ||
- | If you don't have '' | + | ==== Debugging service ==== |
<code bash> | <code bash> | ||
- | touch .bash_aliases | + | sudo service stop sshd # ssd daemon for example |
+ | / | ||
</ | </ | ||
- | '' | + | Find problem from messages in debugging mode. |
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Configure locales ==== | ||
<code bash> | <code bash> | ||
- | alias backup_nginx=' | + | sudo dpkg-reconfigure locales |
</ | </ | ||
+ | |||
+ | Deselect unused '' | ||
---- | ---- | ||
+ | |||
+ | |||
+ | ===== Upgrade & Maintenance ===== | ||
+ | |||
+ | ==== Major LTS upgrade ==== | ||
+ | |||
+ | Upgrade from 18.04 LTS to 20.04 LTS ('' | ||
+ | |||
+ | Official Guide on upgrade [[https:// | ||
+ | |||
+ | === Upgrade on the command line === | ||
+ | |||
+ | Update all repository for packages, which already installed on the system. | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove | ||
+ | </ | ||
+ | |||
+ | Upgrade with major LTS with | ||
+ | |||
+ | <code bash> | ||
+ | sudo do-release-upgrade -d | ||
+ | </ | ||
+ | |||
+ | Follow the procedures and finish. | ||
+ | |||
+ | <code text> | ||
+ | Some third party entries in your sources.list were disabled. You can | ||
+ | re-enable them after the upgrade with the ' | ||
+ | or your package manager. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
==== Fetch error during update ==== | ==== Fetch error during update ==== | ||
Line 394: | Line 455: | ||
---- | ---- | ||
- | ===== Upgrade php 7.x ===== | + | ==== Upgrade php 7.x ==== |
Append additional source for php7.x latest, | Append additional source for php7.x latest, | ||
- | + | <code bash> | |
+ | sudo apt install software-properties-common | ||
+ | sudo add-apt-repository ppa: | ||
+ | </ | ||
<code bash> | <code bash> | ||
wget -q https:// | wget -q https:// | ||
- | echo "deb https:// | + | echo "deb https:// |
</ | </ | ||
+ | |||
+ | Append '' | ||
+ | |||
+ | <code bash> | ||
+ | sudo add-apt-repository ppa: | ||
+ | </ | ||
+ | |||
+ | Update source lists | ||
<code bash> | <code bash> | ||
Line 435: | Line 508: | ||
---- | ---- | ||
- | ===== Nginx repository ===== | + | ==== Install & upgrade |
Install the prerequisites: | Install the prerequisites: | ||
Line 482: | Line 555: | ||
sudo apt install nginx | sudo apt install nginx | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Upgrade mariadb ==== | ||
+ | |||
+ | <button type=" | ||
+ | |||
+ | Select '' | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get install software-properties-common | ||
+ | sudo apt-key adv --fetch-keys ' | ||
+ | sudo add-apt-repository 'deb [arch=amd64, | ||
+ | </ | ||
+ | |||
+ | Once the key is imported and the repository added you can install MariaDB 10.5 from the MariaDB repository with: | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt update | ||
+ | sudo apt install mariadb-server | ||
+ | </ | ||
+ | |||
+ | Check service is working correctly and installed version. | ||
+ | |||
+ | <code bash> | ||
+ | sudo mysql -uroot -p | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | < | ||
+ | # MariaDB 10.5 repository list - created 2020-08-31 04:34 UTC | ||
+ | # http:// | ||
+ | deb [arch=amd64] https:// | ||
+ | deb-src https:// | ||
+ | </ | ||
+ | |||
+ | If you need debug packages, add the debug component to your sources.list with: | ||
+ | |||
+ | <code bash> | ||
+ | sudo add-apt-repository 'deb [arch=amd64, | ||
+ | </ | ||
+ | |||
+ | MariaDB debug packages will now show up when searching for ' | ||
---- | ---- | ||
==== Basic commands 101 ==== | ==== Basic commands 101 ==== | ||
- | {{fa> | + | {{fa> |
=== rm === | === rm === | ||
Line 520: | Line 638: | ||
---- | ---- | ||
+ | |||
+ | === find string(s) in files === | ||
+ | |||
+ | <code bash> | ||
+ | find / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
=== [output to file] === | === [output to file] === | ||
Line 537: | Line 664: | ||
| | | | | | | | | | | | | | | | ||
- | + | <code bash> | |
- | command > output.txt | + | command > output.txt |
+ | </ | ||
The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash> |
+ | command >> output.txt | ||
+ | </ | ||
The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | | + | <code bash> |
+ | command 2> output.txt | ||
+ | </ | ||
The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash> |
+ | command 2>> output.txt | ||
+ | </ | ||
The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | | + | <code bash> |
+ | command &> output.txt | ||
+ | </ | ||
Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, it gets overwritten. | Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash> |
+ | command &>> | ||
+ | </ | ||
Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.. | Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.. | ||
- | | + | <code bash> |
+ | command | tee output.txt | ||
+ | </ | ||
The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten. | The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash> |
+ | command | tee -a output.txt | ||
+ | </ | ||
The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | | + | <code bash> |
+ | (*) | ||
+ | </ | ||
Bash has no shorthand syntax that allows piping only StdErr to a second command, which would be needed here in combination with tee again to complete the table. If you really need something like that, please look at "How to pipe stderr, and not stdout?" | Bash has no shorthand syntax that allows piping only StdErr to a second command, which would be needed here in combination with tee again to complete the table. If you really need something like that, please look at "How to pipe stderr, and not stdout?" | ||
- | | + | <code bash> |
+ | command |& tee output.txt | ||
+ | </ | ||
Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, it gets overwritten. | Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, it gets overwritten. | ||
- | | + | <code bash> |
+ | command |& tee -a output.txt | ||
+ | </ | ||
Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | Both the standard output and standard error streams will be copied to the file while still being visible in the terminal. If the file already exists, the new data will get appended to the end of the file. | ||
- | |||
---- | ---- | ||
- | === Find string(s) in files === | ||
- | <code bash> | ||
- | find / | ||
- | </ | ||
- | ---- |