Когда я пытаюсь выполнить apt update с помощью репозиториев https://ftp.ustclug.org/~zsj/anbox stretch Release, он показывает ошибку: у него нет файла выпуска

Из Спросите Ubuntu:

Ubuntu splash screen.png

Проверьте ссылку Ask Ubuntu выше, чтобы получить комментарии и, возможно, новые ответы от других пользователей.

nowсценарий bash

Поднятие тяжестей — это компонент брызг, который показывает это:

$ now

Weather report: Edmonton               March 2018            ┌────────────────────────────┐
                                  Su Mo Tu We Th Fr Sa       │   ┏━┓╺┓  ┏━┓┏━┓   ┏━┓┏┳┓   │
     \   /     Sunny                           1  2  3       │   ┃┃┃ ┃ ╹┏━┛┗━┫   ┣━┛┃┃┃   │
     .-.      -23--14 °C          4  5  6  7  8  9 10       │   ┗━┛╺┻╸╹┗━╸┗━┛   ╹  ╹ ╹   │
   ― (   ) ―   ↘ 22 km/h          11 12 13 14 15 16 17       └────────────────────────────┘
      `-’      14 km              18 19 20 21 22 23 24  
     /   \     0.9 mm             25 26 27 28 29 30 31  

Да, это действительно -14 лет в Эдмонтоне, а кажется, что -23. Хорошее время, чтобы провести длинные -выходные в игре недавно вышедшей игры Tomb Raider 2013! Может быть, освежить это резюме, чтобы переехать в Ванкувер или Монреаль...

Вот код:

#!/bin/bash

# NAME: now
# PATH: $HOME/bin
# DESC: Display current weather, calendar and time
# CALL: Called from terminal or ~/.bashrc
# DATE: Apr 6, 2017. Modified: Mar 30, 2018.

# NOTE: To display all available toilet fonts use this one-liner:
#       for i in ${TOILET_FONT_PATH:=/usr/share/figlet}/*.{t,f}lf; do j=${i##*/}; toilet -d "${i%/*}" -f "$j" "${j%.*}"; done

# Setup for 92 character wide terminal
DateColumn=34 # Default is 27 for 80 character line, 34 for 92 character line
TimeColumn=61 # Default is 49 for   "   "   "   "    61 "   "   "   "

#--------- WEATHER ----------------------------------------------------------

# Current weather, already in color so no need to override
echo " "
# Replace Edmonton with your city name, GPS, etc. See: curl wttr.in/:help
curl wttr.in/Edmonton?0 --silent --max-time 3
# Timeout #. Increase for slow connection---^

echo " "
echo " "                # Pad with blank lines for calendar & time to fit

#--------- DATE -------------------------------------------------------------

# calendar current month with today highlighted.
# colors 00=bright white, 31=red, 32=green, 33=yellow, 34=blue, 35=purple,
#        36=cyan, 37=white

tput sc                 # Save cursor position.
# Move up 9 lines
while [ $((++i)) -lt 10 ]; do tput cuu1; done

# Depending on length of your city name and country name you will:
#   1. Comment out next three lines of code. Uncomment fourth code line.
#   2. Change subtraction value and set number of print spaces to match
#      subtraction value. Then place comment on fourth code line.

Column=$(($DateColumn - 10))
tput cuf $Column        # Move x column number
printf "          "     # Blank out ", country" with x spaces
#tput cuf $DateColumn    # Position to column 27 for date display


# -h needed to turn off formating: https://askubuntu.com/questions/1013954/bash-substring-stringoffsetlength-error/1013960#1013960
cal -h > /tmp/terminal

CalLineCnt=1
Today=$(date +"%d")
# Prefix with space when length < 2
if [[ ${#Today} < 2 ]] ; then
    Today=" "$Today
fi
printf "\033[32m"   # color green -- see list above.

while IFS= read -r Cal; do
    printf "$Cal"
    if [[ $CalLineCnt > 2 ]] ; then
        # See if today is on current line & invert background
        tput cub 22
        for (( j=0 ; j <= 18 ; j += 3 )) ; do
            Test=${Cal:$j:2}            # Current day on calendar line
            if [[ "$Test" == "$Today" ]] ; then
                printf "\033[7m"        # Reverse: [ 7 m
                printf "$Today"
                printf "\033[0m"        # Normal: [ 0 m
                printf "\033[32m"       # color green -- see list above.
                tput cuf 1
            else
                tput cuf 3
            fi
        done
    fi

    tput cud1               # Down one line
    tput cuf $DateColumn    # Move 27 columns right
    CalLineCnt=$((++CalLineCnt))
done < /tmp/terminal

printf "\033[00m"           # color -- bright white (default)
echo ""

tput rc                     # Restore saved cursor position.

#-------- TIME --------------------------------------------------------------

tput sc                 # Save cursor position.
# Move up 9 lines
i=0
while [ $((++i)) -lt 10 ]; do tput cuu1; done
tput cuf $TimeColumn    # Move 49 columns right

# Do we have the toilet package?
if hash toilet 2>/dev/null; then
    echo " "$(date +"%I:%M %P")" " | \
        toilet -f future --filter border > /tmp/terminal
# Do we have the figlet package?
elif hash figlet 2>/dev/null; then
    echo $(date +"%I:%M %P") | figlet > /tmp/terminal
# else use standard font
else
    echo $(date +"%I:%M %P") > /tmp/terminal
fi

while IFS= read -r Time; do
    printf "\033[01;36m"    # color cyan
    printf "$Time"
    tput cud1               # Up one line
    tput cuf $TimeColumn    # Move 49 columns right
done < /tmp/terminal

tput rc                     # Restore saved cursor position.

exit 0

Предпосылки

Для красивого отображения времени необходимо установитьtoilet:

sudo apt install toilet

Для еще одного красивого отображения времени (, но не такого красивого )установитеfiglet:

sudo apt install figlet

В противном случае время будет отображаться «обычным» шрифтом.

Погода

Погода предоставляется командой curl wttr.in/cityname?0. В вашем терминале используйте:curl wttr.in/:helpдля получения дополнительной информации.

Погода :Изменить название города

Вы можете изменить этот раздел кода и изменить Edmontonна название вашего города:

# Replace Edmonton with your city name, GPS, etc. See: curl wttr.in/:help
curl wttr.in/Edmonton?0 --silent --max-time 3
# Timeout #. Increase for slow connection---^

Юникод поддерживается для названий городов, таких как/Москва(Москва ). Поддерживаются буквы аэропортов, такие как YEGдля Эдмонтона.

Погода :Удалить название страны

Когда терминал настроен на ширину 92 символа, погода отображается как «Эдмонтон, Канада». что, на мой взгляд, слишком длинно:

Weather with country.png

Еще хуже, когда терминал настроен на ширину 80 символов по умолчанию:

Weather country name 80 chars.png

Чтобы обойти эту проблему, ", Countryname" не отображается на экране с этим кодом:

# Depending on length of your city name and country name you will:
#   1. Comment out next three lines of code. Uncomment fourth code line.
#   2. Change subtraction value and set number of print spaces to match
#      subtraction value. Then place comment on fourth code line.
Column=$(($DateColumn - 10))
tput cuf $Column        # Move x column number
printf "          "     # Blank out ", country" with x spaces
#tput cuf $DateColumn    # Position to column 27 for date display

Если вам нужна помощь с этой частью скрипта, оставьте комментарий ниже, чтобы получить помощь.

Настройка ширины экрана терминала

Отрегулируйте интервал в соответствии с шириной экрана терминала, изменив:

# Setup for 92 character wide terminal
DateColumn=34 # Default is 27 for 80 character line, 34 for 92 character line
TimeColumn=61 # Default is 49 for   "   "   "   "    61 "   "   "   "

Связывание всего вместе в~/.bashrc

Отредактируйте файл ~/.bashrcи добавьте эти строки внизу:

# Splash Calendar and time
now

# ASCII Linux distribution display
screenfetch

Сохраните изменения файла `~/.bashrc".

Для отображения необходимой информации об Ubuntuscreenfetch:

sudo apt install screenfetch

Существуют аналогичные дисплеи screenfetch, так что выбирайте!

Если вы хотите использовать ту же командную строку с разделительной линией «─────────» между командами, измените эти строки:

if [ "$color_prompt" = yes ]; then
    PS1='───────────────────────────────────────────────────────────────────────────────────────────
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='───────────────────────────────────────────────────────────────────────────────────────────
${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

Обратите внимание, что длина разделительной строки совпадает с шириной вывода screenfetch. В этом случае он имеет ширину 92 символа и соответствующие настройки gnome-terminal.

0
29.03.2020, 14:43
1 ответ

Удалите растянутый репозиторий из вашего sources.list.

У вас должна быть только следующая строка в вашем/etc/apt/sources.list:

deb http://http.kali.org/kali kali-rolling main non-free contrib

вы можете использовать:

echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list
1
19.03.2021, 02:31

Теги

Похожие вопросы