Package management - GradedJestRisk/linux-training GitHub Wiki
List:
- list installed
- get all installed packages
apt list --installed - check if package is installed
apt list --installed <APPLICATION_NAME> - get installed version
apt-get policy <APPLICATION_NAME>
- get all installed packages
- search candidate
- search a package
apt-cache search "<PACKAGE_PARTIAL_NAME>*"
- search a package
- install
- fetch all updates
apt-get update - install:
sudo apt-get install <APPLICATION_NAME>
- fetch all updates
- upgrade
- fetch all updates
apt-get update - install them
apt-get upgrade
- fetch all updates
- remove
- application :
apt-get remove <APPLICATION_NAME> - application and configuration files:
apt-get remove <APPLICATION_NAME>
- application :
List:
- get PPA description
- list local ppa:
ls -l /etc/apt/sources.list.d/ - add (update afterwards):
sudo add-apt-repository ppa:<USER_NAME>:<PACKAGE_NAME> - add public key (message
The following signatures couldn't be verified because the public key is not available <KEY>:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <KEY> - remove ppa:
- command-line:
sudo add-apt-repository --remove ppa:PPA_Name/ppa
- command-line:
Aptitude sudo apt-get install aptitude
Use synaptic sudo apt-get synaptic
List:
- refresh cache:
apk update - install:
apk add PACKAGE_NAME
unsatisfiable constraints means there's no such package
bash-5.0# apk add llvm-toolset-7
ERROR: unsatisfiable constraints:
llvm-toolset-7 (missing):
required by: world[llvm-toolset-7]
Make package less dependent on linux distributions. All installed bin in /snap/bin
sudo apt install snapd
| Goal | Command | |
|---|---|---|
| look for eclipse | snap find eclipse | |
| install eclipse | snap install eclipse | |
| run eclipse | snap run eclipse | |
| display all snaps | snap list | |
| switch to eclipse beta channel | snap refresh eclipse --beta |
Run a GUI: nohup snap run &
Without backing up data
sudo snap remove --purge $PACKAGEList task.
sudo snap changesIt will give you back a list.
ID Status Spawn Ready Summary
377 Done today at 09:28 CEST today at 09:28 CEST Auto-refresh snaps "code", "glab"
378 Undoing today at 10:47 CEST - Remove "docker" snap
379 Done today at 10:55 CEST today at 10:55 CEST Refresh all snaps: no updatesTo stop "Remove docker app", use `abort`.
sudo snap abort 378sudo snap set system proxy.http=$PROXY sudo snap set system proxy.https=$PROXY
SDK installer for - Java - Maven - Gradle
SDKman is using `curl` under the hood.
Steps :
- check API is reachable (or [setup](https://github.com/GradedJestRisk/linux-training/wiki/curl#proxy) ) `curl https://api.sdkman.io/2/candidates/all`
- bootstrap install
curl -s "https://get.sdkman.io" | bash - get new environment
source "/home/<USER>/.sdkman/bin/sdkman-init.sh" - check version
sdk version - configure bash & zsh (consider using plugins)
If you've got `INTERNET NOT REACHABLE!`, - check proxy (see above); - configure timeouts using curl guidelines
sdkman_curl_connect_timeout=5 sdkman_curl_continue=true sdkman_curl_max_time=10
Configuration file is ~/.sdkman/etc/config
# Activate hook to load .sdkmanrc when you enter a directory
sdkman_auto_env=trueHelp sdk help
Overview:
- check available versions
sdk list <SDK_NAME> - install:
- latest version
sdk install <SDK_NAME> - previous version
sdk install <SDK_NAME> <VERSION_NUMBER> - specific version, eg openJDK 16 for java
sdk install java 16.0.1.j9-adpt
- latest version
- switch (between installed) version:
- for this shell instance only
sdk use <SDK_NAME> <VERSION_NUMBER> - for next shell instances
sdk default <SDK_NAME> <VERSION_NUMBER>
- for this shell instance only
- show version used
sdk current <SDK_NAME> - check for upgrade
sdk upgrade <SDK_NAME> - remove
sdk remove <SDK_NAME>
Upgrade modes:
- Long-Term Support (LTS)
- normal
List & change upgrade mode:
- CLI :
vi /etc/update-manager/release-upgrades - GUI: run
software-properties-gtk(Software & update, update tab
- CLI:
do-release-upgrade - GUI