![]() ![]() ![]() Packer is a template-driven tool and templates are written in JSON format. You can use Packer for AWS, GCP, Azure, etc. Which helps us to create instances with predefined requirements of the client and requesters. This tool really works when it comes to creating immutable architecture. Packer is an open-source DevOps tool made by Hashicorp to create identical machine images for multiple platforms from a single JSON config file. ‘E: Could not get lock /var/lib/dpkg/lock’įirstly, we will talk about Packer. Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) Unable to lock the administration directory (/var/lib/dpkg/), are you root I am able to verify my username, (whoami returns my username), and I haven't been able to find any leads through Google or the StackExchange sites I have tried (superuser and stackoverflow). We were creating Golden Server Image for one of our clients using Packer to fulfill the prerequisites, and it is when I faced this issue. So we have a concept of creating a BASE IMAGE and GOLDEN IMAGE. To this, we need to install basic software or modify certain Configurations in each server and to all this, we call prerequisites. Sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.Today everyone is switching to cloud platforms. I tried to : cd /usr/lib/python3/dist-packages To avoid the errors, disable the hook: sudo mv /etc/apt//50command-not-foundĪfter execute sudo apt update occurred error like this: Hit:4 bionic-backports InRelease ![]() apt update itself has completed successfully. The errors you’re getting aren’t caused by apt directly, but by one of its hooks specifically, the updates for command-not-found (the helper which tells you which package to install when you try to run a command which doesn’t exist on your system). I presume there is a problem with update-conf-db somehow. Whether I leave it at python3.8 or switch to the python2.7 (with update-alternatives -config python) I keep getting the same output from apt-getĭoes anyone have any theories on how to fix this? It is still pointing to python3 despite setting the python alternatives to 2.7. There are 2 choices for the alternative python (providing /usr/bin/python). Made some slight progress here by using update-alternatives: update-alternatives -list python Lrwxrwxrwx 1 root root 18 Mar 1 21:22 /usr/bin/python3 -> /usr/bin/python3.8 Lrwxrwxrwx 1 root root 18 Apr 1 10:30 /usr/bin/python -> /usr/bin/python2.7Īnd python3 is no longer linked to /usr/bin/python: ~$ ls -al /usr/bin/python3 Now my python links look like this: ~$ ls -al /usr/bin/python Python is already the newest version (2.7.15~rc1-1).Ġ upgraded, 0 newly installed, 0 to remove and 182 not upgraded. I also was able to presumably fix my pythonpath: ~$ sudo apt -fix-broken install python ModuleNotFoundError: No module named 'apt_pkg'Į: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db then /usr/lib/cnf-update-db > /dev/null fi' Here is the result of an apt-get update: Hit:1 bionic InReleaseįile "/usr/lib/cnf-update-db", line 8, in įrom CommandNotFound.db.creator import DbCreatorįile "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in I can no longer get apt-get update or any apt-get commands to work on my system. I think I may have broken something with python because I previously tried to update to python3, linked it to /usr/bin/python (which I now realize is the wrong thing to do) don't have the commands specifically that were used. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |