How To List Packages From A PPA / Repository In Ubuntu

A few weeks ago, we saw how to find out to which PPA / repository a package belongs to in Ubuntu / Debian. But how about getting a list of packages available in a PPA / repository?

Synaptic
To get a list of packages available in a PPA / repository enabled on your system (if the repository is disabled or not added on your system, it won’t show up here), firstly install Synaptic if you haven’t already:
sudo apt-get install synaptic
(or install Synaptic GTK3)

Then open Synaptic, select “Origin” on the bottom left, then select a PPA or repository on the left and it should list all packages in that PPA / repository for your Ubuntu version, both installed and not installed:
Synaptic origin
In the latest Synaptic built with GTK3, there are two entries for each PPA here, one that uses “/now” at the end, which displays the packages you’ve installed from a repository and another one which displays all the packages available in that repository.
Important: if the exact same package (including the package version) exists in two or more PPAs / repositories, it will only be listed for one repository entry in Synaptic. That’s why I’ve added other ways of doing this (see below), which list all the packages, even if the package exists in other PPAs / repositories.

Command line
You can also do this using a command like the one below, but this will only list the package names, without any additional info (no version, description, etc.):awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*PPA-FIRST-PART*PPA-SECOND-PART*Packages
where “PPA-FIRST-PART” is the first part of a PPA, e.g. for the ppa:nilarimogard/webupd8 PPA, “PPA-FIRST-PART” is “nilarimogard” and “PPA-SECOND-PART” is “webupd8”.

Let’s try it out:
awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*nilarimogard*webupd8*Packages
And here’s the terminal output:

list packages ppa terminal
(I’ve tweaked the original command – see the credits -, to remove duplicate lines which would occur on 64bit systems with multi-arch support).
This works for regular repositories too, e.g. to see all the packages available in the proposed repository:awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*proposed*Packages
Or, to see the packages available in the security multiverse repository:
awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*security*multiverse*Packages

Using Y PPA Manager
Y PPA Manager, a small application I’ve created, can list all the packages available in each PPA added on your system. It doesn’t work with regular repositories (just Launchpad PPAs) though and the PPA needs to be enabled on your system for this to work. So it’s not perfect.
But there are advantages over Synaptic / the command above:
unlike Synaptic, it lists all the packages in a PPA, even if the exact same package (exact version) is available in multiple PPAs;unlike the command above, Y PPA Manager displays the package version next to the package name.
List packages PPA Y PPA Manager
To lists all the packages in a PPA, install Y PPA Manager:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager
Then launch Y PPA Manager, double click “Manage PPAs”, select the PPA and click “List packages”.

some info via AskUbuntu & UsemosLinux

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on How To List Packages From A PPA / Repository In Ubuntu

How To Find Out To Which PPA Repository A Package Belongs To

There are various reasons why you may need to find out to which PPA a package belongs to, for instance, in case a package in a PPA breaks something on your system, if you want to install a package which is already installed on your computer on some other machine but you don’t know the PPA you’ve used to install it and so on.

So here’s a quick tip on how to find out to which PPA a package belongs to.

Category: Ubuntu | Comments Off on How To Find Out To Which PPA Repository A Package Belongs To

Linux df Command Usage Examples

This post about Linux df command opens series of articles for Linux newbies where you’ll find description and usage examples of major Linux commands like df, top, fsck, mount and so on.

Introduction

Linux df command can be used to display disk usage statistics for the file systems present on the Linux system. It’s handy tool to know which filesystem is consuming how much memory. Also, if a particular filename is picked up and supplied as argument to df command then it displays the disk usage statistics for the file system on which the file resides. This command can be used by the system administrators to know the disk usage status of various file systems on Linux so that proper clean-up and maintenance of the Linux system can be performed. The df command provides various options through which the output can be customized in a way that is most suited to the user.

In this article, we will discuss the df command through practical examples.

Syntax

Before jumping on to the examples, lets first take a look on how to use the df command. Here is the syntax information of df command from the man page:

df [OPTION]… [FILE]…

So we see that the df command does not require any mandatory argument. The OPTION and FILE arguments are non-mandatory. While the OPTION argument tells the df command to act in a way as specified by the definition of that OPTION, the FILE argument tells the df command to print disk usage of only that file system on which the FILE resides.

NOTE: for those who are new to this type of syntax information, any argument specified in square brackets [] are non-mandatory.

Examples
1. Basic example

Here is how the df command can be used in its most basic form.

# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 29640780 4320704 23814388 16% /
udev 1536756 4 1536752 1% /dev
tmpfs 617620 888 616732 1% /run
none 5120 0 5120 0% /run/lock
none 1544044 156 1543888 1% /run/shm

In the output above, the disk usage statistics of all the file systems were displayed when the df command was run without any argument.

The first column specifies the file system name, the second column specifies the total memory for a particular file system in units of 1k-blocks where 1k is 1024 bytes. Used and available columns specify the amount of memory that is in use and is free respectively. The use column specifies the used memory in percentage while the final column ‘Mounted on’ specifies the mount point of a file system.

