Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform a check of required packages befor updating pihole #4326

Merged
merged 1 commit into from Sep 12, 2021
Merged

Perform a check of required packages befor updating pihole #4326

merged 1 commit into from Sep 12, 2021

Conversation

yubiuser
Copy link
Member

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes, and have included unit tests where possible.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)

Please make sure you Sign Off all commits. Pi-hole enforces the DCO.


Follow up of #4274


For discussion.

What does this PR aim to accomplish?:
Fixes rare edge cases like #2866

If users have removed packages that are part of INSTALLER_DEPS (e.g. git), pihole -up will fail.
This PR re-uses the install_dependent_packages "${INSTALLER_DEPS[@]}" from the installer script to check, and if necessary, install the missing packages.

rockpi@rockpi-4b:~$ sudo apt remove git
[sudo] password for rockpi: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  git-man liberror-perl
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  git
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 36.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 41003 files and directories currently installed.)
Removing git (1:2.20.1-2+deb10u3) ...
rockpi@rockpi-4b:~$ pihole -up

  Error: Core Pi-hole repo is missing from system!
  Please re-run install script from https://pi-hole.net

rockpi@rockpi-4b:~$ sudo ./update.sh 
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.29-1~deb10u1
  [i] Checking for git (will be installed)
  [✓] Checking for iproute2
  [✓] Checking for whiptail
  [i] Processing apt-get install(s) for: git, please wait...
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Selecting previously unselected package git.
(Reading database ... 40250 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.20.1-2+deb10u3_arm64.deb ...
Unpacking git (1:2.20.1-2+deb10u3) ...
Setting up git (1:2.20.1-2+deb10u3) ...
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [i] Checking for updates...
  [i] Pi-hole Core:	update available
  [i] Web Interface:	up to date
  [i] FTL:		update available
  [i] Warning: You are using FTL from a custom branch (release/v5.9) and might be missing future releases.

Signed-off-by: Christian König <ckoenig@posteo.de>
@dschaper dschaper merged commit 6d67099 into pi-hole:development Sep 12, 2021
@yubiuser yubiuser deleted the fix_update2 branch October 11, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants