-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? # to your account
A more concise apt update
on each package installation
#428
Comments
Hello there π In the meantime you might want to join the Wimpys World Discord π£ where we have a large community of Linux π§ enthusiasts and passionate open source developers π§βπ» You might also be interested in following Wimpys World Twitch π‘ channel where Wimpy streams let's code video, including this project, several times a week. A back catalog of past live stream and other Linux related content is available on Wimpys World YouTube πΊ channel. |
in case of deb-get it should be: function update_apt() {
${ELEVATE} apt-get -q -o Dpkg::Progress-Fancy="1" -y update
}
function upgrade_apt() {
${ELEVATE} apt-get -q -o Dpkg::Progress-Fancy="1" -y upgrade
}
+
+update_repo() {
+ for source in "${@}"; do
+ echo -e Upating: "\e[0;34m/etc/apt/sources.list.d/${source}.list\e[0m"
+ sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/${source}.list" \
+ -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
+ done
+}
+
+update_ppa() {
+ ubver="$(lsb_release -cs)"
+ array="$(for i in "${@}"; do echo "${i}" | sed -r 's#(ppa):((\w|[[:digit:]]|-|_|\.)+?)/((\w|[[:digit:]]|-)+?)#\2-ubuntu-\4-'$ubver'#g; s#\.#_#g'; done)"
+ echo "${array[@]}" | while read source; do
+ echo -e Upating: "\e[0;34m/etc/apt/sources.list.d/${source}.list\e[0m"
+ sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/${source}.list" \
+ -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
+ done
+} ...
function install_apt() {
let "PACKAGE_INSTALLATION_TRIES+=1"
if [ -n "${APT_KEY_URL}" ]; then
${ELEVATE} wget -q "${APT_KEY_URL}" -O "/etc/apt/trusted.gpg.d/${APT_LIST_NAME}.asc"
fi
if [ -n "${GPG_KEY_URL}" ]; then
if [ ! -d /usr/share/keyrings ]; then
${ELEVATE} mkdir -p /usr/share/keyrings 2>/dev/null
fi
${ELEVATE} wget -q "${GPG_KEY_URL}" -O "/usr/share/keyrings/${APT_LIST_NAME}-archive-keyring.gpg"
fi
#TODO: https://superuser.com/questions/1641291/gpg-only-download-a-key-from-a-keyserver
echo -e "${APT_REPO_URL}" | ${ELEVATE} tee "/etc/apt/sources.list.d/${APT_LIST_NAME}.list"
- update_apt
+ update_repo "${APT_LIST_NAME}"
... ...
function install_ppa() {
let "PACKAGE_INSTALLATION_TRIES+=1"
local AAR_PARAMS="-y"
if [ "$(dpkg -S "$(command -v apt-add-repository)" | cut -d':' -f1)" == "software-properties-common" ]; then
AAR_PARAMS+=" --no-update"
fi
if ${ELEVATE} apt-add-repository ${AAR_PARAMS} "${PPA}"; then
- update_apt
+ update_ppa "${PPA}"
if ! package_is_installed "${APP}"; then
... |
This looks very promising. Can you open a Pull Request? |
ok, maybe tomorow |
Requesting a new feature π§βπ»
Call
apt update
for every package installation is really unnecessary traffic and time consumption.i suggest to use these functions for more concise update the only specific ppa/repo:
Call them like this:
for the ppa pattern ppa:audio-recorder/ppa:
for the .list file /etc/apt/sources.list.d/audio-recorder-ubuntu-ppa-jammy.list:
The text was updated successfully, but these errors were encountered: