EzDevInfo.com

apt-get interview questions

Top apt-get frequently asked interview questions

How can I check the version of packages to be installed with apt-get?

After running apt-get upgrade, I get a list of the packages that will be upgraded. I would like to know the version number for one of these packages. (Not the current one but the one that will be installed).

How do I get the version number of the packages to be installed?


Source: (StackOverflow)

Why does apt-get sometimes asks for confirmation?

Sometimes it does this:

After this operation, 713kB of additional disk space will be used.
Do you want to continue [Y/n]?

And sometimes not, and just assumes 'yes' and downloads automatically (I can't paste the actual output because I don't know how to reproduce it).

Why?


Source: (StackOverflow)

Advertisements

How to install lsof on Debian/kFreeBSD?

How do you install lsof on Debian/kFreeBSD Testing (Wheezy/Sid)?

$ apt-get install lsof
Package lsof is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'lsof' has no installation candidate

Edit: /etc/apt/sources.list:

deb http://http.debian.net/debian/ testing main contrib non-free
deb-src http://http.debian.net/debian/ testing main contrib non-free

deb http://security.debian.org testing/updates main contrib non-free
deb-src http://security.debian.org testing/updates main contrib non-free

Source: (StackOverflow)

Why use the command apt-get --purge remove over apt-get purge in Linux?

I have been uninstalling applications as well as removing or purging their configuration files using the command apt-get --purge remove {package_name}.

I have come across several posts on the net including Ubuntu's guide at https://help.ubuntu.com/community/AptGet/Howto that reads "This command completely removes a package and the associated configuration files. Configuration files residing in ~ are not usually affected by this command" when just using the command apt-get purge {package_name}.

Is there a difference in running the command apt-get --purge remove {package_name} and apt-get purge {package_name}? Why would you use one over the other?


Source: (StackOverflow)

Can I make apt-get always use --no-install-recommends?

I'm trying to create a minimalist debian install for my netbook. I have a clonezilla restore point that I made right after a fresh minimal debian install.

I do not have any packages other than what debian installs automatically during a minimal install. I deselected everything in taskel (no desktop environment, nothing).

I want to install some packages. Since I am creating a minimalist install, I want to always use sudo apt-get --no-install-recommends <package-name>.

Is there a way that I can create like a custom abbreviated command for this? Or is there a way that I could copy and paste a bunch of those commands into a text document and then run them all sequentially using one command? Do you know of a simpler, more elegant way to accomplish running a bunch of packages installs from a freshly installed minimal command prompt?


Source: (StackOverflow)

What does installation script do in apt-get install?

It seems apt-get install will download a Debian package and try to run installation script for:

  • Create proper directory
  • Create proper account
  • Copy Binary files
  • Copy Data files
  • Copy Conf files
  • Copy init.d script
  • Start service
  • etc.

I’m really interested in it and want to figure out what’s going on step-by-step. Is there any way to it see? Like print shell commands in a “dry run” mode?


Source: (StackOverflow)

When would you use apt-get remove over apt-get autoremove?

I understand that apt-get remove removes packages and apt-get autoremove is to remove any packages that were installed to fulfil a dependency for a given package. So for example if I installed LibreOffice and it had dependencies on say Java and installed it as part of the installation when I run the command apt-get libreoffice, why would I run the command apt-get remove libreoffice followed by apt-get autoremove? Am I not able to simply run the command apt-get autoremove libreoffice? Or is the combination of apt-get remove and apt-get autoremove for a different purpose?


Source: (StackOverflow)

Can apt-get be used on Red Hat systems?

We know that apt-get is used on debian based systems so what is used on Red Hat Enterprise Linux (RHEL) systems? Is it possible to install and use apt-get on Red Hat?


Source: (StackOverflow)

How to find installation path for packages installed through apt-get in Ubuntu?

I have been installing python modules using apt-get which works great using the console or launching files from the command line. However I am using Eclipse for easier organisation of files.

Eclipse doesn't automatically find new modules like terminal does, so I was wondering if there was a way of finding out the install path which an apt-get command uses?

I just realised that you can delete the python eclipse looks at and reconfigure it to fix my particular problem. It would still be useful for me to find the installation path though!


Source: (StackOverflow)

How to upgrade to latest git on debian 7?

I have installed git through apt-get on debian 7 which gives me:

# git --version
git version 1.7.10.4

I would like to ugrade to the latests version of git. I have tried:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

But that gives the following errors:

Fetched 6,944 B in 0s (10.1 kB/s)
W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/source/Sources  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/binary-amd64/Packages  404  Not Found

I have also tried to follow this guide:

http://backports.debian.org/Instructions/

but I still cannot get the latest git, any suggestions?


Source: (StackOverflow)

When you do "apt-get install" where are the .deb files stored?

I am trying to copy all of the packages I have installed on one Debian machine to another Debian machine without doing another apt-get install and downloading all of the package all over again.


Source: (StackOverflow)

Installing sun-java6-jdk with apt-get on Ubuntu 10.04

I have followed the instructions on numerous pages, such as this, which say to run the following commands:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

However, when I do this I still get the following error:

me@mycomputer:~$ sudo apt-get install sun-java6-jdk Reading package lists... Done
Building dependency tree Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package sun-java6-jdk has no installation candidate

I realize Java is available from many other sources, but for reasons that I can't get into here I must use this specific version.

What can I do to get this installed?


Source: (StackOverflow)

How does Ubuntu know what programs exist and can be installed?

I typed the following in a terminal

$ musique
The program 'musique' is currently not installed. You can install it by typing:
sudo apt-get install musique

So Ubuntu knows that "musique" is a program, although it's currently not installed on the machine. However, if I type

$ musiquez
No command 'musiquez' found, did you mean:
 Command 'musique' from package 'musique' (universe)

it knows that there is no such program called "musiquez".

My question is, how does Ubuntu know this? Where is this information stored about what applications can be installed on Ubuntu?


Source: (StackOverflow)

Since when apt install can be used over apt-get install?

I've find recently that we can use the more recent apt install, remove... over the ancestral apt-get install. I didn't know that before. Because I have some scripts that install packages accross wide range of OSes, i would like to know since when apt install is available in Debian and Ubuntu?


Source: (StackOverflow)

Trouble getting latest version of Git

I am using Ubuntu 10.04 LTS. I'm looking at using git as source control for personal projects and Github as a remote repository. I was having trouble pushing a commit to my remote github repo getting the following error message:

The requested URL returned error: 403 while accessing https://github.com/Jstall/helloworld.git/info/refs

When I did some digging I found that the problem could be me not having the latest version of Git. When I did a --version I found that I have version 1.7.0.4 locally. So I tried to update git using:

sudo apt-get install git

but get the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package git has no installation candidate

I've tried running:

sudo apt-get update

and trying again but it didn't seem to make a difference. I'm not sure if it's relevant but I'm also getting a couple of 404's when I run update:

Err http://wine.budgetdedicated.com edgy/main Packages
  404  Not Found
Fetched 4,117B in 0s (5,142B/s)
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/edgy/universe/binary-i386/Packages.gz  404  Not Found [IP: 91.189.91.15 80]

W: Failed to fetch http://wine.budgetdedicated.com/apt/dists/edgy/main/binary-i386/Packages.gz  404  Not Found

I'm not sure when I should try next. Could anyone suggest a course of action to get this resolved? Any advice would be appreciated. Thanks much!


Source: (StackOverflow)