| Line 1: |
Line 1: |
| − | == System update == | + | **apt-get is deprecated use apt |
| | + | |
| | + | ==System update== |
| | sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade | | sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade |
| − | == Package instalation == | + | ==Package instalation== |
| | sudo apt-get install package-name | | sudo apt-get install package-name |
| − | == Search package == | + | ==Search package== |
| − | sudo apt-cache search qbasic
| + | <syntaxhighlight lang="bash"> |
| | + | sudo apt-cache search qbasic |
| | + | apt-get (update/install/purge package |
| | + | apt-cache search |
| | + | </syntaxhighlight> |
| | + | |
| | + | ==View Package versions== |
| | + | <syntaxhighlight lang="bash"> |
| | + | apt-cache madison gitlab-ce |
| | + | apt-cache policy gitlab-ce |
| | + | </syntaxhighlight> |
| | | | |
| − | apt-get (update/install/purge package <br />
| + | ==Install Specific version== |
| − | apt-cache search<br /> | + | <br /><syntaxhighlight lang="bash"> |
| − | <br /> | + | sudo apt-get install gitlab-ce=13.0.0-ce.0 |
| − | == Sources file path == | + | </syntaxhighlight><br /> |
| | + | ==Sources file path== |
| | /etc/sources.list lista de repositorios de paquetes | | /etc/sources.list lista de repositorios de paquetes |
| | | | |
| − | == apt-key == | + | ==apt-key== |
| − | Remove expired key | + | ===Remove expired key=== |
| | apt-key list | | apt-key list |
| | apt-key del <expired key> | | apt-key del <expired key> |
| | + | ===Export keys=== |
| | + | apt-key exportall > trusted-keys |
| | + | apt-key export 90E9F83F22250DD7 > parsoid.key |
| | + | ===Import key=== |
| | + | sudo apt-key add parsoid.key |
| | | | |
| − | == Retrive missing keys == | + | ===Retrive missing keys=== |
| | To retrieve key ED444FF07D8D0BF6 | | To retrieve key ED444FF07D8D0BF6 |
| | gpg --keyserver pgpkeys.mit.edu --recv-key ED444FF07D8D0BF6 | | gpg --keyserver pgpkeys.mit.edu --recv-key ED444FF07D8D0BF6 |
| | gpg -a --export ED444FF07D8D0BF6 | sudo apt-key add - | | gpg -a --export ED444FF07D8D0BF6 | sudo apt-key add - |
| | | | |
| | + | To use a proxy: |
| | + | sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://localhost:3128 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 |
| | + | |
| | + | ====Update apt key==== |
| | + | (solve apt KEYEXPIRED) |
| | + | sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys ED444FF07D8D0BF6 |
| | + | |
| | + | Update all expired oneline<syntaxhighlight lang="bash"> |
| | + | for K in $(apt-key list | grep expired | cut -d'/' -f2 | cut -d' ' -f1); do sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com $K; done |
| | + | |
| | + | # for K in $(apt-key list | grep expired | cut -d'/' -f2 | cut -d' ' -f1); do sudo apt-key adv --recv-keys --keyserver keys.gnupg.net $K; done |
| | + | </syntaxhighlight> |
| | | | |
| − | == Using backports == | + | ==Using backports== |
| | cat /etc/apt/sources.list.d/backports.list | | cat /etc/apt/sources.list.d/backports.list |
| | deb http://ftp.debian.org/debian jessie-backports main | | deb http://ftp.debian.org/debian jessie-backports main |
| | sudo apt-get install python-certbot-apache -t jessie-backports | | sudo apt-get install python-certbot-apache -t jessie-backports |
| | + | |
| | + | ==Fix apt-get gone wrong== |
| | + | sudo apt-get autoremove |
| | + | sudo apt-get --purge remove && sudo apt-get autoclean |
| | + | sudo apt-get -f install |
| | + | sudo apt-get update |
| | + | sudo apt-get upgrade && sudo apt-get dist-upgrade |
| | + | sudo dpkg --configure -a |
| | + | |
| | + | ==apt proxy configuration== |
| | + | /etc/apt/apt.conf.d/25proxy<syntaxhighlight lang="apt_sources"> |
| | + | Acquire { |
| | + | HTTP::proxy "http://username:password@proxy.example.com:8080"; |
| | + | HTTPS::proxy "http://username:password@proxy.example.com:8080"; |
| | + | } |
| | + | |
| | + | </syntaxhighlight> |