apt
How to install a package using the python-apt API
It’s recommended to use the apt module from the python-apt Debian package. This is a higher level wrapper around the underlying C/C++ libapt-xxx libraries and has a Pythonic interface. Here’s an example script which will install the libjs-yui-doc package: #!/usr/bin/env python # aptinstall.py import apt import sys pkg_name = “libjs-yui-doc” cache = apt.cache.Cache() cache.update() cache.open() … Read more
Generating JPA2 Metamodel from a Gradle build script
While I have no problem with the use gradle makes of Ant, I agree with the original poster that it is undesirable in this case. I found a github project by Tom Anderson here that describes what I believe is a better approach. I modified it a small amount to fit my needs (output to … Read more
How to update-alternatives to Python 3 without breaking apt?
Per Debian policy, python refers to Python 2 and python3 refers to Python 3. Don’t try to change this system-wide or you are in for the sort of trouble you already discovered. Virtual environments allow you to run an isolated Python installation with whatever version of Python and whatever libraries you need without messing with … Read more
Install MySQL on Ubuntu without a password prompt
sudo debconf-set-selections <<< ‘mysql-server mysql-server/root_password password your_password’ sudo debconf-set-selections <<< ‘mysql-server mysql-server/root_password_again password your_password’ sudo apt-get -y install mysql-server For specific versions, such as mysql-server-5.6, you’ll need to specify the version in like this: sudo debconf-set-selections <<< ‘mysql-server-5.6 mysql-server/root_password password your_password’ sudo debconf-set-selections <<< ‘mysql-server-5.6 mysql-server/root_password_again password your_password’ sudo apt-get -y install mysql-server-5.6 For mysql-community-server, … Read more
What are the differences between node.js and node?
The package node is not related to node.js. nodejs is what you want, however it is arguably better to have the command be called node for compatibility with scripts that use #!/usr/bin/env node. You can either just create a symlink in your path: sudo ln -s `which nodejs` /usr/local/bin/node Or you could install nvm and … Read more