EzDevInfo.com

debian interview questions

Top debian frequently asked interview questions

How do I download a package from apt-get without installing it? [closed]

I have a computer without a NIC, and I want to install some programs in it via USB memory, but how can I download a program from apt-get without installing it?


Source: (StackOverflow)

How to upgrade glibc from version 2.13 to 2.15 on Debian?

I heard I can do it using apt-get install libc6, but I need to add something to /etc/apt/sources.list to receive the newest glibc version. What should I do?


Source: (StackOverflow)

Advertisements

How to trust a apt repository : Debian apt-get update error public key is not available: NO_PUBKEY [closed]

Trying to update some repositories on Debian Etch installation and getting the following errors from running "apt-get update"

W: GPG error: http://www.debian-multimedia.org etch Release: The following signatures couldn't be verified because teh public key is not available: NO_PUBKEY 07DC563D1F41B907
W: You may want to run apt-get update to correct these problems

The irony of it instructing me to run apt-get update is a nice kicker...


Source: (StackOverflow)

how to test cron job?

I have a #!/bin/bash file in cron.week directory.

Is there a way to test if it works? Can't wait 1 week

I am on debian 6 with root


Source: (StackOverflow)

How to search contents of multiple pdf files?

How could I search the contents of PDF files in a directory/subdirectory? I am looking for some command line tools. It seems that grep can't search PDF files.


Source: (StackOverflow)

Centos or Debian as a server OS? [closed]

What would you choose for a server used for web hosting, dns and email and why?


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 to get file creation date/time in Bash/Debian?

I'm using Bash on Debian GNU/Linux 6.0. Is it possible to get the file creation date/time? Not the modification date/time. ls -lh a.txt and stat -c %y a.txt both only give the modification time.


Source: (StackOverflow)

How to build a Debian/Ubuntu package from source?

I have the source of a program (taken from cvs/svn/git/...) and I'd like to build a Debian/Ubuntu package for it. The package is present in the repositories, but:

  • It is an older version (lacking features I need)
  • I need slightly different compile options than the default.

What is the easiest way of doing it? I am concerned about a couple of things

  • How can I check if I have listed all the dependencies correctly? (I can get some hints by looking on what the older version depended, but new dependencies may have been added.)
  • How I can I prevent the update system installing the older version in the repo on an update?
  • How I can prevent the system installing a newer version (when its out), overwriting my custom package?

Source: (StackOverflow)

bash script always prints "Command Not Found"

Every time I run a script using bash scriptname.sh from the command line in Debian, I get Command Not found and then the result of the script. So the script works but there is always a Command Not Found statement printed on screen.

I am running the script from the /var folder.

Here is the script:

#!/bin/bash

echo Hello World

I run it by typing the following:

bash testscript.sh

UPDATE - the problem appears to the blank lines. Each blank line is resulting in a command not found. Why would this occur?


Source: (StackOverflow)

How to remove MySQL completely with config and library files?

So far I've tried the following commands:

sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get autoremove

But whenever I try to locate MySQL using the following command, I get a list of files related to MySQL:

shell>> locate mysql

Output:

