|
|
@ -1,5 +1,17 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
codename=$(lsb_release -cs)
|
|
|
|
|
|
|
|
archname=$(arch)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$codename" == "" ]; then
|
|
|
|
|
|
|
|
codename=bookworm
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$archname" == "x86_64" ]; then
|
|
|
|
|
|
|
|
archname=amd64
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
archname=arm64
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function print_help () {
|
|
|
|
function print_help () {
|
|
|
@ -26,7 +38,7 @@ function add_repo () {
|
|
|
|
case $1 in
|
|
|
|
case $1 in
|
|
|
|
chrome)
|
|
|
|
chrome)
|
|
|
|
echo '正在添加chrome源...'
|
|
|
|
echo '正在添加chrome源...'
|
|
|
|
sudo cp /usr/lib/extra-repo-book/sources.list.d/chrome.list /etc/apt/sources.list.d/
|
|
|
|
echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/chrome.list > /dev/null
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/google.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/google.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
@ -35,7 +47,7 @@ function add_repo () {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
edge)
|
|
|
|
edge)
|
|
|
|
echo '正在添加edge源...'
|
|
|
|
echo '正在添加edge源...'
|
|
|
|
sudo cp /usr/lib/extra-repo-book/sources.list.d/edge.list /etc/apt/sources.list.d/
|
|
|
|
echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge/ stable main" | sudo tee /etc/apt/sources.list.d/edge.list > /dev/null
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/microsoft.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/microsoft.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
@ -44,7 +56,7 @@ function add_repo () {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
vscode)
|
|
|
|
vscode)
|
|
|
|
echo '正在添加vscode源...'
|
|
|
|
echo '正在添加vscode源...'
|
|
|
|
sudo cp /usr/lib/extra-repo-book/sources.list.d/vscode.list /etc/apt/sources.list.d/
|
|
|
|
echo "deb [arch=amd64] http://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/microsoft.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/microsoft.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
@ -52,9 +64,17 @@ function add_repo () {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
mysql8)
|
|
|
|
mysql8)
|
|
|
|
|
|
|
|
if [ "$codename" == "bookworm" ]; then
|
|
|
|
|
|
|
|
echo "mysql8 暂时不支持debian bookworm..."
|
|
|
|
|
|
|
|
echo "有有需要, 请改用docker安装"
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
fi
|
|
|
|
echo '正在添加mysql8源...'
|
|
|
|
echo '正在添加mysql8源...'
|
|
|
|
sudo cp /usr/lib/extra-repo-book/sources.list.d/mysql.list /etc/apt/sources.list.d/
|
|
|
|
echo "deb [arch=amd64] http://repo.mysql.com/apt/debian/ ${codename} mysql-8.0" | sudo tee /etc/apt/sources.list.d/mysql.list > /dev/null
|
|
|
|
|
|
|
|
echo "deb [arch=amd64] http://repo.mysql.com/apt/debian/ ${codename} mysql-tools" | sudo tee -a /etc/apt/sources.list.d/mysql.list > /dev/null
|
|
|
|
|
|
|
|
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/mysql.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/mysql.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
|
|
|
|
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|
sudo apt update
|
|
|
|
sudo apt update
|
|
|
@ -62,7 +82,8 @@ function add_repo () {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
docker)
|
|
|
|
docker)
|
|
|
|
echo '正在添加docker源...'
|
|
|
|
echo '正在添加docker源...'
|
|
|
|
sudo cp /usr/lib/extra-repo-book/sources.list.d/docker.list /etc/apt/sources.list.d/
|
|
|
|
echo "deb [arch=${archname}] https://download.docker.com/linux/debian ${codename} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
|
|
|
|
|
|
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/docker.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
sudo cp /usr/lib/extra-repo-book/trusted.gpg.d/docker.gpg /etc/apt/trusted.gpg.d/
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
read -p "添加完成, 是否更新索引? y/n: " action
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|
if [[ "$action" == "" || "$action" == "y" ]]; then
|
|
|
|