194k views
1 vote
This lab exercise is to be submitted at the end of the lab session! Today we will finally learn how to update our system, upgrade our system; and lastly how to install additional software. Most modern Unix-like operating systems offer a centralized mechanism for finding and installing software. The new version of all software and the location of the file can be update through the update command. sudo apt-get update You need to run the update command before you install any software/packages to make sure that the software/packages you install are the newest version. For the packages that have successfully installed, you need to run the upgrade command to update the version of that packages to the latest version. Run the command: sudo apt-get upgrade Now all your installed packages have the newest version. We have no GUI (yet), so let's check our local database of available packages for a nice console game on the command line. Which console games are available? Let's try: apt-cache search game I grep console There is one line that talks about some pacman for console: 'pacman4console. Note this line: Let us check out what the local repository knows about it: apt-cache show pacman4console This looks good, so let's install it: sudo apt-get install pacman4console Now run it from console: pacman 4 console Now you have 5 minutes to play the game. Enjoy!!! Time up. We want to remove the packages. Run the command: sudo apt-get remove pacman 4 console We still want a little game to play, while we are waiting for the update / upgrade when we do it next time. It is very much suggested that you export your installation now, especially today, since we downloaded relevant packages and updated our system to the most recent versions of all packages. Now we want to try to archive some file. Go to the home directory. Create three file names quiz.txt, marks.xls and presentation.ptpx at your home directory. touch quiz.txt marks.xls presentation.ptpx Make sure the three files have been created. ls -1 We will put all three file into the archive file name myarchive.tar tar -cvf myarchive.tar quiz.txt marks.xls presentation.ptpx Copy the archive file to the myfolder directory. What is the command you use? Go to the mxfolder directory. Make sure that you only have three file (file1, file2.txt and myarchive.tar). We want to extract the archive file and all the file inside the archive file will be save at the myfolder directory. Run the command : tar -xvf myarchive.tar Now, list again the file and you can see there are three new files at the directory. Its means that the file have been extract from the myarchive.tar. 1s −1 We have learned how to install a package and how to archive and extract the file from the archive. That all for the lab this week. Don't forget to submit your lab sheet!

1 Answer

3 votes

Final answer:

The question involves Unix-like operating systems, focusing on updating and upgrading system packages, installing and removing software, and archiving and extracting files using command line tools, which is common knowledge at the college level for computer science students.

Step-by-step explanation:

The question is part of a computers and technology subject, specifically dealing with Unix-like operating systems and their package management systems. The grade level is college, as the tasks involve using the command line for system maintenance and software management which is often covered at a collegiate level in computer science or related courses.

Update, Upgrade, and Install Processes

To keep a Unix-like system up-to-date and to install new software, the following commands are utilized:

  1. sudo apt-get update - Refreshes the list of available packages and their versions, but does not install or upgrade any packages.
  2. sudo apt-get upgrade - Upgrades all the installed packages to their latest versions based on the information from the update command.

Installing and Removing Software

To install a console game such as pacman4console, you can use the command:

sudo apt-get install pacman4console

To remove the game, the command is:

sudo apt-get remove pacman4console

Archiving and Extracting Files

The student is instructed to archive files into a .tar archive using:

tar -cvf myarchive.tar quiz.txt marks.xls presentation.ptpx

To copy the created archive file to a directory named 'myfolder', the command would be:

cp myarchive.tar myfolder/

Finally, to extract the archive within the 'myfolder' directory, the following command is used:

tar -xvf myarchive.tar

These operations illustrate common administrative tasks performed from the command line on Unix-like systems.

User Omnomnom
by
8.0k points