How to install packages on the Raspberry Pi

How to install packages 

http://www.raspberryconnect.com/raspbian-packages-list/item/81-raspbian-aptget

How to use the apt-get command to install packages

The apt-get command is used within LXterminal to install software on the Raspberry Pi. Apt-get is also used to update and remove the Raspbian software which is also know as packages. I will go through the steps to install and remove a package using Raspbian.

This will also work if your are using any Debian based operating system such as Wheezy.

 

lx-terminal To load the terminal either select the LXterminal icon in the bottom left corner of the Desktop or from the Accessories menu.

 

For this example we will install the game Frozen Bubble. A colour based Puzzle game similar to the arcade game Bust-a-Moves or Puzzles Bubble

The apt-get command needs to know what the latest packages available are. This is done with the commandsudo apt-get update.

The sudo command give you temporary permissions to use the apt command. Without this you would not have permission to make any changes.

apt-get update command

 

 Various information will be displayed while it updates. Once it has finished type insudo apt-get install frozen-bubble

apt-get install command

 Often at this stage you will get some information about what is going to be installed and do you want to continue Y/N

If this happens enter Y. In this case I was not asked.

apt-get install comand 2

That's it, Frozen Bubble is installed and now in the main menu under Games

apt-get add to menu

Now you can start playing

frozen-bubble game

 

When a packages is installed other software packages may get installed that you have not selected as they are required for your package to work.

Sometimes though your program will not work when you run it. If you run the program in LXterminal you will get a message saying why the program did not run. You can then look into what additional packages you need to install to get the program working or search the internet for further help.

 

How to Un-install a package

To un-install Frozen-bubble use the remove command.

sudo apt-get remove frozen-bubble

 

Search for Packages

If you are not sure what the name of the program you want is you can do a search which will list all the packages with the word you enter. You can then see what the correct name is to install the package.

So I want to install that game again, you know colour bubble or whatever it is called. I know bubble is in the name so I enter the command

sudo apt-cache search bubble

Note: if you haven't done an update recently then use sudo apt-get updatebefore you search.

 apt-cache search command

You will see a list of all packages with matching results including Frozen-Bubble

 

Clean up

If you install and remove lots of packages then it is a good idea to do an occasional clean up to make sure no unwanted files are left behind.

Usesudo apt-get autoclean

 

Check what Packages are installed

To get a list of the software packages that are already installed on Raspbian enter the commanddpkg --get-selections

If you just want to find out if a package is installed already usedpkg --get-selections | grep packagename
if you are unsure of the name you can enter any text after grep, all results containg that word will be shown.

posted @ 2017-05-24 22:43  aiTest  阅读(109)  评论(0)    收藏  举报