alias ls='ls --color=auto'
echo nomepacchetto hold | sudo dpkg --set-selections
echo nomepacchetto install | sudo dpkg --set-selections
sudo dpkg --get-selections > lista.txt
Per bloccare un pacchetto alla sua versione corrente tramite apt-getCode: [Select]echo nomepacchetto hold | sudo dpkg --set-selectionsPer sbloccarloCode: [Select]echo nomepacchetto install | sudo dpkg --set-selectionsPer vedere lo stato dei pacchetti (bloccati o meno)Code: [Select]sudo dpkg --get-selections > lista.txt
Quote from: vaillant86 on June 11, 2010, 08:08:45 AMPer bloccare un pacchetto alla sua versione corrente tramite apt-getCode: [Select]echo nomepacchetto hold | sudo dpkg --set-selectionsPer sbloccarloCode: [Select]echo nomepacchetto install | sudo dpkg --set-selectionsPer vedere lo stato dei pacchetti (bloccati o meno)Code: [Select]sudo dpkg --get-selections > lista.txtsu arch non funge...eppure mi sembra che installai il pacchetto che conteneva dpkg :thinking: :thinking:
# This function checks whether we have a given program on the system.# No need for bulky functions in memory if we don't.#have(){ unset -v have PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && have="yes"}_comp_dpkg_installed_packages(){ grep -A 1 "Package: $1" /var/lib/dpkg/status | \ grep -B 1 -E "ok installed|half-installed|unpacked| \ half-configured|config-files" | \ grep "Package: $1" | cut -d\ -f2}# Get the word to complete# This is nicer than ${COMP_WORDS[$COMP_CWORD]}, since it handles cases# where the user is completing in the middle of a word.# (For example, if the line is "ls foobar",# and the cursor is here --------> ^# it will complete just "foo", not "foobar", which is what the user wants.)### Accepts an optional parameter indicating which characters out of# $COMP_WORDBREAKS should NOT be considered word breaks. This is useful# for things like scp where we want to return host:path and not only path._get_cword(){ if [[ "${#COMP_WORDS[COMP_CWORD]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then echo "${COMP_WORDS[COMP_CWORD]}" else local i local cur="$COMP_LINE" local index="$COMP_POINT" for (( i = 0; i <= COMP_CWORD; ++i )); do while [[ "${#cur}" -ge ${#COMP_WORDS[i]} ]] && [[ "${cur:0:${#COMP_WORDS[i]}}" != "${COMP_WORDS[i]}" ]]; do cur="${cur:1}" index="$(( index - 1 ))" done if [[ "$i" -lt "$COMP_CWORD" ]]; then local old_size="${#cur}" cur="${cur#${COMP_WORDS[i]}}" local new_size="${#cur}" index="$(( index - old_size + new_size ))" fi done if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then # We messed up! At least return the whole word so things # keep working echo "${COMP_WORDS[COMP_CWORD]}" else echo "${cur:0:$index}" fi fi}# apt-i (alias) completion.#have apt-i &&_apt_i(){ local cur prev special i COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do special=${COMP_WORDS[i]} done if [ -n "$special" ]; then COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) return 0 fi return 0} &&complete -F _apt_i -o filenames apt-i# also use _apt_i() for apt-show (alias)have apt-show && complete -F _apt_i -o filenames apt-show# for apt-showpkg (alias)have apt-showpkg && complete -F _apt_i -o filenames apt-showpkg# for "deps"have deps && complete -F _apt_i -o filenames deps# apt-r (alias) completion#have apt-r &&_apt_r(){ local cur prev special i COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do special=${COMP_WORDS[i]} done if [ -n "$special" ]; then COMPREPLY=( $( _comp_dpkg_installed_packages \ $cur ) ) return 0 fi return 0} &&complete -F _apt_r -o filenames apt-r
figo! ma come funziona?
if [ -f $HOME/.bash_completion ]; then . $HOME/.bash_completionfi
Non c'è qualche santo che li raccoglie e ci fa ..chessò...un pdf? :embas:
io voto gabo