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 [2019/05/27 09:12] – [Upgrade php 7.x] Júne Park | debian_common [2020/07/25 13:01] – [Upgrade php 7.x] Júne Park | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
* {{fa> | * {{fa> | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
* {{fa> | * {{fa> | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 14: | Line 16: | ||
* [[: | * [[: | ||
* {{fa> | * {{fa> | ||
- | * [[: | + | * [[: |
* [[: | * [[: | ||
* [[: | * [[: | ||
Line 22: | Line 24: | ||
</ | </ | ||
- | ===== General info on Debian | + | ====== General info on Debian |
{{: | {{: | ||
---- | ---- | ||
- | ==== Initial steps freshly | + | ===== Initial steps ===== |
- | === Enable SSH === | + | ==== Enable SSH ==== |
- | Genesis step for all {{fa>linux}} Linux works. | + | Genesis step for all {{mdi>debian?2x}} Linux works. |
---- | ---- | ||
Line 62: | Line 64: | ||
---- | ---- | ||
- | ==== Configure Dynamic DNS ==== | + | |
+ | ==== User aliases command ==== | ||
+ | |||
+ | If you don't have '' | ||
+ | <code bash> | ||
+ | touch .bash_aliases | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | <code bash> | ||
+ | alias backup_nginx=' | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | ===== Configure Dynamic DNS ===== | ||
=== Google Domains with ddclient === | === Google Domains with ddclient === | ||
Line 284: | Line 301: | ||
---- | ---- | ||
+ | |||
+ | ===== Disable unused settings ===== | ||
==== Disable suspend mode ==== | ==== Disable suspend mode ==== | ||
Line 319: | Line 338: | ||
---- | ---- | ||
- | ==== Debugging service | + | |
+ | ==== Disable power wireless off ==== | ||
<code bash> | <code bash> | ||
- | sudo service stop sshd # ssd daemon for example | + | sudo iwconfig wlan0 power off |
- | / | + | |
</ | </ | ||
- | |||
- | Find problem from messages in debugging mode. | ||
---- | ---- | ||
- | ==== Delete unnecessary files regularly | + | ==== Disable Bluetooth service |
- | '' | + | |
- | <code bash> | + | <code bash> |
- | 30 */6 * * * /usr/bin/find /..((your path)).../ -name '*.nfo' -exec rm -f {} \; | + | vi /etc/bluetooth/main.conf |
- | </ | + | </ |
- | Delete empty directory at 30 minutes past every 12 hours | + | Edit the line with '' |
+ | <code ini> | ||
+ | AutoEnable = false | ||
+ | </ | ||
+ | |||
+ | A more radical way is to either stop the bluetooth service | ||
<code bash> | <code bash> | ||
- | 30 */12 * * * / | + | sudo systemctl stop bluetooth.service |
</ | </ | ||
+ | |||
+ | Or even more radical is to disable it permanently | ||
+ | <code bash> | ||
+ | sudo systemctl disable bluetooth | ||
+ | </ | ||
---- | ---- | ||
- | ==== Delete all files except for desired file types ==== | + | ==== Debugging service |
<code bash> | <code bash> | ||
- | find . -type f ! -name ' | + | sudo service stop sshd # ssd daemon for example |
- | </ | + | / |
+ | </ | ||
+ | |||
+ | Find problem from messages in debugging mode. | ||
---- | ---- | ||
- | ==== Disable power wireless off ==== | + | |
+ | ==== Configure locales | ||
<code bash> | <code bash> | ||
- | | + | |
</ | </ | ||
+ | |||
+ | Deselect unused '' | ||
---- | ---- | ||
- | ==== User defined command alias ==== | ||
- | If you don't have '' | + | |
+ | ===== 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> | <code bash> | ||
- | touch .bash_aliases | + | sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove |
</ | </ | ||
- | '' | + | Upgrade with major LTS with |
<code bash> | <code bash> | ||
- | alias backup_nginx=' | + | sudo do-release-upgrade |
</ | </ | ||
+ | |||
+ | 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 388: | Line 440: | ||
---- | ---- | ||
- | ===== 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 427: | Line 491: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | ==== Install & upgrade Nginx ==== | ||
+ | |||
+ | Install the prerequisites: | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt install curl gnupg2 ca-certificates lsb-release | ||
+ | </ | ||
+ | |||
+ | To set up the apt repository for stable nginx packages, run the following command: | ||
+ | <code bash> | ||
+ | echo "deb http:// | ||
+ | | sudo tee / | ||
+ | </ | ||
+ | |||
+ | If you would like to use mainline nginx packages, run the following command instead: | ||
+ | |||
+ | <code bash> | ||
+ | echo "deb http:// | ||
+ | | sudo tee / | ||
+ | </ | ||
+ | |||
+ | Next, import an official nginx signing key so apt could verify the packages authenticity: | ||
+ | |||
+ | <code bash> | ||
+ | curl -fsSL https:// | ||
+ | </ | ||
+ | |||
+ | Verify that you now have the proper key: | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-key fingerprint ABF5BD827BD9BF62 | ||
+ | </ | ||
+ | |||
+ | The output should contain the full fingerprint '' | ||
+ | |||
+ | <code txt> | ||
+ | pub | ||
+ | 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 | ||
+ | uid [ unknown] nginx signing key < | ||
+ | </ | ||
+ | |||
+ | To install nginx, run the following commands: | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt update | ||
+ | sudo apt install nginx | ||
+ | </ | ||
---- | ---- | ||
==== Basic commands 101 ==== | ==== Basic commands 101 ==== | ||
- | {{fa> | + | {{fa> |
=== rm === | === rm === | ||
Line 465: | Line 579: | ||
---- | ---- | ||
+ | |||
+ | === find string(s) in files === | ||
+ | |||
+ | <code bash> | ||
+ | find / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
=== [output to file] === | === [output to file] === | ||
Line 482: | Line 605: | ||
| | | | | | | | | | | | | | | | ||
- | + | <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 / | ||
- | </ | ||
- | |||
- | ---- |