Google
 
 
Home arrow Linux Articles arrow apt-get for Linux

Main Menu
 Home
 Linux Articles
 FreeBSD Articles
 Apache Articles
 Perl Articles
 Other Articles
 Program Downloads
 Free Books
 News
 The Web Links
 Contact Us

Most Read
Automating SFTP using expect
FreeBSD PPTP VPN
Shorewall Router on Linux
SnortShorwall - Using Snort And Shorewall Together
Shorewall Stand Alone Firewall

Polls
Favorite Linux/BSD
Fedora
Mandrake
Debian
Slackware
Gentoo
Suse
FreeBSD
Other
  

Syndicate
Latest news direct to your desktop
RSS

Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one

Members Online
 Linux-BSD-Central Has a Total of 701 Members   Members (701) # Online
 We have 7 Guests Online. Guests 7
 We have 0 Users Online. Users 0

Online Users
No Users Online

Statistics
OS: Linux w
PHP: 5.2.9
MySQL: 5.0.91-community
Time: 14:38
Members: 701
Hits: 1324408
News: 277
WebLinks: 15



-->

apt-get for Linux   PDF  Print  E-mail 
Contributed by Chad Brandt  
Wednesday, 16 June 2004
Learn how to install and configure apt on Redhat/Fedora Linux. You can use apt-get to install new packages and keep your system up to date.

1. Download the apt-get rpm for your distribution. You can find the rpms here .

Install the rpm with the following command (as root)
[root]# rpm -Uvh apt*.rpm


2. run apt-get update. The first time you run this you will get a prompt to select your servers

[root]# apt-get update


3.Create a script to run the updates. Here is an example. Copy this to a file and make the file executable (chmod +x file)

#!/bin/sh

echo
echo "*** DOING AN UPDATE ***"
echo
apt-get update

echo
echo "*** DOING A CHECK ***"
echo
apt-get check

echo
echo "*** DOING AN UPGRADE ***"
echo
apt-get upgrade -y

echo
echo "*** DOING A DIST UPGRADE ***"
echo
apt-get dist-upgrade -y

echo
echo "*** CLEANING UP ***"
echo
apt-get clean


4. Create a cron job to automatically run the update script every night

[root]# crontab -e (this will open a vi editor for your cron jobs)

copy this to the vi editor (**Replace SCRIPT_DIR with the directory you put the script in)
46   4   *   *   *   SCRIPT_DIR/update.sh 2> &1 > /var/log/update.out

This will run the script every morning at 4:46 am and the system out and system error will be put in a log file /var/log/update.out. You can check that file to see if any updates were applied

If you have an smtp server configured you can have the results of your update emailed to you. To do this, create the cron entry like this:
46   4   *   *   *   SCRIPT_DIR/update.sh 2> &1 > /var/log/update.out && cat /var/log/update.out | mail -s "update results" yourname@yourdomain.com

Comments

Write Comment
Name:Guest
Title:
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



Powered by AkoComment 1.0 beta 2!




 
Google Ads



 

Check out TwistByte - The best mobile apps available For awesome Android and IPhone applications!!