Skip to content

Commit

Permalink
Revert "implement retries for dpkg err"
Browse files Browse the repository at this point in the history
This reverts commit 9e6c438.
  • Loading branch information
samlhuillier committed May 23, 2023
1 parent 9e6c438 commit 1ec0bc0
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions pkg/autostartconf/aptbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ type AptBinaryConfigurer struct {
func (abc AptBinaryConfigurer) Install() error {
_ = abc.UnInstall() // best effort

var err error
for i := 0; i < 3; i++ {
err = ExecCommands([][]string{
{"apt-get", "update"},
append([]string{"apt-get", "install", "-y"}, abc.aptDependencies...),
})
if err == nil {
break
}
}

// install apt dependencies
err := ExecCommands([][]string{
{"apt-get", "update"},
append([]string{"apt-get", "install", "-y"}, abc.aptDependencies...),
})
if err != nil {
if strings.Contains(err.Error(), "dpkg --configure -a") {
err = ExecCommands([][]string{{"sudo dpkg --configure -a"}})
Expand Down

0 comments on commit 1ec0bc0

Please sign in to comment.