|
Tips on using apt-get to keep your Ubuntu system updated |
These all apply to Ubuntu |
|
From the Ubuntu Official Documentation:
The apt-get command is a powerful command-line tool used to work with Ubuntu's Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Ubuntu system.
Being a simple command-line tool, apt-get has numerous advantages over other package management tools available in Ubuntu for server administrators. Some of these advantages include ease of use over simple terminal connections (SSH) and the ability to be used in system administration scripts, which can in turn be automated by the cron scheduling utility.
|
|
|
After installing an operating system on a computer for the 1st time, the computer should initially be connected to the Internet from behind a firewall. Since the software on an installation disk is usually outdated, it may have significant security holes that, if exposed to the Internet, would allow the computer to be hacked almost immediately. Connecting from behind a good firewall will help reduce the risks associated with putting an unpatched system on the Internet for the 1st time.
IGO runs apt-get on every pre-built system we sell before it's shipped to you. By default, Ubuntu installs an apt-get utility that runs in the background and pops up a dialog box when updates are available.
|
|
To run apt-get manually, type :
|
|
$ sudo apt-get update
|
|
Depending on the speed of your Internet connection and the number of packages that need to be updated, it may take anywhere from a few minutes to several hours for apt-get to download and install all updates.
|
|
|
If you connect to the Internet with a dialup or some other low-bandwidth method, then updating with apt-get may not be practical. It could take days to download some of the larger software packages over a dialup. If this is your situation, you should put your system behind a firewall. Word of a new security flaw does not take long to circulate throughout the hacker communities. Leaving an unpatched system directly connected to the Internet (not behind a firewall) is a serious risk and is not recommended.
|
|
Remember, the integrity of your system is up to you. And it could be quite expensive and time-consuming to repair a compromised system.
|
|
|
If apt-get detects that a new kernel is available, it will install (instead of update) it. This way you can boot to the new kernel and determine if it will work ok (the computer boots up and functions normally). If it doesn't boot up (you get a kernel panic or it locks up), you can always boot back to the older kernel. IGO recommends keeping at least 2 versions of the kernel installed at all times.
After a new kernel is installed, you'll need to restart your computer to boot to the new kernel. When the GRUB screen appears, you should notice the new kernel at the top.
After apt-get installs a new kernel a few times, you'll have more than 2 kernels installed. To delete an old kernel, open a terminal window, su to root and type:
|
|
$ apt-get remove packagename-X.Y.Z-abc_def
|
|
where X, Y and Z correspond to the package's major version, minor version and patch levels, and abc_def corresponds to the package's extraversion (if necessary). You don't need to include the platform architecture or anything after it.
Before removing a kernel, be sure to double check your version and patch numbers!
Use the package manager to find out what kernels are installed. Point to System->Administration->Synaptic Package Manager and search for kernel-image. Be careful to not remove the kernel you're currently booted to! You can find out what kernel is currently running by typing:
|
|
$ uname -a
|
|
|
|