2. Get the disk usage of file system through a file

As already discussed in the introduction, df can display the disk usage information of a file system if any file residing on that file system is supplied as an argument to it.

Here is an example:

# df test
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 29640780 4320600 23814492 16% /

Here is another example:

# df groff.txt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 29640780 4320600 23814492 16% /

We used two different files (residing on same file system) as argument to df command. The output confirms that the df command displays the disk usage of file system on which a file resides.

3. Display inode information

There exists an option -i through which the output of the df command displays the inode information instead of block usage.

For example:

# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda6 1884160 261964 1622196 14% /
udev 212748 560 212188 1% /dev
tmpfs 216392 477 215915 1% /run
none 216392 3 216389 1% /run/lock
none 216392 8 216384 1% /run/shm

As we can see in the output above, the inode related information was displayed for each filesystem.

4. Produce a grand total

There exists an option –total through which the output displays an additional row at the end of the output which produces a total for every column.

Here is an example:

# df –total
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 29640780 4320720 23814372 16% /
udev 1536756 4 1536752 1% /dev
tmpfs 617620 892 616728 1% /run
none 5120 0 5120 0% /run/lock
none 1544044 156 1543888 1% /run/shm
total 33344320 4321772 27516860 14%

So we see that the output contains an extra row towards the end of the output and displays total for each column.

5. Produce output in human readable format

There exists an option -h through which the output of df command can be produced in a human readable format.

Here is an example:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 29G 4.2G 23G 16% /
udev 1.5G 4.0K 1.5G 1% /dev
tmpfs 604M 892K 603M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.5G 156K 1.5G 1% /run/shm

So we can see that the output displays the figures in form of ‘G’ (gigabytes), ‘M’ (megabytes) and ‘K’ (kilobytes). This makes the output easy to read and comprehend and thus makes is human readable. Note that the name of the second column is also changed to ‘size’ in order to make it human readable.

Related Links

Manual for df
Index of Linux commands


Category: Linux | Comments Off on Linux df Command Usage Examples

Speed Up apt-get Downloads With apt-fast [Ubuntu PPA]

Apt-fast is a script that can “drastically improve APT download speed” by using command line download accelerators such as Axel or Aria2 with multiple connections per package.
We’ve actually blogged about apt-fast back in 2009 but since then, the script has received some important changes so I’ve wanted to update our readers with its current status.
Since our previous apt-fast articles, the script has gained support for multiple download tools (axel and aria2), an option to download the binary in the current folder as well as an option to use either apt-get or aptitude. Further more, apt-fast has an official PPA for Ubuntu users and it’s even present in the official repositories for some Linux distributions, like PCLinuxOS for instance.
apt-fast

Features:
uses aria2 or axel, 2 great command line download tools to improve download speed, with multiple connections per package supports both apt-get and aptitudeproxy supportsupports most apt-get functions: install, upgrade, dist-upgrade, build-dep and so on
Don’t expect the script to do wonders for slow Internet connections (though I can’t really comment here since I have a really fast connection), but if you have a decent Internet connection, you should see some pretty big improvements in downloading the binaries. This is especially useful for installing / upgrading multiple or large packages, such as games (hint for 0 AD fans).

apt-fast only speeds up downloading the binaries, so even though ‘apt-fast update’ works, this command isn’t ran using a download accelerator so the speed is the same as with apt-get. Support for the ‘update’ command is, however, planned for a future release. If you can help implement this, see the apt-fast GitHub page.

Install apt-fast
Ubuntu users can install the latest stable apt-fast from its official PPA:
sudo add-apt-repository ppa:apt-fast/stable
sudo apt-get update
sudo apt-get install apt-fast

apt-fast configuration
When installing apt-fast in Ubuntu via its PPA, the package asks you if you want to use aptitude or apt-get, what download manager to use (axel or aria2c). If, later on, you want to change some of the apt-fast options, use the following command:sudo dpkg-reconfigure apt-fast
aria2c is the download tool recommended by the apt-fast developers, mostly because it supports resuming downloads.
For other Linux distributions, you can download apt-fast from GitHub.

Using apt-fast
apt-fast works the same as apt-get and all you have to do is use “sudo apt-fast install PACKAGE” instead of “apt-get” and so on for any operation.
Install a package:
sudo apt-fast install PACKAGE
Upgrade packages:
sudo apt-fast upgrade
Install the build dependencies for a package:
sudo apt-fast build-dep PACKAGE
Like I was saying, the commands are identical to apt-get and all you have to do is replace “apt-get” with “apt-fast”. There’s also a download command (“apt-fast download PACKAGE”) which downloads the binary into the current directory.
If you encounter bugs, report them @ Launchpad or GitHub.

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.



Category: Ubuntu | Comments Off on Speed Up apt-get Downloads With apt-fast [Ubuntu PPA]