Difference between revisions of "Linux comand: apt-get"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) m (→Update apt key) Tag: visualeditor |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | ** apt-get is deprecated use apt | + | **apt-get is deprecated use apt |
| − | == System update == | + | |
| + | ==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== |
| − | + | <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> | ||
| − | + | ==Install Specific version== | |
| − | apt- | + | <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 | ||
| Line 26: | Line 43: | ||
sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://localhost:3128 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 | sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://localhost:3128 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 | ||
| − | == Update apt key == | + | ====Update apt key==== |
(solve apt KEYEXPIRED) | (solve apt KEYEXPIRED) | ||
sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys ED444FF07D8D0BF6 | sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys ED444FF07D8D0BF6 | ||
| − | Update all expired oneline | + | 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 == | + | ==Fix apt-get gone wrong== |
sudo apt-get autoremove | sudo apt-get autoremove | ||
sudo apt-get --purge remove && sudo apt-get autoclean | sudo apt-get --purge remove && sudo apt-get autoclean | ||
| Line 46: | Line 66: | ||
sudo dpkg --configure -a | sudo dpkg --configure -a | ||
| − | == apt proxy configuration == | + | ==apt proxy configuration== |
| − | /etc/apt/apt.conf.d/25proxy | + | /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> | ||
Latest revision as of 15:34, 27 June 2022
- apt-get is deprecated use apt
System update
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Package instalation
sudo apt-get install package-name
Search package
sudo apt-cache search qbasic
apt-get (update/install/purge package
apt-cache search
View Package versions
apt-cache madison gitlab-ce
apt-cache policy gitlab-ce
Install Specific version
sudo apt-get install gitlab-ce=13.0.0-ce.0
Sources file path
/etc/sources.list lista de repositorios de paquetes
apt-key
Remove expired key
apt-key list 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
To retrieve key ED444FF07D8D0BF6
gpg --keyserver pgpkeys.mit.edu --recv-key ED444FF07D8D0BF6 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
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
Using backports
cat /etc/apt/sources.list.d/backports.list
deb http://ftp.debian.org/debian jessie-backports main 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
Acquire {
HTTP::proxy "http://username:password@proxy.example.com:8080";
HTTPS::proxy "http://username:password@proxy.example.com:8080";
}