0

A little background: I am trying to set up an automated install process in AWS that configures my servers with little intervention. I have it generally working in Ubuntu 18.04. However, in 22.04 (ARM) There are errors.

The problem: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

A solution: https://linuxconfig.org/disable-automatic-updates-on-ubuntu-22-04-jammy-jellyfish-linux#:~:text=Open%20a%20command%20line%20terminal%20and%20then%20edit,the%20file%2C%20replacing%20whatever%20is%20currently%20in%20there%3A

I have implemented the solution above. The issue is that when I run apt list --installed.

I still get: unattended-upgrades/jammy,now 2.8ubuntu1 all [installed,automatic].

In 18.04 the end of that line reads [installed]. Am I able to make the 22.04 version manual so the system sees it as such? I really don't want it to run at all on the first boot. This automated version locks up my ability to continue processing the server until I either reboot it or the process finishes. My automation breaks, where if I do it manually it works.

If I can't have that, I could also use a comment or two on knowing how to know that auto-install has finished on the first boot.

I am noticing that I have to press enter twice during the upgrade process even with the -y flag. Is this part of the issue? Or a different issue?

Thanks All!

UPDATE: My understanding of what is going on in the apt list -installed command is corrected from the comments.

My issues now are:

  1. Is there a way I can start the process without using sleep and an arbitrary number?
  2. How do I deal with apt-get upgrade needing me to press enter to continue my custom installations?

1 Answers1

0

Using Muru's link and reading there: How to make a package manager wait if another instance of APT is running?

I went down to Mendhak's comment near the bottom and apparently, since 20.04, the functionality I need has been in apt-get.

His comment led me to: https://blog.sinjakli.co.uk/2021/10/25/waiting-for-apt-locks-without-the-hacky-bash-scripts/. Which is exactly the same application and issue that I am working with.

The short version is: sudo apt-get -o DPkg::Lock::Timeout=60 install packagename

Between the other thread and the external link, I had no shortage of options. Please support the posters there also.