EzDevInfo.com

apt interview questions

Top apt frequently asked interview questions

Debian: How can I pull a single package with dependencies from another repository?

I am on debian etch and I want to pull subversion1.5.1 from testing though it is a production machine. I need to keep the risk minimal.

Any hints?


Source: (StackOverflow)

How to compare Debian package versions

I looked at python-apt and python-debian, and they don't seem to have functionality to compare package versions. Do I have to write my own, or is there something I can use?

Ideally, it would look something like:

>>> v1 = apt.version("1:1.3.10-0.3")
>>> v2 = apt.version("1.3.4-1")
>>> v1 > v2
True

Source: (StackOverflow)

Advertisements

what are the differences between node.js and node?

I have installed node.js in my machine (linux mint 15), when I run node example.js, it says:

The program 'node' can be found in the following packages:
 * node
 * nodejs-legacy
Try: sudo apt-get install <selected package>

So what are the differences between node and nodejs? I had both node.js and node installed previously, but when I run node example.js, the web server doesn't start at all. So I deleted node and kept node.js.


Source: (StackOverflow)

How to install "make" in ubuntu? [closed]

I'm trying to install "yum" or "apt-get" into my system "ubuntu centOS". I did download the binary files for these two programs from the internet using the command wget. but after decompressing the files using the command "tar -zxvf "filename" ,then configuring the file "./configuring", and then when I want to use the command "make" I get the following error "make: not found".

I have searched for a method to download the "make" command but all the methods I found on the net use either the command "yum" or "apt-get" and I don't have any of them.


Source: (StackOverflow)

install mysql on ubuntu without password prompt

How to write a script to install MySQL server on Ubuntu?

sudo apt-get install mysql will install, but also ask for a password to be entered in the console.

How to do this in a non-interactive way? That is, write a script that can provide the password?

#!/bin/bash
sudo apt-get install mysql  # To install mysql server

# How to write script for assigning password to mysql root user
# End

Source: (StackOverflow)

What is the difference/usage of homebrew, macports or other package installation tools? [closed]

I've just recently switched to a Mac from Ubuntu. I was disappointed that mac doesn't have the convenient sudo apt-get in Ubuntu. I've heard that I should use homebrew but I'm not exactly sure what homebrew or macports does?


Source: (StackOverflow)

How to check the version before install packages using apt-get

I'm thinking to install hylafax+ version 5.5.4 which was release last month on my Debian PC.

I checked dpkg -l | grep "hylafax" and found out that the current version is 5.5.3. Then I checked apt-cache search hylafax and saw the packages are available, but I can't see any version number.

How can I find the version of packages available in the apt-get?


Source: (StackOverflow)

How do I preserve installed applications when migrating Ubuntu to another platform?

I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been able to find anything so far on Google except where the migration is to a similar platform and file-system. I won't change the filesystem but the platform will be different. Is there something on the lines of the "World" file in Gentoo?


Source: (StackOverflow)

Checking for installed packages and if not found install

I need to check for installed packages and if not installed install them.

Example for RHEL, CentOS, Fedora:

rpm -qa | grep glibc-static
glibc-static-2.12-1.80.el6_3.5.i686

How do I do a check in BASH?

Do I do something like?

if [ "$(rpm -qa | grep glibc-static)" != "" ] ; then

And what do I need to use for other distributions? apt-get?


Source: (StackOverflow)

Installing SciPy and NumPy using pip

I'm trying to create required libraries in a package I'm distributing. It requires both the SciPy and NumPy libraries. While developing, I installed both using

apt-get install scipy

which installed SciPy 0.9.0 and NumPy 1.5.1, and it worked fine.

I would like to do the same using pip install - in order to be able to specify dependencies in a setup.py of my own package.

The problem is, when I try:

pip install 'numpy==1.5.1'

it works fine.

But then

pip install 'scipy==0.9.0'

fails miserably, with

raise self.notfounderror(self.notfounderror.__doc__)

numpy.distutils.system_info.BlasNotFoundError:

