LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   best way to install packages (https://www.linuxquestions.org/questions/ubuntu-63/best-way-to-install-packages-774322/)

justwantin 12-08-2009 04:50 PM

best way to install packages
 
I have just installed Ubuntu-9.10. to learn a bit about it before helping a friend who is new to Linux set up his box. I have been using Slackware for a very long time but know nothing about Ubuntu.

I have found there are packages I will need to install to set my friend up. For example I have a script that requires dvbstream to save dvb-t broadcasts to disk in realtime and it requires at/atd to schedule saves for a later time.

I was able to simply find a dvbstream deb and install it but at is not so simple since there are multiple unfulfilled dependencies.

I tried to use apt get but it seems to be default configured to canonical repos and says there is not at package available. Adding a debian repo to /etc/apt/sources.list provides no joy and based on the error messages when I run dpkg I'm not sure that install dependencies out of order is a very good idea.

What is the best way for me to download packages that I can test and configure on this box and then put on a mem stick to install on my friend's box. He has no internet so it must be done this way.

TIA

raju.mopidevi 12-08-2009 05:41 PM

download *.deb files which are needed for you.

If you are unable to find them..... then simple solution get that CPU or HD attach to your system ....do it.

craigevil 12-08-2009 06:33 PM

"Sushi Huh?" - Easily Download Packages For Offline Installation In Debian, Ubuntu, openSUSE, Fedora and Mandriva ~ Web Upd8 - http://www.webupd8.org/2009/12/sushi...kages-for.html

Or apt-zip are ways to download packages on a different system for a system that doesn't have internet.

justwantin 12-08-2009 06:54 PM

Thank-you both for replies,

Putting his HD in this box is not an option. I have ubuntu installed here on a spare partition and now have apt-get working to install but will it also download a package to file after I have already installed that package. Or do I have to use apt-zip even when using ubuntu?

If I had a list of packages with dependencies and then just downloaded them would it matter what order they were installed. Sorry, I know nothing at all about the debian packaging system

irishbitte 12-08-2009 07:04 PM

Hmmm. Would it not be easier to find the repos for these packages? Most packagers for debian based systems provide a repo for exactly what you want. And usually there is an ubuntu variant in the repo.

BTW, according to this: http://packages.ubuntu.com/karmic/dvbstream, dvbstream is available in universe.

In order to enable the universe repos, open /etc/apt/sources.list for editing in your favourite editor, remove the comments from the universe lines (looks like)
Code:

deb http://ie.archive.ubuntu.com/ubuntu/ karmic universe
and then do this:
Code:

sudo apt-get update
sudo apt-get install dvbstream

No harm to do
Code:

sudo apt-get upgrade
also, it will upgrade all packages on the system.

irishbitte 12-08-2009 07:10 PM

Also, apt will take care of all dependencies. It is possible to install .deb packages using dpkg, but it's not recommended, since apt will not take care of packages when upgrading, and may even overwrite packages that are manually installed, since it is not always aware that they exist. This can break dependencies. Using a proper apt tool like apt-get or aptitude is the best way to manage packages in your new system.

I also came from a slack background, and I promise you, if you take the time to understand apt, it will pay dividends, and make your life so much easier, it does so much of the difficult aspect of package management for you.

justwantin 12-08-2009 08:34 PM

Thanks for the input. I d'loaded dvbstream from a debian repo and installed with dpkg but its a really trivial one file ap. Other programs I required or think my friend might use Ive installed with apt-get on this test install.

I've found that all the packages have been stored in /var/cache/apt/archives.

I can now burn these onto a CD or copy them onto a memory stick and take them to my freinds house.

I could then cd into the CD or memory stick and run dpkg -i *.deb

What would the command be if I wanted "properly install them with apt? I found this on the web:
Quote:

<snipped>
7. Add this line to /etc/apt/sources.list
deb file:///home/foo/debs /

8. Resynchronize the package index files from their sources
$ sudo apt-get update

9. Install your application
$ sudo apt-get install [application name]
But to use this would assume that apt-get doesn't go anywhere else because I have commented everything else out in the sources.list.

Also, do packages have to remain in /var/cache/apt/archives or can the be deleted after install to free up space?

evo2 12-08-2009 08:39 PM

Use apt-offline. It was specifically designed for the situation you are describing

Code:

% apt-cache show apt-offline
Package: apt-offline
Priority: optional
Section: admin
Installed-Size: 316
Maintainer: Ritesh Raj Sarraf <rrs@researchut.com>
Architecture: all
Version: 0.9.5
Depends: python (>= 2.5), python-support (>= 0.90.0), python-argparse, apt
Filename: pool/main/a/apt-offline/apt-offline_0.9.5_all.deb
Size: 52758
MD5sum: d1a21c117de85822f83a3a8c469a8bda
SHA1: 7cab9efd53ef8f4b41b999151866df2e5d2076f4
SHA256: 3c048373ae2bb82efba2c17b0ba3903057164a818b8816a07e32edfaf0f90324
Description: offline apt package manager
 apt-offline is an Offline APT Package Manager
 .
 apt-offline can fully update and upgrade an APT based distribution without
 connecting to the network, all of it transparent to apt
 .
 apt-offline can be used to generate a signature on a machine (with no network).
 This signature contains all download information required for the apt database
 system. This signature file can be used on another machine connected to the
 internet (which need not be a Debian box and can even be running windows) to
 download the updates.
 The downloaded data will contain all updates in a format understood by apt and
 this data can be used by apt-offline to update the non-networked machine.
 .
 apt-offline can also fetch bug reports and make them available offline
Homepage: http://apt-offline.alioth.debian.org
Python-Version: 2.5

Or use apt-zip as craigevil suggests.

Cheers,

Evo2.

alfplayer 12-09-2009 06:53 AM

Slackware to Ubuntu (that's also my experience).

I'm linking a good tutorial showing basic programs that can be installed on ubuntu: Top things to do after installing Ubuntu Linux 9.10 Karmic Koala

apt-offline is only available for lucid on ubuntu official repositories. I'd try apt-zip.

justwantin 12-09-2009 01:11 PM

Thanks to all here for the contributions.

Since I will have installed everything on the first vanilla install using apt-get, all dependencies are in /var/cache/apt/archive. I will copy the contents pf /var/cache/apt/archive to a memory stick and install from the memory stick using dpkg -i *.deb on the second vanilla install where nothing has yet been installed. I will then run apt-get update.

justwantin 12-09-2009 01:21 PM

Thanks for the link alphplayer,

I just had a quick squiz at the article but I'm sure my friend will find it useful.

One thing I found less than transparent was getting U-910 set up on my network which is static IP. Maybe there is a wizard I missed somewhere but I had to edit/etc/resolve.conf and /etc/net/interfaces manually before I could get onto the internet.

alfplayer 12-09-2009 02:21 PM

Quote:

Originally Posted by justwantin (Post 3785764)
Thanks for the link alphplayer,

I just had a quick squiz at the article but I'm sure my friend will find it useful.

One thing I found less than transparent was getting U-910 set up on my network which is static IP. Maybe there is a wizard I missed somewhere but I had to edit/etc/resolve.conf and /etc/net/interfaces manually before I could get onto the internet.

It's there. Right-clicking Network Manager's icon on Gnome's top bar gives access to network configuration options.

justwantin 12-09-2009 04:18 PM

Maybe thats a different thingo to the one I used via the drop down menus on the left of the top bar. I'm not on that machine now but by memory I couldn't even get eth0 configured to a static IP. It wouldn't save the setting. I'll have a look next time I boot that up.

alfplayer 12-09-2009 04:28 PM

Quote:

Originally Posted by justwantin (Post 3785901)
Maybe thats a different thingo to the one I used via the drop down menus on the left of the top bar. I'm not on that machine now but by memory I couldn't even get eth0 configured to a static IP. It wouldn't save the setting. I'll have a look next time I boot that up.

There was a bug that did that on 9.04. It should work now on 9.10.

evo2 12-09-2009 09:15 PM

Although I can see the attraction of using guis like the gnome interface to network-manager for wireless on notebooks, I think that for static IPs for stationary machines you are much better off using the standard config file.

To set a static IP and automatically bring up the device at boot, enter a section like the following in the file /etc/network/interfaces.

Code:

auto eth0
iface eth0 inet static
        address 192.168.2.1
        network 192.168.2.0
        netmask 255.255.255.0
        broadcast 192.168.2.255

If you want to temporarily bring the device down you can use the command:
Code:

sudo ifdown eth0
Replace "ifdown" with "ifup" to bring it back up again.

EDIT: Oops, just rechecked the thread, and it seems I'm providing information you already know.

Cheers,

Evo2.


All times are GMT -5. The time now is 03:20 PM.