@@ -154,19 +154,7 @@ func runDpkgConfigureCommand(ctx context.Context) error {
154154}
155155
156156func runUpdateCommand (ctx context.Context ) error {
157- // Create a temporary apt config file for passing custom option,
158- // without changing the sudoers file.
159- config , rmConfig , err := getAptUpdateConfigFile ()
160- if err != nil {
161- slog .Warn ("cannot write apt config file, skipped" , slog .String ("error" , err .Error ()))
162- return err
163- }
164- defer rmConfig ()
165-
166- cmd , err := paths .NewProcess (
167- []string {"APT_CONFIG" , config .String ()},
168- "sudo" , "apt-get" , "update" ,
169- )
157+ cmd , err := paths .NewProcess (nil , "sudo" , "apt-get" , "update" )
170158 if err != nil {
171159 return err
172160 }
@@ -176,27 +164,6 @@ func runUpdateCommand(ctx context.Context) error {
176164 return nil
177165}
178166
179- //go:embed apt_update.config
180- var aptUpdateConfig []byte
181-
182- func getAptUpdateConfigFile () (* paths.Path , func (), error ) {
183- config , err := paths .MkTempFile (nil , "apt.config" )
184- if err != nil {
185- return nil , nil , fmt .Errorf ("cannot create apt config file: %w" , err )
186- }
187-
188- if _ , err = config .Write (aptUpdateConfig ); err != nil {
189- return nil , nil , fmt .Errorf ("cannot write temporary apt config file: %w" , err )
190- }
191-
192- path , err := paths .New (config .Name ()).Abs ()
193- if err != nil {
194- return nil , nil , fmt .Errorf ("cannot get absolute apt config file path: %w" , err )
195- }
196-
197- return path , func () { _ = path .Remove () }, nil
198- }
199-
200167func runUpgradeCommand (ctx context.Context , names []string ) iter.Seq2 [string , error ] {
201168 env := []string {"NEEDRESTART_MODE=l" }
202169
0 commit comments