Blas (http://www.netlib.org/blas/) libraries not found.

Directories to search for the libraries can be specified in the

numpy/distutils/site.cfg file (section [blas]) or by setting

the BLAS environment variable.

How do I get it to work?


Source: (StackOverflow)

How to get a list of repositories apt-get is checking?

I want a list of repos in sources.list, plus those in sources.list.d/.

Can I get this list in a form suitable for setting up another host so it watches the same repos?

Additionally, how do I determine which repo is the source of a package, either installed or available?


Source: (StackOverflow)

How to make apt-get accept New config files in a unattended install of debian from Repo

I am writing a script for a unattended install of a package that is in our Repo, It is a Software Package with one of the Debians marked config. Is there any option that I can pass to apt-get/aptitude so that it accepts the new Config Files.

Basically I need a apt/aptitude equivalent of dpkg --force-confnew

I need to answer the following question posed while apt-get installation with a Y


Configuration file `/opt/application/conf/XXX.conf'

==> File on system created by you or by a script.

==> File also in package provided by package maintainer.

What would you like to do about it ? Your options are:

Y or I  : install the package maintainer's version

N or O  : keep your currently-installed version

  D     : show the differences between the versions

  Z     : background this process to examine the 

The default action is to keep your current version.


Additional Info:

Also,I am passing the sudo password in a pipe to execute the command

echo "mysudopass"|sudo -S apt-get mypackage

This is flagging an Error in installation when the installation is at the Config Interactive phase.

I am on Ubuntu 10.04 apt version: apt 0.7.25.3

Why i cannotuse dpkg : These debians are to be installed from Repo and I dont have local debians on my machine

Thanks Guys for your Help in advance !!!!


Source: (StackOverflow)

How to use java annotations to modify source code before final compilation?

I've read from the apt tool page that one can create AnnotationProcessors to generate new derived files (source files, class files, deployment descriptors, etc.). I am looking for example to do so.

My need is to encode all annotated strings at compile time, so that reading the class file does not allow reading the static strings:

Base code:

String message = (@Obfuscated "a string that should not be readable in class file");

Should be reworked as:

String message = new ObfuscatedString(new long[] {0x86DD4DBB5166C13DL, 0x4C79B1CDC313AE09L, 0x1A353051DAF6463BL}).toString();

Based on the static ObfuscatedString.obfuscate(String) method of the TrueLicense framework, the processor can generate the code to replace the annotated string. Indeed, this method generates the string "new ObfuscatedString([numeric_code]).toString()". At runtime the toString() method of ObfuscatedString is able to return the string encoded in the numeric code.

Any idea on how to write the process() method of the AnnotationProcessor to edit the annotated code?

Thanks in advance,


Source: (StackOverflow)

How to install a package using the python-apt API

I'm quite a newbie when it comes to Python, thus I beg foregiveness beforehand :). That said, I'm trying to make a script that, among other things, installs some Linux packages. First I tried to use subopen as explained here. While this can eventually work, I stumbled upon the python-apt API and since I'm not a big fan or re-inventing the wheel, I decided to give a try.

Problem comes when trying to find examples/tutorials on installing a package using python-apt. Searching the documentation I found the PackageManager class that has some methods to install a package. I tried some simple code to get this working:

apt_pkg.PackageManager.install("python")

This does not seem to work that easily, the install method expects apt_pkg.PackageManager instead of a plain String. Thus, looking a bit more, I found this example that looks promising, but I'm a bit reluctant to use since I don't really understand some of what is happening there.

Then, has anyone tried to install a package using python-apt or should I go for using plain-old subopen style?

Thanks!


Source: (StackOverflow)

W: Ignoring Provides line with DepCompareOp for package

I have big problem .. if I want update my system ( kali linux ) it come

look to the code

root@localhost:~# apt-get update
Reading package lists... Done
W: Ignoring Provides line with DepCompareOp for package php-psr-http-message-implementation
W: Ignoring Provides line with DepCompareOp for package php-psr-log-implementation
W: Ignoring Provides line with DepCompareOp for package php-math-biginteger
W: You may want to run apt-get update to correct these problems

Source: (StackOverflow)