/etc/mysql
/etc/apparmor.d/usr.sbin.mysqld
/etc/apparmor.d/abstractions/mysql
/etc/apparmor.d/cache/usr.sbin.mysqld
/etc/apparmor.d/cache/usr.sbin.mysqld-akonadi
/etc/apparmor.d/local/usr.sbin.mysqld
/etc/bash_completion.d/mysqladmin
/etc/init/mysql.conf
/etc/logcheck/ignore.d.paranoid/mysql-server-5_5
/etc/logcheck/ignore.d.server/mysql-server-5_5
/etc/logcheck/ignore.d.workstation/mysql-server-5_5
/etc/logrotate.d/mysql-server
/etc/mysql/conf.d
/etc/mysql/debian-start
/etc/mysql/debian.cnf
/etc/mysql/conf.d/mysqld_safe_syslog.cnf
/home/pkr/.mysql_history
/home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,libqt4-sql-mysql,,349051c3a57da571aa832adb39177aff
/home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,mysql-client,,cbf77a486cdc80547317981a33144427
/home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,mysql-client,,de8220dee4d957a9502caa79e8d2fdda
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,libqt4-sql-mysql,page,1,helpful,,17fb2e657321dc51526ee8fe9928da30
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,mysql-client,page,1,helpful,,a4c1b6e8200f36ab5745c6f81f14da0a
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,oneiric,any,libqt4-sql-mysql,page,1,helpful,,c54295fb82b8183350cd34f22c3547ef
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,oneiric,any,mysql-client,page,1,helpful,,fcf201c1abff3f774af89173a84de2cc
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,precise,any,libqt4-sql-mysql,page,1,helpful,,0cd86648584efeccfb16119012f89540
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,precise,any,mysql-client,page,1,helpful,,eb84724e9da7851ff8862a227d8bac59
/home/pkr/.local/share/akonadi/mysql.conf
/home/pkr/.local/share/akonadi/db_data/mysql
/home/pkr/.local/share/akonadi/db_data/mysql.err
/home/pkr/.local/share/akonadi/db_data/mysql.err.old
/home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/db.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/db.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/db.frm
/home/pkr/.local/share/akonadi/db_data/mysql/event.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/event.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/event.frm
/home/pkr/.local/share/akonadi/db_data/mysql/func.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/func.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/func.frm
/home/pkr/.local/share/akonadi/db_data/mysql/general_log.CSM
/home/pkr/.local/share/akonadi/db_data/mysql/general_log.CSV
/home/pkr/.local/share/akonadi/db_data/mysql/general_log.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_category.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_category.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_category.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_relation.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_relation.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_relation.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_topic.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_topic.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_topic.frm
/home/pkr/.local/share/akonadi/db_data/mysql/host.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/host.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/host.frm
/home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.frm
/home/pkr/.local/share/akonadi/db_data/mysql/plugin.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/plugin.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/plugin.frm
/home/pkr/.local/share/akonadi/db_data/mysql/proc.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/proc.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/proc.frm
/home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/servers.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/servers.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/servers.frm
/home/pkr/.local/share/akonadi/db_data/mysql/slow_log.CSM
/home/pkr/.local/share/akonadi/db_data/mysql/slow_log.CSV
/home/pkr/.local/share/akonadi/db_data/mysql/slow_log.frm
/home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.frm
/home/pkr/.local/share/akonadi/db_data/mysql/user.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/user.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/user.frm
/usr/bin/mysql
/usr/bin/mysql_install_db
/usr/bin/mysql_upgrade
/usr/bin/mysqlcheck
/usr/sbin/mysqld
/usr/share/mysql
/usr/share/app-install/desktop/gmysqlcc:gmysqlcc.desktop
/usr/share/app-install/desktop/mysql-client.desktop
/usr/share/app-install/desktop/mysql-navigator:mysql-navigator.desktop
/usr/share/app-install/desktop/mysql-server.desktop
/usr/share/app-install/icons/gmysqlcc-32.png
/usr/share/app-install/icons/mysql-navigator.png
/usr/share/doc/mysql-client-core-5.5
/usr/share/doc/mysql-server-core-5.5
/usr/share/kde4/apps/katepart/syntax/sql-mysql.xml
/usr/share/man/man1/mysql.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man8/mysqld.8.gz
/var/cache/apt/archives/akonadi-backend-mysql_1.7.2-0ubuntu1_all.deb
/var/cache/apt/archives/libmysqlclient-dev_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/libmysqlclient18_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/libqt4-sql-mysql_4%3a4.8.1-0ubuntu4.1_i386.deb
/var/cache/apt/archives/mysql-client-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-client-core-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-client_5.5.22-0ubuntu1_all.deb
/var/cache/apt/archives/mysql-common_5.5.22-0ubuntu1_all.deb
/var/cache/apt/archives/mysql-server-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-server-core-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-server_5.5.22-0ubuntu1_all.deb
/var/lib/dpkg/info/mysql-client-core-5.5.list
/var/lib/dpkg/info/mysql-client-core-5.5.md5sums
/var/lib/dpkg/info/mysql-server-5.5.list
/var/lib/dpkg/info/mysql-server-5.5.postrm
/var/lib/dpkg/info/mysql-server-core-5.5.list
/var/lib/dpkg/info/mysql-server-core-5.5.md5sums
/var/log/mysql
/var/log/mysql.err
/var/log/mysql.log
/var/log/mysql.log.1.gz
/var/log/mysql.log.2.gz
/var/log/mysql.log.3.gz
/var/log/mysql.log.4.gz
/var/log/mysql.log.5.gz
/var/log/mysql.log.6.gz
/var/log/mysql.log.7.gz
/var/log/upstart/mysql.log.1.gz
/var/log/upstart/mysql.log.2.gz
/var/log/upstart/mysql.log.3.gz
/var/log/upstart/mysql.log.4.gz
/var/log/upstart/mysql.log.5.gz
/var/log/upstart/mysql.log.6.gz
/var/log/upstart/mysql.log.7.gz

