Monday, November 10, 2008
HOWTO: Use dpkg to Install .deb Files.
I’ve written about using apt-get to get and install debian packages. However, a recent comment by a reader brought the fact that I hadn’t written anything on what to do with a .deb file that exists on your system already either by download or other media.
Using the apt-get application is the quickest way to find and install debian packages. The installation part is done by an application
named dpkg. Dpkg doesn’t have to be used by apt-get, you can use it manually as well.
From the man dpkg command:
dpkg - a medium-level package manager for Debian
Whatever that means.
In keeping with GNU/Linux system security, only the superuser can use the dpkg application. Dpkg is a typical GNU/Linux application that is controlled by command-line switches. Possibly the most common use of dpkg is to install a local .deb file.
To install a .deb file, become root and use the command:
dpkg -i filename.deb
Dpkg can also be used to:
* dpkg –unpack: unpacks the file but does not install it
* dpkg –configure: presents whatever configuration options are available for the package
* dpkg –remove: removes a package
Some of the package manipulation commands are actually carried out by an application called dpkg-deb. In those cases, dpkg just acts as a front end to dpkg-deb and passes the commands to it.
Dpkg-deb can also be used to manipulate .deb files. Some of the more useful commands of dpkg-deb are:
dpkg-deb –show filename.deb
This will display the information for filename.deb. Normally, this is boring information like the application version (which is normally evident from the filename), but in some cases more interesting and useful information is displayed.
Consult the dpkg man page for information on the more arcane uses for dpkg.
Friday, June 29, 2007
Enabling and disabling services during start up in GNU/Linux
Here I will explain different ways of enabling and disabling the system services.
1) Red Hat Method
# chkconfig httpd --add
# chkconfig httpd on --level 2,3,5This will enable the apache webserver to automatically start in the run levels 2, 3 and 5. You can check this by running the command:# chkconfig --list httpdOne can also disable the service by using the off flag as shown below:# chkconfig httpd off
# chkconfig httpd --delRed Hat also has a useful script called service which can be used to start or stop any service. Taking the previous example, to start apache webserver, you execute the command:# service httpd startand to stop the service...# service httpd stopThe options being start, stop and restart which are self explanatory.2) Debian Method
Debian Linux has its own script to enable and disable services across runlevels. It is called update-rc.d. Going by the above example, you can enable apache webserver as follows
# update-rc.d apache2 defaults# update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .And to disable the service in all the run levels, you execute the command:
# update-rc.d -f apache2 removeHere -f option which stands for force is mandatory.# update-rc.d apache2 start 20 5 . stop 80 0 1 2 3 4 6 .3) Gentoo Method# rc-update add apache2 default... and to remove the webserver, it is as simple as :# rc-update del apache2To see all the running applications at your runlevel and their status, similar to what is achieved by chkconfig --list, you use the rc-status command.# rc-status --all4) The old fashioned way# cd /etc/rc5.d/
# ln -s /etc/init.d/apache2 S20apache2lrwxrwxrwx 1 root root 17 Mar 31 13:02 S20apache2 -> ../init.d/apache2
# ln -s /etc/init.d/apache2 K80apache2(link to original post)
Wednesday, January 24, 2007
Linux on a Lenovo T60
So, work is letting me use a Lenovo T60. I put Gentoo GNU/Linux (2006.0) on it and decided to create a small page detailing the results.
If you're planning on using Debian on model 2007-63g, I highly recommend Marco Kraus' installation guide
.
- Make/Model: Lenovo T60 (Model 2008-CTO)
- Processor: Intel Core Duo (Centrino Duo) T2400 @ 1.83GHz, 2048 KiB L2 Cache
- Graphics: ATI X1400 w/64MiB DDR-1 Video RAM
- Memory: 1024MB
- Storage: Hitachi 60GB 5400RPM SATA Disk Drive
- Optical Drive: CDRW/DVD Drive (HL-DT-STCD-RW/DVD DRI)
- Audio: Intel HD Audio Chipset
- Wireless Networking: Intel PRO/Wireless 3945ABG
- Wired Networking: Intel 82573L Gigabit Ethernet
- Peripheral Networking: Bluetooth
All the goodies (lspci, dmesg, etc.) can be found here.
Here's a list of the hardware in the laptop:
| Component | Model | Status/Support | Notes |
| Processor(s) | Intel Core Duo (Centrino Duo) T2400 @ 1.83GHz, 2048 KiB L2 Cache | Excellent | Add CONFIG_X86_SMP and CONFIG_MTRR to your kernel, and you should be fine. |
| Memory | 1024MB DDR2 | Excellent | Add CONFIG_HIGHMEM to your kernel config, otherwise you'll be capped at 896MB. |
| Graphics | ATI X1400, 64MiB DDR-1 RAM | Fair | Well, this works fine with the VESA driver. However, ATI has some binary drivers |
| IDE Controller | Intel 82801GBM/GHM SATA Controller | Excellent | Works fine. Add CONFIG_SCSI_SATA, CONFIG_SCSI_SATA_AHCI, and CONFIG_SCSI_ATA_PIIX to your kernel. Probably beats the heck out of the Silicon Image junk in my Athlon64 box ... |
| Hard Disk | Hitachi 60GB 5400RPM SATA Disk Drive | Excellent | Just.. works, like it should. |
| Optical Drive | H-L Data Storage (Hitachi-LG) CD-RW/DVD GCC-4246N | Bad | libata.atapi_enabled still seems to have problems with AHCI, so disable it in the BIOS if you want to use the drive. Anyway, I burned an ISO image of the T60 BIOS, and the drive does work fine. |
| Audio | Intel HD Audio Chipset | Good | Works fine w/ALSA. Use CONFIG_SND_HDA_INTEL in the kernel, and remember to run alsaconf, otherwise you won't get any sound. Use the PCM and Front volume controls to tweak the sound. I don't know what the Headphone volume control does, because it certainly doesn't modify the headphone output. |
| Wireless Networking | Intel PRO/Wireless 8945ABG (802.11a/b/g) | Fair | Well, it works (tried w/802.11a), but Intel |
| Wired Networking | Intel 82573L Gigabit Ethernet | Good | Works fine, enable CONFIG_E1000. The firmware on this seems to be buggy or something, because if I do a warm boot without a link (eg, no cable plugged in), I get "e1000_probe: The EEPROM Checksum Is Not Valid" when the e1000 module is loaded. This works on a cold boot, and when a cable is plugged in during a warm boot. Huh? |
| Peripheral Networking | Broadcom BCM2045B Bluetooth 2.0 Receiver | Excellent | Works well w/my Logitech MX900 mouse. I suggest modularizing most (or all) of the Bluetooth options in the kernel, and emerging bluez-utils. Then, configure hidd to run at startup in /etc/conf.d/bluetooth, and rc-update -a bluetooth default. Gentoo's net.ppp scripts make jumping on the Internet via Bluetooth DUN a walk in the park. |
[Update 20060729] Updated most of the old stuff on the page. The kernel timing issue is in fact fixed in the released 2.6.17 kernel, and in distribution specific kernels, like Ubuntu 's 2.6.15-26 patch. You don't need to do any hacking for ATI's drivers anymore, they build fine against 2.6.17 kernels.
[Update 20060422] I just realized that the optical drive hasn't ever worked. Correction, it hasn't ever been able to read media. I burned an ISO just fine w/cdrecord, since it uses its own SCSI library. Apparently with AHCI enabled, libata.atapi_enabled=1 does nothing, and there is no way of accessing this drive via /dev. So, disable AHCI to use your optical drive =(
[Update 20060418] There's an official (erm, hard-masked) ebuild for the 8.24.8 drivers, now. You still need to hack your kernel and change that line in firegl_public.c, though :)
[Update 20060417] I got the ATI video drivers to work, today. First, I hacked my kernel via the following:
- Adding intermodule.o to the obj-y list in kernel/Makefile
- Adding CONFIG_OBSOLETE_INTERMODULE=y to the end of my .config
That adds (yes, you can guess it) obselete inter_module functions to the kernel, since ATI's drivers are brain-dead and use them. Now, get an unofficial Gentoo ebuild from from this post . Grab ati-driver-installer-8.24.8-x86.run and ati-driver-installer-8.24.8-x86_64.run from ATI
, and place them in /usr/portage/distfiles. Place the ebuild in /usr/portage/x11-drivers/ati-drivers (YES, this is bad, I know I should use PORTAGE_OVERLAY, but hopefully we'll see an official driver, soon, and won't have to worry) and run "ebuild ati-drivers-8.24.8.ebuild digest" to generate a digest. Next, go ahead and compile it, but interrupt the build right after it starts building the DRM module, and edit /var/tmp/portage/ati-drivers-8.24.8/work/common/lib/modules/fglrx/build_mod/firegl_public.c. Change MODULE_PARAM(firegl, "s"); to module_param(firegl, charp, 0);, then continue the build. If it works, awesome, if not - please wait for an official ebuild. Grab my dual-head xorg.conf below, if you want an example.
[Update 20060415] The first big problem I hit was a timer/clock issue, starting with a 2.6.15-gentoo-r1 kernel. Networking was just dog slow, and the system was dropping packets to hosts on the local LAN, along with some really weird latency. According to the kernel printk timestamps, only 30 seconds had gone by, when the system had been up for over 4 minutes. Also, not a good sign when keyboard repeat rate slows down and speeds up when you're just holding down a key.
The initial fix for this was to disable ACPI. Unfortunately, doing so prevented the SATA contoller to be detected. Disabling AHCI in the BIOS fixed this. However, the Intel audio module wouldn't load, and the Intel NIC didn't feel like transmitting or receiving any frames.
So, I jumped on the bleeding edge and got 2.6.17-rc1, then patched to -git9. I also set the timer frequency to 1000Hz (shouldn't have to do this, since 250Hz works perfectly on my IBM T42). I also made sure to enable the following:
CONFIG_IRQBALANCE=y
CONFIG_REGPARM=y
Maybe it was a combination of a couple things, but stuff started working. Every once and awhile I notice a small jitter here and there, which I don't think is normal, but the system feels much better, and SSH sessions are usable. wmnd doesn't seem too happy, but I don't care right now. Grab my kernel .config here.
Sunday, September 17, 2006
Gentoo in the server room?
Tuesday September 28, 2004
By: Jem Matzan
When people think of Gentoo Linux, they usually associate it solely with Linux gurus who love to tinker with their operating system -- strictly on a desktop level, of course. But while it may be a challenging distraction for home users, Gentoo Linux is increasingly being used on Web servers -- a task traditionally relegated to BSD variants (FreeBSD, primarily) and commercial GNU/Linux distributions (Red Hat, primarily) as well as Windows. Is Gentoo truly ready for "real" work? Is it just some silly distraction for programmers, or can you really use this source-based operating system to your advantage in a production environment?
Before the hosting service company offered Gentoo-based servers for their various hosting services, FreeBSD was the operating system of choice for most of Tek Alchemy's customers. Nowadays most customers request Gentoo Linux on the machines they're paying to use. "Gentoo is a really nice distro," said Dave Thomas, a senior engineer with the company. "It's easy to work with and we can do a custom install with no XFree86 or other stuff that we don't need or want on the system." But you can get a similarly configured FreeBSD system up in less time and with reportedly greater reliability. What is it about Gentoo that people value in a Web server?
It may seem crude to ask that question, because by itself Gentoo Linux is one of the most advanced GNU/Linux distributions available. The
Gentoo as a production server
One company that eats its own dog food is Seven L Networks. It uses Gentoo Linux on almost all of its back room production servers as well as most of the hosting and dedicated servers that it rents out. It runs its mail services and its own company Web site, and stores all of its data backups on Gentoo-based computers. The only critical system that does not run Gentoo is the firewall, which is graced by the legendary OpenBSD.
"Todd Berman of the Mono project helped us out when we started up, and served as our sort of CTO," said Daniel Lang, a Seven L representative. "Todd pushed us to use Gentoo; he was really excited about its customizability and flexibility."
Lang also added that Seven L -- like Tek Alchemy -- has an excellent working relationship with the Gentoo project. "One of the things I like about Gentoo is the community. There's always lots of help available, and you're not afraid to ask questions, unlike some other distros."
Daniel went on to say that using Gentoo on the customer servers is a mixed experience; while it's easy to use and maintain, and the customers who prefer Gentoo are generally more knowledgable, it does take a long time to install. Seven L engineers will do a stage 2 Gentoo install -- meaning GCC, GlibC, and other necessary programs for bootstrapping are precompiled, but the base system is not -- and then use custom precompiled binaries for some of the programs that take a particularly long time to build from source. While Seven L currently uses the 2004.1 edition of Gentoo, it plans to switch to the new 2004.2 release soon. This is not much of an issue because starting from a stage 2 tarball and then updating the source code before compiling the system means that you're getting the latest edition of Gentoo Linux one way or the other.
The underestimated distro?
With operating systems -- especially GNU/Linux distributions -- the key to trouble-free operation is choosing the right tool for the right job. Gentoo can be made into several different tools; it can be a competent and speedy desktop system, it can be used to host chroot jails, or as a Web or email server. It can securely and safely store critical data backups, or host NFS directories.
What makes Gentoo Linux stand above other distros is not just its flexibility -- Slackware and Debian are just as flexible -- but its customizability. Whereas with Debian's stable distribution you're left using software that is months or years old (including the kernel), Gentoo uses the latest tested editions of the Linux kernel, the GNU project's userland utilities and compiler, and the more than 7,000 ported programs in Portage. Slackware, although just as moldable as Gentoo and Debian, does not have an automatically updatable package management system and compiles nothing from source by default.
Gentoo is not a hacker's toy; it is a professional's tool. Let's hear from some people who use Gentoo in production environments -- we already know it makes a good custom desktop. What else do you use Gentoo for?
Jem Matzan is the author of three books, a freelance journalist and the editor-in-chief of The Jem Report.