0
0
Linux CLIscripting~10 mins

Why package managers install software in Linux CLI - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to install a package named 'nano' using a package manager.

Linux CLI
sudo apt-get [1] nano
Drag options to blanks, or click blank then click option'
Aremove
Bupgrade
Cupdate
Dinstall
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' instead of 'install' will uninstall the package.
Using 'update' only refreshes package lists, not install software.
2fill in blank
medium

Complete the command to update the list of available packages before installing software.

Linux CLI
sudo apt-get [1]
Drag options to blanks, or click blank then click option'
Aupgrade
Binstall
Cupdate
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'upgrade' tries to update installed packages, not refresh the list.
Using 'install' tries to add new software, not update lists.
3fill in blank
hard

Fix the error in the command to upgrade all installed packages to their latest versions.

Linux CLI
sudo apt-get [1]
Drag options to blanks, or click blank then click option'
Aupgrade
Bupdate
Cinstall
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' only refreshes package lists, it does not upgrade software.
Using 'install' tries to add new packages, not upgrade existing ones.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps package names to their version numbers if the version is greater than 2.

Linux CLI
{pkg: ver[1] for pkg, ver in packages.items() if ver [2] 2}
Drag options to blanks, or click blank then click option'
A + ' stable'
B>
C<
D * 2
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' will select wrong versions.
Using '*' tries to multiply version numbers which are strings.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase package names to their version if the version is at least 3.

Linux CLI
{ [1]: [2] for pkg, ver in packages.items() if ver [3] 3 }
Drag options to blanks, or click blank then click option'
Apkg.upper()
Bver
C>=
Dpkg.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or '>' instead of '>=' changes which versions are included.
Using lower() changes keys to lowercase, not uppercase.