What should I do now?

I am trying to find out if there is any way I can remove all MySQL related files and then re-install MySQL.

I need it for Qt connectivity.


Source: (StackOverflow)

Installing node.js on Debian 6.0

So well, I have a vserver with Debian 6.0.

Now I would like to install Node.js, but none of the tutorials on the web seem to work. I have tried all of the results google gives me when I enter "install node.js on linux" I mostly failed because I had no idea how to install the dependencies (I'm new to linux btw)

How to install node.js on a Debian system that was just setup (so no programs already installed on it and such)?


Source: (StackOverflow)

Where are sudo incidents reported? [closed]

Attempting something devious on my machine leads to

ryan@debian:~$ sudo EAT_ALL_THE_COOKIES_BEFORE_DINNER
[sudo] password for ryan: 
ryan is not in the sudoers file.  This incident will be reported.

Where is this incident reported, and how do I get the log of all the nasty attempted commands?


Source: (StackOverflow)

CUDA incompatible with my gcc version

I have troubles compiling some of the examples shipped with CUDA SDK. I have installed the developers driver (version 270.41.19) and the CUDA toolkit, then finally the SDK (both the 4.0.17 version).

Initially it didn't compile at all giving:

error -- unsupported GNU version! gcc 4.5 and up are not supported!

I found the line responsible in 81:/usr/local/cuda/include/host_config.h and changed it to:

//#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)

from that point on I got only a few of the examples to compile, it stops with:

In file included from /usr/include/c++/4.6/x86_64-linux-gnu/bits/gthr.h:162:0,
             from /usr/include/c++/4.6/ext/atomicity.h:34,
             from /usr/include/c++/4.6/bits/ios_base.h:41,
             from /usr/include/c++/4.6/ios:43,
             from /usr/include/c++/4.6/ostream:40,
             from /usr/include/c++/4.6/iterator:64,
             from /usr/local/cuda/include/thrust/iterator/iterator_categories.h:38,
             from /usr/local/cuda/include/thrust/device_ptr.h:26,
             from /usr/local/cuda/include/thrust/device_malloc_allocator.h:27,
             from /usr/local/cuda/include/thrust/device_vector.h:26,
             from lineOfSight.cu:37:
/usr/include/c++/4.6/x86_64-linux-gnu/bits/gthr-default.h:251:1: error: pasting         "__gthrw_" and "/* Android's C library does not provide pthread_cancel, check for
`pthread_create' instead.  */" does not give a valid preprocessing token
make[1]: *** [obj/x86_64/release/lineOfSight.cu.o] Error 1

As some of the examples compile I reckon this is not a driver problem, but rather must have something to do with an unsupported gcc version. Downgrading is not an option as gcc4.6 has a whole system as a dependency at this point...


Source: (StackOverflow)